From 9ee70bd02c9d77368d6d268046d1bd47ac13b4a3 Mon Sep 17 00:00:00 2001 From: blong Date: Wed, 29 Oct 2014 15:44:12 +0800 Subject: Enhance Phone and SIM account display - Make the enhancement of icon and label display for Phone and SIM account Change-Id: I6339ddc816e05125401dc3637077978bcd564571 --- res/layout/editor_account_header_with_dropdown.xml | 2 +- res/values-zh-rCN/strings.xml | 2 +- src/com/android/contacts/editor/RawContactEditorView.java | 8 +++++--- src/com/android/contacts/group/GroupEditorFragment.java | 7 ++++++- 4 files changed, 13 insertions(+), 6 deletions(-) mode change 100644 => 100755 res/layout/editor_account_header_with_dropdown.xml diff --git a/res/layout/editor_account_header_with_dropdown.xml b/res/layout/editor_account_header_with_dropdown.xml old mode 100644 new mode 100755 index 015358e87..db20bb88a --- a/res/layout/editor_account_header_with_dropdown.xml +++ b/res/layout/editor_account_header_with_dropdown.xml @@ -30,7 +30,7 @@ "拆分" "修改" "删除" - "移除组成员" + "移动组成员" "添加联系人" "添加群组" "要拆分联系人吗?" 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)); -- cgit v1.2.3