android5.x加入sim1,sim2标识
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标识的更多相关文章
- MTK Android Driver知识大全
一.Display 1.lcm 相关概念1.1) MIPI接口:一共有三种接口:DBI(也做CPU或MCU接口).DPI(也叫RGB接口).DSI.在使用DSI接口时,目前75/77都只支持到2条da ...
- 【转】MTK Android Driver知识大全
原文网址:http://www.cnblogs.com/biglucky/p/4413797.html 一.Display 1.lcm 相关概念1.1) MIPI接口:一共有三种接口:DBI(也做CP ...
- python_mmdt:一种基于敏感哈希生成特征向量的python库(一)
概述 python_mmdt是一种基于敏感哈希的特征向量生成工具.核心算法使用C实现,提高程序执行效率.同时使用python进行封装,方便研究人员使用. 本篇幅主要介绍涉及的相关基本内容与使用,相关内 ...
- ANDROID5.0触摸屏校准
1.校准原理: 1)首先生成校准用的参数,可以适用tslib生成校准参数,也可以使用校准app生成:使用校准app进行校准对使用者要求比较低,使用者可以不用学习复杂的命令:本文使用app方式 2)生成 ...
- i.mx6 Android5.1.1 初始化流程之init.rc解析(未完成)
接上一篇:i.mx6 Android5.1.1 初始化流程之init进程 参考资料:http://blog.csdn.net/mr_raptor/article/category/799879 这个博 ...
- <Android Framework 之路>Android5.1 MediaScanner
前言 MediaScanner是Android系统中针对媒体文件的扫描过程,将储存空间中的媒体文件通过扫描的方式遍历并存储在数据库中,然后通过MediaProvider提供接口使用,在Android多 ...
- Android5.0和Android6.0适配
gradle配置项 compileSdkVersion 用哪个 Android SDK 版本编译你的应用.因此我们强烈推荐总是使用最新的 SDK 进行编译.在现有代码上使用新的编译检查可以获得很多好处 ...
- 【SQLServer】记一次数据迁移-标识重复的简单处理
汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 今天在数据迁移的时候因为手贱遇到一个坑爹问题,发来大家乐乐,也传授新手点经验 迁移惯用就 ...
- 浅谈JSP中include指令与include动作标识的区别
JSP中主要包含三大指令,分别是page,include,taglib.本篇主要提及include指令. include指令使用格式:<%@ include file="文件的绝对路径 ...
随机推荐
- es6 --- class 类的继承使用
传统的javascript中只有对象,没有类的概念.它是基于原型的面向对象语言.原型对象特点就是将自身的属性共享给新对象.这样的写法相对于其它传统面向对象语言来讲,很有一种独树一帜的感脚!非常容易让人 ...
- Framework3.5安装(Windows8.1)
在用到Android逆向助手,使用时提示安装Framework3.5,Windows7都有Framework3.5,Windows8却没有,联网更新就算了,这龟速更新得多久.但是问题总还是要解决,随便 ...
- PostgreSQL Replication之第八章 与pgbouncer一起工作(3)
8.3 配置您的第一个pgbouncer设置 一旦我们已经完成了pbouncer的编译与安装,我们可以容易地启动它.要做到这一点,我们已经在一个本地实例(p0和p1) 建立了两个数据库.在本例中,执行 ...
- 运维派 企业面试题1 监控MySQL主从同步是否异常
Linux运维必会的实战编程笔试题(19题) 企业面试题1:(生产实战案例):监控MySQL主从同步是否异常,如果异常,则发送短信或者邮件给管理员.提示:如果没主从同步环境,可以用下面文本放到文件里读 ...
- 临时的js方法
//楼层的js var scroChange; //楼层跳转 function FloorGo(domId){//传入目标的id clearInterval(scroChange); var scro ...
- TP5 上传文件
直接贴上一个完整的代码 /** * 图片上传方法 * @return [type] [description] */ /** * 1 获取到文件 * 2 验证文件的形状是不是符合上传的规则 * 3 i ...
- WHU 1552 Seats 枚举
题意: 有一个年级中7个班的n个学生. 一天,他们毫无顺序的站成一排.请计算最小的交换次数,使得 相同班的同学都站在一起. (只有站在一起的人才能交换) 思路: 如果知道班级的最终排列就能在很短的时间 ...
- WebKit载入流程 - 概述
之前写了几篇载入流程的说明,是从下向上看,有点仅仅见树木不见森林的感觉.经过近期一段时间的学习,有了能加以概括抽象的方法. WebKit载入流程和页面组成是直接相关的,页面就是WebKit要载入的对象 ...
- ubuntu 下安装eclipse &java环境配置
前面有一篇的博客写的是ubuntu下安装eclipse和java环境的配置.当时是安装网上的攻略进行的 ,当然也是能够成功的. 近期把那台电脑送人了 ,仅仅好在自己的这台电脑上又一次安装一次了 ,唯一 ...
- 基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自己主动适应宽带高度
在默认情况下,EasyUI的DataGrid好像都没有具备自己主动宽度的适应功能,通常是指定像素宽度的.可是使用的人员计算机的屏幕分辨率可能不一样,因此导致有些地方显示太大或者太小,总是不能达到好的预 ...