diff options
author | blong <blong@codeaurora.org> | 2014-10-29 15:44:12 +0800 |
---|---|---|
committer | Xiaojing Zhang <zhangx@codeaurora.org> | 2014-11-04 20:33:19 -0800 |
commit | 9ee70bd02c9d77368d6d268046d1bd47ac13b4a3 (patch) | |
tree | 4819d6233c16c86f4bff4eb035f30240bcbbb259 | |
parent | 44088406c1a0c8ee1bff14e54d9ffb44a9b659f8 (diff) | |
download | packages_apps_Contacts-9ee70bd02c9d77368d6d268046d1bd47ac13b4a3.tar.gz packages_apps_Contacts-9ee70bd02c9d77368d6d268046d1bd47ac13b4a3.tar.bz2 packages_apps_Contacts-9ee70bd02c9d77368d6d268046d1bd47ac13b4a3.zip |
Enhance Phone and SIM account display
- Make the enhancement of icon and label display for Phone and
SIM account
Change-Id: I6339ddc816e05125401dc3637077978bcd564571
-rwxr-xr-x[-rw-r--r--] | res/layout/editor_account_header_with_dropdown.xml | 2 | ||||
-rwxr-xr-x | res/values-zh-rCN/strings.xml | 2 | ||||
-rwxr-xr-x | src/com/android/contacts/editor/RawContactEditorView.java | 8 | ||||
-rwxr-xr-x | src/com/android/contacts/group/GroupEditorFragment.java | 7 |
4 files changed, 13 insertions, 6 deletions
diff --git a/res/layout/editor_account_header_with_dropdown.xml b/res/layout/editor_account_header_with_dropdown.xml index 015358e87..db20bb88a 100644..100755 --- a/res/layout/editor_account_header_with_dropdown.xml +++ b/res/layout/editor_account_header_with_dropdown.xml @@ -30,7 +30,7 @@ <LinearLayout android:id="@+id/account" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_width="0dip" android:layout_weight="1" android:orientation="vertical" diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index d161c440c..17c01e14b 100755 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -51,7 +51,7 @@ <string name="menu_splitAggregate" msgid="8368636463748691868">"拆分"</string> <string name="menu_editGroup" msgid="5062005185370983720">"修改"</string> <string name="menu_deleteGroup" msgid="3486380004411482874">"删除"</string> - <string name="menu_moveGroupMembers">"移除组成员"</string> + <string name="menu_moveGroupMembers">"移动组成员"</string> <string name="menu_new_contact_action_bar" msgid="7263362129442119188">"添加联系人"</string> <string name="menu_new_group_action_bar" msgid="3520232877587377175">"添加群组"</string> <string name="splitConfirmation_title" msgid="633640935430370530">"要拆分联系人吗?"</string> diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java index 974475c10..3595bf3e2 100755 --- a/src/com/android/contacts/editor/RawContactEditorView.java +++ b/src/com/android/contacts/editor/RawContactEditorView.java @@ -242,11 +242,13 @@ public class RawContactEditorView extends BaseRawContactEditorView { } } else { String accountName = state.getAccountName(); - CharSequence accountType = type.getDisplayLabel(mContext); + String account = state.getAccountType(); + CharSequence accountType = type.getDisplayLabel(mContext, accountName); if (TextUtils.isEmpty(accountType)) { accountType = mContext.getString(R.string.account_phone); } - if (!TextUtils.isEmpty(accountName)) { + if (!TextUtils.isEmpty(accountName) && !SimAccountType.ACCOUNT_TYPE.equals(account) + && !PhoneAccountType.ACCOUNT_TYPE.equals(account)) { mAccountNameTextView.setVisibility(View.VISIBLE); mAccountNameTextView.setText( mContext.getString(R.string.from_account_format, accountName)); @@ -257,7 +259,7 @@ public class RawContactEditorView extends BaseRawContactEditorView { mAccountTypeTextView.setText( mContext.getString(R.string.account_type_format, accountType)); } - mAccountIcon.setImageDrawable(type.getDisplayIcon(mContext)); + mAccountIcon.setImageDrawable(type.getDisplayIcon(mContext, state.getAccountName())); // Show photo editor when supported RawContactModifier.ensureKindExists(state, type, Photo.CONTENT_ITEM_TYPE); diff --git a/src/com/android/contacts/group/GroupEditorFragment.java b/src/com/android/contacts/group/GroupEditorFragment.java index cd842ca9a..749d68b20 100755 --- a/src/com/android/contacts/group/GroupEditorFragment.java +++ b/src/com/android/contacts/group/GroupEditorFragment.java @@ -67,6 +67,7 @@ import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountWithDataSet; +import com.android.contacts.common.model.account.PhoneAccountType; import com.android.contacts.common.editor.SelectAccountDialogFragment; import com.android.contacts.group.SuggestedMemberListAdapter.SuggestedMember; import com.android.contacts.common.model.AccountTypeManager; @@ -423,9 +424,13 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog 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)) { + if (!TextUtils.isEmpty(mAccountName) + && !SimContactsConstants.PHONE_NAME.equals(mAccountName)) { accountNameTextView.setText( mContext.getString(R.string.from_account_format, mAccountName)); + accountNameTextView.setVisibility(View.VISIBLE); + } else { + accountNameTextView.setVisibility(View.GONE); } accountTypeTextView.setText(accountTypeDisplayLabel); accountIcon.setImageDrawable(accountType.getDisplayIcon(mContext)); |