Merge "Make group editor usable in landscape"
diff --git a/res/layout-land/group_editor_view.xml b/res/layout-land/group_editor_view.xml
new file mode 100644
index 0000000..293e529
--- /dev/null
+++ b/res/layout-land/group_editor_view.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="8dip"
+ android:paddingRight="8dip"
+ android:orientation="horizontal"
+ >
+
+ <EditText
+ android:id="@+id/group_name"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:inputType="textCapWords"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
+ android:hint="@string/group_name_hint"
+ android:minHeight="48dip"
+ android:paddingRight="8dip"
+ />
+
+ <LinearLayout
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:paddingLeft="8dip"
+ android:orientation="vertical"
+ >
+ <include
+ layout="@layout/group_editor_autocomplete_view"
+ android:id="@+id/add_member_field"/>
+ <include
+ layout="@layout/group_editor_existing_member_list"
+ android:id="@android:id/list"/>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
diff --git a/res/layout-sw580dp/group_editor_view.xml b/res/layout-sw580dp/group_editor_view.xml
index a31a36a..a16c240 100644
--- a/res/layout-sw580dp/group_editor_view.xml
+++ b/res/layout-sw580dp/group_editor_view.xml
@@ -41,7 +41,6 @@
android:layout_height="wrap_content"
android:minHeight="48dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="bold"
android:inputType="textCapWords"
android:hint="@string/group_name_hint"
android:paddingLeft="16dip"/>
diff --git a/res/layout/group_editor_autocomplete_view.xml b/res/layout/group_editor_autocomplete_view.xml
index 46539de..8482ab5 100644
--- a/res/layout/group_editor_autocomplete_view.xml
+++ b/res/layout/group_editor_autocomplete_view.xml
@@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorPrimary"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
android:hint="@string/enter_contact_name"
android:minHeight="48dip"
android:paddingLeft="@dimen/group_editor_autocomplete_left_padding"/>
\ No newline at end of file
diff --git a/res/layout/group_editor_view.xml b/res/layout/group_editor_view.xml
index e94b387..19cb82d 100644
--- a/res/layout/group_editor_view.xml
+++ b/res/layout/group_editor_view.xml
@@ -35,8 +35,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="bold"
android:inputType="textCapWords"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
android:hint="@string/group_name_hint"
android:minHeight="48dip"
android:paddingLeft="8dip"/>
diff --git a/src/com/android/contacts/group/GroupEditorFragment.java b/src/com/android/contacts/group/GroupEditorFragment.java
index fdb3cd4..96e0c8a 100644
--- a/src/com/android/contacts/group/GroupEditorFragment.java
+++ b/src/com/android/contacts/group/GroupEditorFragment.java
@@ -180,9 +180,6 @@
private LayoutInflater mLayoutInflater;
private TextView mGroupNameView;
- private ImageView mAccountIcon;
- private TextView mAccountTypeTextView;
- private TextView mAccountNameTextView;
private AutoCompleteTextView mAutoCompleteTextView;
private String mAccountName;
@@ -404,23 +401,25 @@
}
mGroupNameView = (TextView) editorView.findViewById(R.id.group_name);
- mAccountIcon = (ImageView) editorView.findViewById(R.id.account_icon);
- mAccountTypeTextView = (TextView) editorView.findViewById(R.id.account_type);
- mAccountNameTextView = (TextView) editorView.findViewById(R.id.account_name);
mAutoCompleteTextView = (AutoCompleteTextView) editorView.findViewById(
R.id.add_member_field);
mListView = (ListView) editorView.findViewById(android.R.id.list);
mListView.setAdapter(mMemberListAdapter);
- // Setup the account header
- CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(mContext);
- if (!TextUtils.isEmpty(mAccountName)) {
- mAccountNameTextView.setText(
- mContext.getString(R.string.from_account_format, mAccountName));
+ // Setup the account header, only when exists.
+ if (editorView.findViewById(R.id.account_header) != null) {
+ CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(mContext);
+ ImageView accountIcon = (ImageView) editorView.findViewById(R.id.account_icon);
+ TextView accountTypeTextView = (TextView) editorView.findViewById(R.id.account_type);
+ TextView accountNameTextView = (TextView) editorView.findViewById(R.id.account_name);
+ if (!TextUtils.isEmpty(mAccountName)) {
+ accountNameTextView.setText(
+ mContext.getString(R.string.from_account_format, mAccountName));
+ }
+ accountTypeTextView.setText(accountTypeDisplayLabel);
+ accountIcon.setImageDrawable(accountType.getDisplayIcon(mContext));
}
- mAccountTypeTextView.setText(accountTypeDisplayLabel);
- mAccountIcon.setImageDrawable(accountType.getDisplayIcon(mContext));
// Setup the autocomplete adapter (for contacts to suggest to add to the group) based on the
// account name and type. For groups that cannot have membership edited, there will be no