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);

}

时间: 2024-08-29 00:35:52

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

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:layo

MTK Android Driver知识大全

转载请注明出处:http://blog.csdn.net/cbk861110/article/details/40931835 一.Display 1.lcm 相关概念 1.1) MIPI接口:一共有三种接口:DBI(也做CPU或MCU接口).DPI(也叫RGB接口).DSI. 在使用DSI接口时,目前75/77都只支持到2条data lane,加上一条clock lane. 使用DPI接口时,根据LCM IC支持的情况,可以选择16bus.18bus传输RGB格式文件,在GPIO部分分为R.G

android Music 中如何添加设置双卡铃声的菜单

1,打开情景模式的设置双卡铃声的feature:MTK_MULTISIM_ROINGTONE_SUPPORT,Music中却不能设置双卡铃声. 希望能在Music添加菜单"Us as SIM1/SIM2 ringtone" 1,string.xml,添加新的string ringtone_as_sim1_menu和ringtone_as_sim2_menu : <string name="ringtone_as_sim1_menu">Use as SIM

Android 4.4 Kitkat Phone工作流程浅析(十二)__4.4小结与5.0概览

前置文章: <Android 4.4 Kitkat Phone工作流程浅析(一)__概要和学习计划> <Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析> <Android 4.4 Kitkat Phone工作流程浅析(三)__MO(去电)流程分析> <Android 4.4 Kitkat Phone工作流程浅析(四)__RILJ工作流程简析> <Android 4.4 Kitkat Phone工作流程浅析(五)__M

【转】Android 4.4 Kitkat Phone 对比 5.0 Lollipop Phone工作流程浅析

概述 在Android 4.4 中,Google 对Telephony_Phone进行了重构,前面也通过一些列文章分析了Android 4.4 中Telephony Phone的工作流程.但在2014年10月15日,Google发布了Android 5.0 预览版,正式版也在一个月之后发布.Android 5.0 变化非常大,无论从UI风格还是功能实现上,Google都进行了大刀阔斧的修改.同时,Telephony_Phone模块的架构也再次进行了调整,调整之后的Telephony_Phone各

ANDROID5.0触摸屏校准

1.校准原理: 1)首先生成校准用的参数,可以适用tslib生成校准参数,也可以使用校准app生成:使用校准app进行校准对使用者要求比较低,使用者可以不用学习复杂的命令:本文使用app方式 2)生成校准参数后,以后驱动每次接收到触摸事件就会使用校准参数进行校准 2.校准app 校准功能完全实现在在src目录里的MainActivity.java里,内容如下: package com.wss.calibrate2; import android.app.Activity;import andro

SQLServer数据库自增长标识列的更新修改操作

SQLServer数据库自增长标识列的更新修改操作方法在日常的sql server开发中,经常会用到Identity类型的标识列作为一个表结构的自增长编号.比如文章编号.记录序号等等.自增长的标识列的引用很大程度上方便了数据库程序的开发,但是有时这个固执的字段类型也会带来一些麻烦. 一.修改标识列字段的值:(在执行insert时,将ID手动的设置成想要的值)有时,为了实现某个功能,需要修改类型为Identity自增长类型的字段的值,但由于标识的类型所限,这种操作默认是不允许的.比如,目前数据库有

20150919_获取Android唯一标识码

背景 前段时间给一家电力公司做了一个管理系统,用来调查公司客户的购买电力公司培训课程的意愿,并且提供下单订购的功能. 因为电力公司要求在Android平板电脑上运行,所以是针对7英寸的Android平板电脑的开发:苦于没有合适的设备调试,所以我一直在自己的Android手机上进行测试,一直到项目提交之前的那一天晚上... 客户反馈说提交订单后系统停止运行,导入数据到PC服务端后服务端也崩溃了! 刚开始怀疑是因为他们的设备太差的缘故——我在配置相当low的Android原生虚拟机(有多low大家应

JAVA UUID 生成唯一标识

Writer:BYSocket(泥沙砖瓦浆木匠) 微博:BYSocket 豆瓣:BYSocket Reprint it anywhere u want 需求 项目在设计表的时候,要处理并发多的一些数据,类似订单号不能重复,要保持唯一.原本以为来个时间戳,精确到毫秒应该不错了.后来觉得是错了,测试环境下很多一样的ID,不能达到唯一标识. UUID JDK API 是这么说的: "表示通用唯一标识符 (UUID) 的类. UUID 表示一个 128 位的值." 详细的说就是: "