1,mobile_signal_group.xml 

.....

<FrameLayout

android:id="@+id/mobile_combo"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

<ImageView

android:id="@+id/mobile_signal"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>

<ImageView

android:id="@+id/mobile_type"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>









<!-- http://blog.csdn.net/sergeycao :mobile_slot_indicateor". }@ -->

<ImageView

android:id="@+id/mobile_slot_indicator"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>





</FrameLayout>









2,SignalClusterView.java





//http://blog.csdn.net/sergeycao

int mIndicatorSlot=0;

//http://blog.csdn.net/sergeycao end





private ArrayList<PhoneState> mPhoneStates = new ArrayList<PhoneState>();













//http://blog.csdn.net/sergeycao

int[] slots_indicators=new int[]{R.drawable.sim1_indicator,R.drawable.sim2_indicator};

// 图片sim1_indicator。sim2_indicator是你制作的sim1,sim2标识

//http://blog.csdn.net/sergeycao end









@Override

public void setSubs(List<SubscriptionInfo> subs) {

Xlog.d(TAG, "setSubs(), subs= " + subs);

// Clear out all old subIds.

mPhoneStates.clear();

if (mMobileSignalGroup != null) {

mMobileSignalGroup.removeAllViews();

}

final int n = subs.size();

for (int i = 0; i < n; i++) {





//http://blog.csdn.net/sergeycao 

mIndicatorSlot=subs.get(i).getSimSlotIndex();

//http://blog.csdn.net/sergeycao end





inflatePhoneState(subs.get(i).getSubscriptionId());

}

private PhoneState inflatePhoneState(int subId) {

PhoneState state = new PhoneState(subId, mContext);





//http://blog.csdn.net/sergeycao 

state.mSlotIndicator=mIndicatorSlot;

//http://blog.csdn.net/sergeycao end





if (mMobileSignalGroup != null) {

mMobileSignalGroup.http://blog.csdn.net/sergeycaoView(state.mMobileGroup);

}

mPhoneStates.http://blog.csdn.net/sergeycao(state);

return state;

}













private class PhoneState {

private final int mSubId;

private boolean mMobileVisible = false;

private int mMobileStrengthId = 0, mMobileTypeId = 0;

private boolean mIsMobileTypeIconWide;

private String mMobileDescription, mMobileTypeDescription;





private ViewGroup mMobileGroup;





//http://blog.csdn.net/sergeycao 

private ImageView mMobile, mMobileType,mMobileSlotIndicator;// http://blog.csdn.net/sergeycao mMobileSlotIndicator





//http://blog.csdn.net/sergeycao 

private int mSlotIndicator;





public void setViews(ViewGroup root) {

mMobileGroup = root;

mMobile = (ImageView) root.findViewById(R.id.mobile_signal);

mMobileType = (ImageView) root.findViewById(R.id.mobile_type);

/// M: Support "Service Network Type on Statusbar".

mSignalNetworkType = (ImageView) root.findViewById(R.id.network_type);





// http://blog.csdn.net/sergeycao





mMobileSlotIndicator= (ImageView) root.findViewById(R.id.mobile_slot_indicator);

 

//http://blog.csdn.net/sergeycao end

}





public boolean apply(boolean isSecondaryIcon) {

Xlog.d(TAG, "apply(" + mSubId + ")," + " mMobileVisible= " + mMobileVisible +

", mIsAirplaneMode= " + mIsAirplaneMode);

if (mMobileVisible && !mIsAirplaneMode) {

mMobile.setImageResource(mMobileStrengthId);

mMobileType.setImageResource(mMobileTypeId);

mMobileGroup.setContentDescription(mMobileTypeDescription

+ " " + mMobileDescription);

mMobileGroup.setVisibility(View.VISIBLE);





//http://blog.csdn.net/sergeycao

mMobileSlotIndicator.setImageResource(slots_indicators[mSlotIndicator]);

//http://blog.csdn.net/sergeycao end





} else {

mMobileGroup.setVisibility(View.GONE);

}

android5.x加入sim1,sim2标识的更多相关文章

  1. MTK Android Driver知识大全

    一.Display 1.lcm 相关概念1.1) MIPI接口:一共有三种接口:DBI(也做CPU或MCU接口).DPI(也叫RGB接口).DSI.在使用DSI接口时,目前75/77都只支持到2条da ...

  2. 【转】MTK Android Driver知识大全

    原文网址:http://www.cnblogs.com/biglucky/p/4413797.html 一.Display 1.lcm 相关概念1.1) MIPI接口:一共有三种接口:DBI(也做CP ...

  3. python_mmdt:一种基于敏感哈希生成特征向量的python库(一)

    概述 python_mmdt是一种基于敏感哈希的特征向量生成工具.核心算法使用C实现,提高程序执行效率.同时使用python进行封装,方便研究人员使用. 本篇幅主要介绍涉及的相关基本内容与使用,相关内 ...

  4. ANDROID5.0触摸屏校准

    1.校准原理: 1)首先生成校准用的参数,可以适用tslib生成校准参数,也可以使用校准app生成:使用校准app进行校准对使用者要求比较低,使用者可以不用学习复杂的命令:本文使用app方式 2)生成 ...

  5. i.mx6 Android5.1.1 初始化流程之init.rc解析(未完成)

    接上一篇:i.mx6 Android5.1.1 初始化流程之init进程 参考资料:http://blog.csdn.net/mr_raptor/article/category/799879 这个博 ...

  6. <Android Framework 之路>Android5.1 MediaScanner

    前言 MediaScanner是Android系统中针对媒体文件的扫描过程,将储存空间中的媒体文件通过扫描的方式遍历并存储在数据库中,然后通过MediaProvider提供接口使用,在Android多 ...

  7. Android5.0和Android6.0适配

    gradle配置项 compileSdkVersion 用哪个 Android SDK 版本编译你的应用.因此我们强烈推荐总是使用最新的 SDK 进行编译.在现有代码上使用新的编译检查可以获得很多好处 ...

  8. 【SQLServer】记一次数据迁移-标识重复的简单处理

    汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 今天在数据迁移的时候因为手贱遇到一个坑爹问题,发来大家乐乐,也传授新手点经验 迁移惯用就 ...

  9. 浅谈JSP中include指令与include动作标识的区别

    JSP中主要包含三大指令,分别是page,include,taglib.本篇主要提及include指令. include指令使用格式:<%@ include file="文件的绝对路径 ...

随机推荐

  1. DNS SOA NS区别

    转自 http://bbs.51cto.com/thread-908637-1.html NS服务器里有两个比较重要的记录.一个叫SOA记录(起始授权机构) 一个叫NS(Name Server)记录( ...

  2. 35.自己实现vector模板库myvector

    myvector.h #pragma once //自己写的vector模板库 template <class T> class myvector { public: //构造 myvec ...

  3. 《剑指offer》二叉树的镜像

    一.题目描述 操作给定的二叉树,将其变换为源二叉树的镜像. 二.输入描述 二叉树的镜像定义:源二叉树 8 / \ 6 10 / \ / \ 5 7 9 11 三.输出描述 镜像二叉树 8 / \ 10 ...

  4. 编译php并与nginx整合

    告诉 Nginx 如何处理 php 文件:          nginx>vim  conf/nginx.conf                     location ~ \.php${ ...

  5. [洛谷P3927]SAC E#1 - 一道中档题 Factorial

    题目大意:求$n!$在$k(k>1)$进制下末尾0的个数. 解题思路:一个数在十进制转k进制时,我们用短除法来做.容易发现,如果连续整除p个k,则末尾有p个0. 于是问题转化为$n!$能连续整除 ...

  6. Opencv Mat的三种常用类型简介

    本系列文章由 @YhL_Leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/47683127 本文主要介绍Opencv ...

  7. Xwiki平台Windows搭建(Tomcat7 + XWiki6.2 + MySQL5.5)

    背景介绍 国内xwiki安装使用资料较少,根据自己使用xwiki经验,总结出来,供参考,同时希望感兴趣的朋友能够一起讨论,XWiki是一个强大的Java开源的Wiki引擎. 它支持一些受欢迎的特性如: ...

  8. HTML学习----------DAY2第五节

    属性为 HTML 元素提供附加信息. HTML 属性 HTML 标签可以拥有属性.属性提供了有关 HTML 元素的更多的信息. 属性总是以名称/值对的形式出现,比如:name="value& ...

  9. 【VBA研究】用VBA取得EXCEL随意列有效行数

    作者:iamlaosong 用VBA对Excel文件进行处理的时候,keyword段的列号编程时往往是不知道的.须要通过參数设定才干知道,因此.我们编程的时候,就不能用这种语句取有效行数: linen ...

  10. Linux下无需输入password自己主动登陆sshserver方法

    用OpenSSH在linux下登陆sshserver时.每次都提示要输入password,并且使用vim 的netrw插件编辑远程文件时每次改动后保存都要输password,很麻烦. 查看了netrw ...