Merge "Process numpad enter key along with enter key." into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-04-23 01:12:52 +00:00
committed by Android (Google) Code Review
7 changed files with 9 additions and 1 deletions

View File

@@ -5863,6 +5863,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
case KeyEvent.KEYCODE_DPAD_RIGHT:
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
okToSend = false;
break;
case KeyEvent.KEYCODE_BACK:

View File

@@ -821,6 +821,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
// was a click, the text view gets the selected item
// from the drop down as its content
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_TAB:
if (event.hasNoModifiers()) {

1
core/java/android/widget/ListPopupWindow.java Normal file → Executable file
View File

@@ -1005,6 +1005,7 @@ public class ListPopupWindow implements ShowableListMenu {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
return true;
}
} else {

View File

@@ -1033,6 +1033,7 @@ public class NumberPicker extends LinearLayout {
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
removeAllCallbacks();
break;
case KeyEvent.KEYCODE_DPAD_DOWN:

3
core/java/android/widget/SearchView.java Normal file → Executable file
View File

@@ -1076,7 +1076,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
// The search key is handled by the dialog's onKeyDown().
if (!mSearchSrcTextView.isEmpty() && event.hasNoModifiers()) {
if (event.getAction() == KeyEvent.ACTION_UP) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
if (keyCode == KeyEvent.KEYCODE_ENTER
|| keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER) {
v.cancelLongPress();
// Launch as a regular search.

View File

@@ -420,6 +420,7 @@ class SimpleMonthView extends View {
break;
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
if (mHighlightedDay != -1) {
onDayClicked(mHighlightedDay);
return true;

View File

@@ -8359,6 +8359,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
switch (keyCode) {
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
if (event.hasNoModifiers()) {
// When mInputContentType is set, we know that we are
// running in a "modern" cupcake environment, so don't need
@@ -8586,6 +8587,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return super.onKeyUp(keyCode, event);
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
if (event.hasNoModifiers()) {
if (mEditor != null && mEditor.mInputContentType != null
&& mEditor.mInputContentType.onEditorActionListener != null