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

Commit f9c1e4ae authored by blong's avatar blong
Browse files

customize SIM/PHONE account display info

- Customize SIM/PHONE account display name and icon

Change-Id: I5c3daa4c26a828e72c3efe3cdb65df20cc321702
parent cdf3fc32
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,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"
+4 −1
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.AccountType.EditField;
import com.android.contacts.common.model.account.AccountType.EditType;
import com.android.contacts.common.model.account.AccountWithDataSet;
import com.android.contacts.common.model.account.PhoneAccountType;
import com.android.contacts.common.model.account.SimAccountType;
import com.android.contacts.common.model.dataitem.DataKind;
import com.android.contacts.common.SimContactsConstants;
import com.android.contacts.common.MoreContactUtils;
@@ -372,7 +374,8 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O
            return;
        }
        vlog("Account info loaded");
        if (accountInfo.first == null) {
        if (accountInfo.first == null || SimAccountType.ACCOUNT_TYPE.equals(accountType.
                accountType)|| PhoneAccountType.ACCOUNT_TYPE.equals(accountType.accountType)) {
            mAccountNameView.setVisibility(View.GONE);
        } else {
            mAccountNameView.setVisibility(View.VISIBLE);
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class EditorUiUtils {
     */
    public static Pair<String,String> getAccountInfo(Context context, boolean isProfile,
            String accountName, AccountType accountType) {
        CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(context);
        CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(context, accountName);

        if (isProfile) {
            if (TextUtils.isEmpty(accountName)) {
+4 −1
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import android.widget.TextView;
import com.android.contacts.GroupMetaDataLoader;
import com.android.contacts.R;
import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.PhoneAccountType;
import com.android.contacts.common.model.account.SimAccountType;
import com.android.contacts.common.model.account.AccountType.EditType;
import com.android.contacts.common.model.dataitem.DataKind;
import com.android.contacts.common.model.RawContactDelta;
@@ -197,7 +199,8 @@ public class RawContactEditorView extends BaseRawContactEditorView {
            // Hide this view so the other text view will be centered vertically
            mAccountHeaderNameTextView.setVisibility(View.GONE);
        } else {
            if (accountInfo.first == null) {
            if (accountInfo.first == null || SimAccountType.ACCOUNT_TYPE.equals(type.accountType)
                    || PhoneAccountType.ACCOUNT_TYPE.equals(type.accountType)) {
                mAccountHeaderNameTextView.setVisibility(View.GONE);
            } else {
                mAccountHeaderNameTextView.setVisibility(View.VISIBLE);
+6 −1
Original line number Diff line number Diff line
@@ -68,6 +68,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));