summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout-land/compact_contact_editor_fragment.xml7
-rw-r--r--res/layout/compact_contact_editor_fragment.xml7
-rw-r--r--res/layout/raw_contact_editor_view.xml7
-rw-r--r--src/com/android/contacts/editor/ContactEditorBaseFragment.java5
-rw-r--r--src/com/android/contacts/editor/ContactEditorFragment.java6
5 files changed, 21 insertions, 11 deletions
diff --git a/res/layout-land/compact_contact_editor_fragment.xml b/res/layout-land/compact_contact_editor_fragment.xml
index 23630911e..12445cd23 100644
--- a/res/layout-land/compact_contact_editor_fragment.xml
+++ b/res/layout-land/compact_contact_editor_fragment.xml
@@ -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"
diff --git a/res/layout/compact_contact_editor_fragment.xml b/res/layout/compact_contact_editor_fragment.xml
index 696f8db95..76b7be3a8 100644
--- a/res/layout/compact_contact_editor_fragment.xml
+++ b/res/layout/compact_contact_editor_fragment.xml
@@ -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>
diff --git a/res/layout/raw_contact_editor_view.xml b/res/layout/raw_contact_editor_view.xml
index a7e74bc4e..97c1b495b 100644
--- a/res/layout/raw_contact_editor_view.xml
+++ b/res/layout/raw_contact_editor_view.xml
@@ -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" />
diff --git a/src/com/android/contacts/editor/ContactEditorBaseFragment.java b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
index 5488de575..43ec8e12a 100644
--- a/src/com/android/contacts/editor/ContactEditorBaseFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
@@ -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();
}
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 458e32554..3ad526133 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -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