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="文件的绝对路径 ...
随机推荐
- spark scala word2vec 和多层分类感知器在情感分析中的实际应用
转自:http://www.cnblogs.com/canyangfeixue/p/7227998.html 对于威胁检测算法使用神经网络训练有用!!!TODO待实验 /** * Created by ...
- 木马——本质就是cs socket远程控制,反弹木马是作为c端向外发起网络请求
摘自:http://kczxsp.hnu.edu.cn/upload/20150504165623705.pdf 里面对于木马的实验过程写得非常清楚,值得一看. 木马是隐藏在正常程序中的具有特殊功 ...
- 一些 <link> 标记分享
<link rel="alternate" media="handheld" href="#" /> <link rel= ...
- VS2012恢复默认设置的2种方法
方法一: 工具 → 导入和导出设置 → 重置所有设置 → 下一步 → 选择“是否保存当前设置”,下一步 → 选择“要重置的开发语言(如,Visual C# 开发设置)” → 完成. 方法二: 1.依次 ...
- vue中makeMap方法的使用 (定义注册一些值 后期方便使用)
function makeMap ( str, expectsLowerCase ) { var map = Object.create(null); var list = str.split(',' ...
- php实现自动加载类
PHP 实现自动加载类:
- python第三次作业——叶耀宗
作业1 import random#引入随机数模块xing=["小白","小黄","小王","小陈","小绿& ...
- BNUOJ 4049 四叉树
四叉树 Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Ma ...
- EChart报表插件使用笔记(1)
报表插件Echart java类 package com.spring.controller; import java.io.IOException; import java.util.Arrays; ...
- 给一个执行在windows 7和NAT下的VMWARE虚拟机分配固定IP
虚拟机上装了个oracleserver,每次vmware重新启动或者resume时总要分配新的IP地址,这样就得改动windows下的client配置,所以须要想办法把IP地址固定住. DHCP服务在 ...