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. CUDA笔记(11)

    CUDA提供了一种cudaEvent_t的类型,这种类型Event可以统计GPU上面某一个任务或者代码段的精确运行时间 使用常量内存的光线跟踪器的性能比使用全局内存的性能提升了50% __consta ...

  2. vuejs helloworld

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. ReactiveCocoa使用记录-网络登录事件

    对于一个应用来说,绝大部分的时间都是在等待某些事件的发生或响应某些状态的变化,比如用户的触摸事件.应用进入后台.网络请求成功刷新界面等等,而维护这些状态的变化,常常会使代码变得非常复杂,难以扩展.而 ...

  4. nginx设置可以默认访问index.php

    vim /usr/local/nginx/conf/nginx.conf:      在 location /{                index index.php index.html i ...

  5. Mooc--五子棋(js)小结

    1. canvas是块级元素吗?? 2. css3 box-shadow属性 语法:box-shadow: h-shadow v-shadow blur spread color inset; 注释: ...

  6. bzoj1615 麻烦的干草打包机 BFS

    Description Farmer John新买的干草打包机的内部结构大概算世界上最混乱的了,它不象普通的机器一样有明确的内部传动装置,而是,N (2 <= N <= 1050)个齿轮互 ...

  7. MPI对道路车辆情况的Nagel-Schreckenberg 模型进行蒙特卡洛模拟

    平台Ubuntu 16.04,Linux下MPI环境的安装见链接:https://blog.csdn.net/lusongno1/article/details/61709460 据 Nagel-Sc ...

  8. python在leecode刷题-第一题和第七题

    class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] num ...

  9. 【Henu ACM Round#19 D】 Points on Line

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 考虑l..r这个区间. 且r是满足a[r]-a[l]<=d的最大的r 如果是第一个找到的区间,则直接累加C(r-l+1,3); ...

  10. 洛谷 P3068 [USACO13JAN]派对邀请函Party Invitations

    P3068 [USACO13JAN]派对邀请函Party Invitations 题目描述 Farmer John is throwing a party and wants to invite so ...