Fix keyboard navigation between editable text fields
In the contact editor, currently keyboard navigation
between editable text fields is broken. By setting
the IME options flag, the "next" button will be
offered in the IME when the user is in an editable
text field.
Bug: 5599728
Change-Id: I5eb74455148c1f58f9fba8ece2c5089d9fdc6bf3
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 5627aa5..0919006 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -43,6 +43,7 @@
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -196,6 +197,11 @@
PhoneNumberFormatter.setPhoneNumberFormattingTextWatcher(mContext, fieldView);
}
+ // Show the "next" button in IME to navigate between text fields
+ // TODO: Still need to properly navigate to/from sections without text fields,
+ // See Bug: 5713510
+ fieldView.setImeOptions(EditorInfo.IME_ACTION_NEXT);
+
// Read current value from state
final String column = field.column;
final String value = entry.getAsString(column);