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

Commit 6dd0d4e8 authored by Walter Jang's avatar Walter Jang
Browse files

Don't initially focus any contact editor input field

Bug 21644158

Change-Id: I84d1406b4db1646dcbf059ce84a2cc7534b0bd83
parent 88b0a8cc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -26,6 +26,13 @@

    <include layout="@layout/compact_photo_editor_view" />

    <!-- Dummy view so the first input field is not initially focused. b/21644158 -->
    <View
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:focusable="true"
            android:focusableInTouchMode="true"/>

    <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
+7 −0
Original line number Diff line number Diff line
@@ -32,6 +32,13 @@

        <include layout="@layout/compact_photo_editor_view" />

        <!-- Dummy view so the first input field is not initially focused. b/21644158 -->
        <View
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:focusable="true"
                android:focusableInTouchMode="true"/>

        <include layout="@layout/compact_contact_editor_fields" />

    </com.android.contacts.editor.CompactRawContactsEditorView>
+7 −0
Original line number Diff line number Diff line
@@ -34,6 +34,13 @@
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <!-- Dummy view so the first input field is not initially focused. b/21644158 -->
        <View
           android:layout_width="0dp"
           android:layout_height="0dp"
           android:focusable="true"
           android:focusableInTouchMode="true"/>

        <include
            android:id="@+id/edit_name"
            layout="@layout/structured_name_editor_view" />
+0 −5
Original line number Diff line number Diff line
@@ -373,9 +373,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
    // Used to pre-populate the editor with a display name when a user edits a read-only contact.
    protected String mDefaultDisplayName;

    // Whether the name editor should receive focus after being bound
    protected boolean mRequestFocus;

    // Whether to show a Toast message after saves have completed.
    // Does not affect successful toasts shown after joins, which are never displayed.
    protected boolean mShowToastAfterSave = true;
@@ -1155,7 +1152,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
            RawContactDelta oldState, AccountType oldAccountType) {
        mStatus = Status.EDITING;
        mState.add(createNewRawContactDelta(account, accountType, oldState, oldAccountType));
        mRequestFocus = true;
        mNewContactDataReady = true;
        bindEditors();
    }
@@ -1233,7 +1229,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
                mState.add(createLocalRawContactDelta());
            }
        }
        mRequestFocus = true;
        mExistingContactDataReady = true;
        bindEditors();
    }
+0 −6
Original line number Diff line number Diff line
@@ -292,10 +292,6 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
                };

                final StructuredNameEditorView nameEditor = rawContactEditor.getNameEditor();
                if (mRequestFocus) {
                    nameEditor.requestFocus();
                    mRequestFocus = false;
                }
                nameEditor.setEditorListener(structuredNameListener);
                if (!TextUtils.isEmpty(mDefaultDisplayName)) {
                    nameEditor.setDisplayName(mDefaultDisplayName);
@@ -311,8 +307,6 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
            }
        }

        mRequestFocus = false;

        setGroupMetaData();

        // Show editor now that we've loaded state