Android 在联系人相应界面显示运营商名称

  1. 在“要显示的联系人”界面显示运营商名称
    在这里插入图片描述
修改方法:ContactsCommon/src/com/android/contacts/common/list/ContactListFilterView.java

            case ContactListFilter.FILTER_TYPE_ACCOUNT: {
-                mAccountUserName.setVisibility(View.VISIBLE);
+                mAccountUserName.setVisibility(View.GONE);
                 mIcon.setVisibility(View.VISIBLE);
                 if (mFilter.icon != null) {
                     mIcon.setImageDrawable(mFilter.icon);
@@ -141,7 +141,7 @@ public class ContactListFilterView extends LinearLayout {
                 /// M: Add SIM Indicator feature for Android M. @{
                 if (SubInfoUtils.getActivatedSubInfoCount() == 1 &&
                         accountType.isIccCardAccount()) {
-                    mAccountType.setVisibility(View.GONE);
+                    mAccountType.setVisibility(View.VISIBLE);
                     mAccountUserName.setTextAppearance(mContext,
                             android.R.attr.textAppearanceMedium);
                     mAccountUserName.setTextSize(18);


  1. 在“导入/导出联系人”界面显示运营商名称
    在这里插入图片描述
修改方法:Contacts/src/com/mediatek/contacts/activities/ContactImportExportActivity.java

            if (accountType != null && accountType.isIccCardAccount()) {
                 icon = accountType.getDisplayIconBySubId(mContext, subId);
-                type = (String) accountType.getDisplayLabel(mContext);
+                               //DUT should show operator name instead of SIM in Import/Export
+                //type = (String) accountType.getDisplayLabel(mContext);
             } else if (accountType != null) {
                 icon = accountType.getDisplayIcon(mContext);
             }


3.在“保存联系人到”界面显示运营商名称
在这里插入图片描述

修改方法:ContactsCommon/src/com/mediatek/contacts/util/AccountsListAdapterUtils.java

         if (isLocalPhone || activtedSubInfoCount <= 1) {
-            text2.setVisibility(View.GONE);
+            text2.setVisibility(View.VISIBLE);
         } else {
             text2.setVisibility(View.VISIBLE);
         }


4.在“新增联系人”界面显示运营商名称。
在这里插入图片描述在这里插入图片描述

修改方法:Contacts/src/com/android/contacts/editor/CompactRawContactsEditorView.java

第一地方修改:

        vlog("activatedSubInfoCount = " + activatedSubInfoCount
                 + ",accountType = " + accountType.accountType);
         if (AccountTypeUtils.isAccountTypeIccCard(accountType.accountType)) {
-            if(activatedSubInfoCount <= 1){
+            /*if(activatedSubInfoCount <= 1){
             mAccountNameView.setVisibility(View.GONE);
-        } else {
+        } else {*/
             if (accountInfo.first != null) {
                 int subId = AccountTypeUtils.getSubIdBySimAccountName(getContext(),
                         accountInfo.first);
                 String account_name = SubInfoUtils.getDisplaynameUsingSubId(subId);
                 mAccountNameView.setText(account_name);
             }
-        }
+        //}
         }
         /// @}

 

第二个地方修改:

             /// M: Modify for SIM indicator feature. @{
             if (AccountTypeUtils.isAccountTypeIccCard(type.accountType)) {
-                if(activatedSubInfoCount <= 1){
+                /*if(activatedSubInfoCount <= 1){
                     mAccountHeaderNameTextView.setVisibility(View.GONE);
-                } else {
+                } else {*/
                 if (accountInfo.first != null) {
                     int subId = AccountTypeUtils.getSubIdBySimAccountName(getContext(),
                             accountInfo.first);
                     String account_name = SubInfoUtils.getDisplaynameUsingSubId(subId);
                     mAccountHeaderNameTextView.setText(account_name);
                 }
-            }
+            //}
             }
           /// @}

         /// M: Modify for SIM indicator feature. @{
         if (AccountTypeUtils.isAccountTypeIccCard(type.accountType)) {
-            if(activatedSubInfoCount <= 1){
+            /*if(activatedSubInfoCount <= 1){
             mAccountSelectorNameTextView.setVisibility(View.GONE);
         } else {
                 mAccountSelectorNameTextView.setVisibility(
                         mAccountHeaderNameTextView.getVisibility());
-            }
+            }*/
+            mAccountSelectorNameTextView.setVisibility(
+                        mAccountHeaderNameTextView.getVisibility());
         }
         /// @}


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

最乱纷飞的code

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值