类android.support.v4.view.KeyEventCompat源码实例Demo

下面列出了怎么用android.support.v4.view.KeyEventCompat的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: likeJDGoodsDetails   文件: VerViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
			case KeyEvent.KEYCODE_DPAD_LEFT:
				handled = arrowScroll(FOCUS_LEFT);
				break;
			case KeyEvent.KEYCODE_DPAD_RIGHT:
				handled = arrowScroll(FOCUS_RIGHT);
				break;
			case KeyEvent.KEYCODE_TAB:
				if (Build.VERSION.SDK_INT >= 11) {
					// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
					// before Android 3.0. Ignore the tab key on those devices.
					if (KeyEventCompat.hasNoModifiers(event)) {
						handled = arrowScroll(FOCUS_FORWARD);
					} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
						handled = arrowScroll(FOCUS_BACKWARD);
					}
				}
				break;
		}
	}
	return handled;
}
 
源代码2 项目: fangzhuishushenqi   文件: DirectionalViewpager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码3 项目: YViewPagerDemo   文件: YViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码4 项目: YViewPagerDemo   文件: YViewPagerNew.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码5 项目: LiuAGeAndroid   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码6 项目: Rey-MusicPlayer   文件: VelocityViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码7 项目: WeatherStream   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码8 项目: ImageSliderWithSwipes   文件: ViewPagerEx.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码9 项目: SprintNBA   文件: VerticalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
  boolean handled = false;
  if (event.getAction() == KeyEvent.ACTION_DOWN) {
    switch (event.getKeyCode()) {
      case KeyEvent.KEYCODE_DPAD_LEFT:
        handled = arrowScroll(FOCUS_LEFT);
        break;
      case KeyEvent.KEYCODE_DPAD_RIGHT:
        handled = arrowScroll(FOCUS_RIGHT);
        break;
      case KeyEvent.KEYCODE_TAB:
        if (Build.VERSION.SDK_INT >= 11) {
          // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
          // before Android 3.0. Ignore the tab key on those devices.
          if (KeyEventCompat.hasNoModifiers(event)) {
            handled = arrowScroll(FOCUS_FORWARD);
          } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
            handled = arrowScroll(FOCUS_BACKWARD);
          }
        }
        break;
    }
  }
  return handled;
}
 
源代码10 项目: BigApp_Discuz_Android   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码11 项目: 920-text-editor-v2   文件: TabViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码12 项目: Moring-Alarm   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码13 项目: BigApp_WordPress_Android   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码14 项目: Study_Android_Demo   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码15 项目: AndroidBase   文件: LazyViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码16 项目: RxJavaApp   文件: ViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码17 项目: InfiniteCycleViewPager   文件: VerticalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码18 项目: BookReader   文件: DirectionalViewpager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码19 项目: nono-android   文件: FuckViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码20 项目: RxZhihuDaily   文件: ViewPagerCompact.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码21 项目: android-project-wo2b   文件: ViewPagerCompat.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码22 项目: KickAssSlidingMenu   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码23 项目: FlippableStackView   文件: OrientedViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码24 项目: LoyalNativeSlider   文件: ViewPagerEx.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码26 项目: quickmark   文件: CustomViewAbove.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
	boolean handled = false;
	if (event.getAction() == KeyEvent.ACTION_DOWN) {
		switch (event.getKeyCode()) {
		case KeyEvent.KEYCODE_DPAD_LEFT:
			handled = arrowScroll(FOCUS_LEFT);
			break;
		case KeyEvent.KEYCODE_DPAD_RIGHT:
			handled = arrowScroll(FOCUS_RIGHT);
			break;
		case KeyEvent.KEYCODE_TAB:
			if (Build.VERSION.SDK_INT >= 11) {
				// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
				// before Android 3.0. Ignore the tab key on those devices.
				if (KeyEventCompat.hasNoModifiers(event)) {
					handled = arrowScroll(FOCUS_FORWARD);
				} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
					handled = arrowScroll(FOCUS_BACKWARD);
				}
			}
			break;
		}
	}
	return handled;
}
 
源代码27 项目: actor-platform   文件: VerticalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码28 项目: TLint   文件: VerticalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码29 项目: DoubleViewPager   文件: HorizontalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
源代码30 项目: DoubleViewPager   文件: VerticalViewPager.java
/**
 * You can call this function yourself to have the scroll view perform
 * scrolling from a key event, just as if the event had been dispatched to
 * it by the view hierarchy.
 *
 * @param event The key event to execute.
 * @return Return true if the event was handled, else false.
 */
public boolean executeKeyEvent(KeyEvent event) {
    boolean handled = false;
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_DPAD_LEFT:
                handled = arrowScroll(FOCUS_LEFT);
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                handled = arrowScroll(FOCUS_RIGHT);
                break;
            case KeyEvent.KEYCODE_TAB:
                if (Build.VERSION.SDK_INT >= 11) {
                    // The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
                    // before Android 3.0. Ignore the tab key on those devices.
                    if (KeyEventCompat.hasNoModifiers(event)) {
                        handled = arrowScroll(FOCUS_FORWARD);
                    } else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
                        handled = arrowScroll(FOCUS_BACKWARD);
                    }
                }
                break;
        }
    }
    return handled;
}
 
 类所在包
 同包方法