Loading core/java/android/widget/AbsListView.java +1 −4 Original line number Diff line number Diff line Loading @@ -2925,9 +2925,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: if (KeyEvent.isConfirmKey(keyCode)) { if (!isEnabled()) { return true; } Loading @@ -2943,7 +2941,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te setPressed(false); return true; } break; } return super.onKeyUp(keyCode, event); } Loading core/java/android/widget/Gallery.java +3 −10 Original line number Diff line number Diff line Loading @@ -1228,13 +1228,9 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: { if (KeyEvent.isConfirmKey(keyCode)) { if (mReceivedInvokeKeyDown) { if (mItemCount > 0) { dispatchPress(mSelectedChild); postDelayed(new Runnable() { @Override Loading @@ -1251,11 +1247,8 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList // Clear the flag mReceivedInvokeKeyDown = false; return true; } } return super.onKeyUp(keyCode, event); } Loading core/java/android/widget/ListPopupWindow.java +5 −12 Original line number Diff line number Diff line Loading @@ -821,8 +821,7 @@ public class ListPopupWindow { // to select one of its items if (keyCode != KeyEvent.KEYCODE_SPACE && (mDropDownList.getSelectedItemPosition() >= 0 || (keyCode != KeyEvent.KEYCODE_ENTER && keyCode != KeyEvent.KEYCODE_DPAD_CENTER))) { || !KeyEvent.isConfirmKey(keyCode))) { int curIndex = mDropDownList.getSelectedItemPosition(); boolean consumed; Loading Loading @@ -910,16 +909,10 @@ public class ListPopupWindow { public boolean onKeyUp(int keyCode, KeyEvent event) { if (isShowing() && mDropDownList.getSelectedItemPosition() >= 0) { boolean consumed = mDropDownList.onKeyUp(keyCode, event); if (consumed) { switch (keyCode) { // if the list accepts the key events and the key event // was a click, the text view gets the selected item // from the drop down as its content case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_DPAD_CENTER: if (consumed && KeyEvent.isConfirmKey(keyCode)) { // if the list accepts the key events and the key event was a click, the text view // gets the selected item from the drop down as its content dismiss(); break; } } return consumed; } Loading Loading
core/java/android/widget/AbsListView.java +1 −4 Original line number Diff line number Diff line Loading @@ -2925,9 +2925,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: if (KeyEvent.isConfirmKey(keyCode)) { if (!isEnabled()) { return true; } Loading @@ -2943,7 +2941,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te setPressed(false); return true; } break; } return super.onKeyUp(keyCode, event); } Loading
core/java/android/widget/Gallery.java +3 −10 Original line number Diff line number Diff line Loading @@ -1228,13 +1228,9 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: { if (KeyEvent.isConfirmKey(keyCode)) { if (mReceivedInvokeKeyDown) { if (mItemCount > 0) { dispatchPress(mSelectedChild); postDelayed(new Runnable() { @Override Loading @@ -1251,11 +1247,8 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList // Clear the flag mReceivedInvokeKeyDown = false; return true; } } return super.onKeyUp(keyCode, event); } Loading
core/java/android/widget/ListPopupWindow.java +5 −12 Original line number Diff line number Diff line Loading @@ -821,8 +821,7 @@ public class ListPopupWindow { // to select one of its items if (keyCode != KeyEvent.KEYCODE_SPACE && (mDropDownList.getSelectedItemPosition() >= 0 || (keyCode != KeyEvent.KEYCODE_ENTER && keyCode != KeyEvent.KEYCODE_DPAD_CENTER))) { || !KeyEvent.isConfirmKey(keyCode))) { int curIndex = mDropDownList.getSelectedItemPosition(); boolean consumed; Loading Loading @@ -910,16 +909,10 @@ public class ListPopupWindow { public boolean onKeyUp(int keyCode, KeyEvent event) { if (isShowing() && mDropDownList.getSelectedItemPosition() >= 0) { boolean consumed = mDropDownList.onKeyUp(keyCode, event); if (consumed) { switch (keyCode) { // if the list accepts the key events and the key event // was a click, the text view gets the selected item // from the drop down as its content case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_DPAD_CENTER: if (consumed && KeyEvent.isConfirmKey(keyCode)) { // if the list accepts the key events and the key event was a click, the text view // gets the selected item from the drop down as its content dismiss(); break; } } return consumed; } Loading