Loading api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -26832,8 +26832,10 @@ package android.view { method public final boolean hasModifiers(int); method public final boolean hasModifiers(int); method public final boolean hasNoModifiers(); method public final boolean hasNoModifiers(); method public final boolean isAltPressed(); method public final boolean isAltPressed(); method public final boolean isCancelKey(); method public final boolean isCanceled(); method public final boolean isCanceled(); method public final boolean isCapsLockOn(); method public final boolean isCapsLockOn(); method public final boolean isConfirmKey(); method public final boolean isCtrlPressed(); method public final boolean isCtrlPressed(); method public final boolean isFunctionPressed(); method public final boolean isFunctionPressed(); method public static final boolean isGamepadButton(int); method public static final boolean isGamepadButton(int); core/java/android/view/KeyEvent.java +23 −4 Original line number Original line Diff line number Diff line Loading @@ -1847,13 +1847,32 @@ public class KeyEvent extends InputEvent implements Parcelable { } } } } /** Whether key will, by default, trigger a click on the focused view. /** * @hide * Returns true if the key event should be treated as a confirming action. * @return True for a confirmation key, such as {@link #KEYCODE_DPAD_CENTER}, * {@link #KEYCODE_ENTER}, or {@link #KEYCODE_BUTTON_A}. */ */ public static final boolean isConfirmKey(int keyCode) { public final boolean isConfirmKey() { switch (keyCode) { switch (mKeyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_BUTTON_A: return true; default: return false; } } /** * Returns true if the key event should be treated as a cancelling action. * @return True for a cancellation key, such as {@link #KEYCODE_ESCAPE}, * {@link #KEYCODE_BACK}, or {@link #KEYCODE_BUTTON_B}. */ public final boolean isCancelKey() { switch (mKeyCode) { case KeyEvent.KEYCODE_BUTTON_B: case KeyEvent.KEYCODE_ESCAPE: case KeyEvent.KEYCODE_BACK: return true; return true; default: default: return false; return false; Loading core/java/android/view/View.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -8186,7 +8186,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) { boolean result = false; boolean result = false; if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; return true; } } Loading Loading @@ -8228,7 +8228,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param event The KeyEvent object that defines the button action. * @param event The KeyEvent object that defines the button action. */ */ public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; return true; } } Loading core/java/android/widget/AbsListView.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -3039,7 +3039,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override @Override public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if (!isEnabled()) { if (!isEnabled()) { return true; return true; } } Loading core/java/android/widget/Gallery.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList @Override @Override public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if (mReceivedInvokeKeyDown) { if (mReceivedInvokeKeyDown) { if (mItemCount > 0) { if (mItemCount > 0) { dispatchPress(mSelectedChild); dispatchPress(mSelectedChild); Loading Loading
api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -26832,8 +26832,10 @@ package android.view { method public final boolean hasModifiers(int); method public final boolean hasModifiers(int); method public final boolean hasNoModifiers(); method public final boolean hasNoModifiers(); method public final boolean isAltPressed(); method public final boolean isAltPressed(); method public final boolean isCancelKey(); method public final boolean isCanceled(); method public final boolean isCanceled(); method public final boolean isCapsLockOn(); method public final boolean isCapsLockOn(); method public final boolean isConfirmKey(); method public final boolean isCtrlPressed(); method public final boolean isCtrlPressed(); method public final boolean isFunctionPressed(); method public final boolean isFunctionPressed(); method public static final boolean isGamepadButton(int); method public static final boolean isGamepadButton(int);
core/java/android/view/KeyEvent.java +23 −4 Original line number Original line Diff line number Diff line Loading @@ -1847,13 +1847,32 @@ public class KeyEvent extends InputEvent implements Parcelable { } } } } /** Whether key will, by default, trigger a click on the focused view. /** * @hide * Returns true if the key event should be treated as a confirming action. * @return True for a confirmation key, such as {@link #KEYCODE_DPAD_CENTER}, * {@link #KEYCODE_ENTER}, or {@link #KEYCODE_BUTTON_A}. */ */ public static final boolean isConfirmKey(int keyCode) { public final boolean isConfirmKey() { switch (keyCode) { switch (mKeyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_BUTTON_A: return true; default: return false; } } /** * Returns true if the key event should be treated as a cancelling action. * @return True for a cancellation key, such as {@link #KEYCODE_ESCAPE}, * {@link #KEYCODE_BACK}, or {@link #KEYCODE_BUTTON_B}. */ public final boolean isCancelKey() { switch (mKeyCode) { case KeyEvent.KEYCODE_BUTTON_B: case KeyEvent.KEYCODE_ESCAPE: case KeyEvent.KEYCODE_BACK: return true; return true; default: default: return false; return false; Loading
core/java/android/view/View.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -8186,7 +8186,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) { boolean result = false; boolean result = false; if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; return true; } } Loading Loading @@ -8228,7 +8228,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param event The KeyEvent object that defines the button action. * @param event The KeyEvent object that defines the button action. */ */ public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; return true; } } Loading
core/java/android/widget/AbsListView.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -3039,7 +3039,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override @Override public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if (!isEnabled()) { if (!isEnabled()) { return true; return true; } } Loading
core/java/android/widget/Gallery.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList @Override @Override public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) { if (KeyEvent.isConfirmKey(keyCode)) { if (event.isConfirmKey()) { if (mReceivedInvokeKeyDown) { if (mReceivedInvokeKeyDown) { if (mItemCount > 0) { if (mItemCount > 0) { dispatchPress(mSelectedChild); dispatchPress(mSelectedChild); Loading