Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit befbd85a authored by Gary Mai's avatar Gary Mai
Browse files

Focus on name field and show keyboard when inserting contact

Request name field focus when it's an insert.

Test: Manually verified:
  * Inserting new contact with fab has keyboard and focus on name
    field
  * Inserting new contact from messenger app has keyboard and
    focus on name field with phone number filled in
  * Editing a contact has nothing focused
  * Editing a read-only contact has the name field focused but no
    keyboard

Bug: 31158231
Change-Id: Iff7e0df5059f5efa038d5f794065f76e38a21288
parent 1134a990
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -382,8 +382,7 @@
        <!-- Edit or create a contact with only the most important fields displayed initially. -->
        <activity
            android:name=".activities.ContactEditorActivity"
            android:theme="@style/EditorActivityTheme"
            android:windowSoftInputMode="stateHidden|adjustResize">
            android:theme="@style/EditorActivityTheme">

            <intent-filter>
                <action android:name="android.intent.action.INSERT"/>
+8 −0
Original line number Diff line number Diff line
@@ -497,6 +497,14 @@ public class RawContactEditorView extends LinearLayout implements View.OnClickLi
            addReadOnlyRawContactEditorViews();
        } else {
            setupEditorNormally();
            // If we're inserting a new contact, request focus to bring up the keyboard for the
            // name field.
            if (mHasNewContact) {
                final StructuredNameEditorView name = getNameEditorView();
                if (name != null) {
                    name.requestFocusForFirstEditField();
                }
            }
        }
        if (mListener != null) mListener.onEditorsBound();
    }