双卡项目如何在状态栏显示或隐藏G,3G以及卡1和卡2的信号标识

2025-05-31 09:13:51 5343

SandFoam

当前离线

积分10239

SandFoam

承接mtk 天玑9400/天玑8300/天玑9000/天玑9200/天玑9300

PoP工艺的各类平台

DDR和UFS测试项目

定制开发

电话:19168984579

(微信同号)

楼主

发表于 2016-9-7 17:00:00

|

只看该作者

|倒序浏览

|阅读模式

来自 广东省深圳市

[DESCRIPTION]

本节包括2个方面:

1.KK版本上(4.4)如何隐藏有SIM卡1,2标记,如何去掉状态栏G、3G图标

2.L版本上(5.0)如何增加有SIM卡1,2标记

一 KK版本上(4.4)

2.1如何隐藏有SIM卡1,2标记

KK上默认是显示1,2卡标识的。

如果隐藏它们,在文件SignalClusterView.java上由mMobileSlotIndicator变量控制

将mMobileSlotIndicator出现的地方屏蔽掉就可以

2.2如何去掉状态栏G、3G图标

去掉方法很简单,就是把这个View隐藏就行了,具体修改如下

SignalClusterView.java

(Frameworks\base\packages\SystemUI\src\com\Android\systemui\statusbar)

apply():

……

//hide network iconbegin

/* int state = SIMHelper.getSimIndicatorStateGemini(i);//hide network icon

if (!mIsAirplaneMode

&& SIMHelper.isSimInserted(i)

&& PhoneConstants.SIM_INDICATOR_LOCKED != state

&& PhoneConstants.SIM_INDICATOR_SEARCHING != state

&& PhoneConstants.SIM_INDICATOR_INVALID != state

&& PhoneConstants.SIM_INDICATOR_RADIOOFF != state) {

……

} else {*/

mSignalNetworkType.setImageDrawable(null);

mSignalNetworkType.setVisibility(View.GONE);

//}

//hide network iconend

……

二 L版本上(5.0)如何增加有SIM卡1,2标记

L版本5.0默认是没有显示的1.2卡标识的!

如果要增加1,2标识,可按下面步骤添加:

1,Signal_Cluster_View.xml

android:id="@+id/signal_cluster_combo"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

>

android:layout_height="6dp"

android:layout_width="6dp"

android:visibility="invisible"

/>

android:id="@+id/network_type"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:visibility="gone"

/>

android:id="@+id/mobile_combo"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

android:id="@+id/mobile_signal"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>

android:id="@+id/mobile_type"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>

android:id="@+id/mobile_slot_indicator"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>

android:layout_height="1dp"

android:layout_width="1dp"

android:tag="spacer_2"

android:visibility="gone"

android:id="@+id/spacer_2"

/>

android:layout_height="1dp"

android:layout_width="1dp"

android:visibility="invisible"

/>

android:id="@+id/signal_cluster_combo_2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:tag="signal_cluster_combo_2"

>

android:id="@+id/network_type_2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:visibility="gone"

android:tag="network_type_2"

/>

android:id="@+id/mobile_combo_2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:tag="mobile_combo_2"

>

android:id="@+id/mobile_signal_2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:tag="mobile_signal_2"

/>

android:id="@+id/mobile_type_2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:tag="mobile_type_2"

/>

android:id="@+id/mobile_slot_indicator_2"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

/>

2.SignalClusterView.java

文件添加

// add

private ImageView[] mMobileSlotIndicator;

//add

int[] slots_indicators=new

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

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

public SignalClusterView(Context context, AttributeSet attrs, int

defStyle) {

super(context, attrs, defStyle);

mSlotCount = SIMHelper.getSlotCount();

........

// add

mMobileSlotIndicator= new ImageView[mSlotCount];

}

onAttachedToWindow()那里

//add

for (int i = SIMHelper.SLOT_INDEX_DEFAULT ; i < mSlotCount; i++) {

final int k = i + 1;

if (i == SIMHelper.SLOT_INDEX_DEFAULT) {

// load views for first SIM card

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

mMobileGroup = (ViewGroup) findViewById(R.id.mobile_combo);

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

mSpacer = findViewById(R.id.spacer);

mSignalClusterCombo = (ViewGroup)

findViewById(R.id.signal_cluster_combo);

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

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

//tdp add

mMobileSlotIndicator = (ImageView)

findViewById(R.id.mobile_slot_indicator);

} else {

mMobile = (ImageView) findViewWithTag("mobile_signal_" + k);

mMobileGroup = (ViewGroup) findViewWithTag("mobile_combo_" + k);

mMobileType = (ImageView) findViewWithTag("mobile_type_" + k);

mSpacer = findViewWithTag("spacer_" + k);

mSignalClusterCombo = (ViewGroup)

findViewWithTag("signal_cluster_combo_" + k);

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

mSignalNetworkType = (ImageView) findViewWithTag("network_type_" + k);

//tdp add

mMobileSlotIndicator = (ImageView)

findViewWithTag("mobile_slot_indicator_"+k);

}

//add

mMobileSlotIndicator.setImageDrawable(slots_indicators);

mMobileSlotIndicator.setVisibility(View.VISIBLE);

}

onDetachedFromWindow()那里

//add

@Override

protected void onDetachedFromWindow() {

mVpn = null;

mWifiGroup = null;

mWifi = null;

/// M: WifiActivityIcon

mWifiActivity = null;

for (int i = SIMHelper.SLOT_INDEX_DEFAULT; i < mSlotCount ; i++) {

mMobileGroup = null;

mMobile = null;

mMobileType = null;

mSpacer = null;

//add

mMobileSlotIndicator = null;

}

收藏0

转播

顶0

踩0

技术词条:

network, 状态栏, 双卡, Android点击查看更多芯片型号

高通骁龙450/高通msm8953 android H265支持双屏异显核心板/开发板可替代MT6762

MT6739 android三防4G智能终端整机/方案定制

Android 11.0 三防5G对讲终端/方案定制

楼主新贴

mt2503 [MODIS]10A MoDIS patial release导致模拟器li...

mt2503 [MAKE]11B code遇到类似如下的[LINK_BIN_FILE]...

mt2503 [MAKE]MAUI的Build Env 注意事项

mt2503 [MAKE]使用increditbuild的error

mt2503 用Dct tool打开codegen.dws提示版本 不match...

楼主热贴

单片机600多份开发资料分享

MT6737相关设计参考资料集锦(datasheet,Memory,参考设...

jpeg图片接收显示测试上位机[串口 网络 摄像头上位机...

MTK6757资料汇集_

联发科Helio X20/MT6797_datasheet,原理图,参考设计,...

相关帖子

• 全志H313 android10平台声卡驱动调完后用tinyplay播放wav没问题,但上层播放还是没声音,有大神能指导一下吗?

• 求购一套高通msm8909 android7.1及以上系统源码(包含modem源码)

• 【Android Jetpack】Compose列表性能优化实战

• Android14实现欧洲自动售卖协议MDB

• RK3576(8核2.3G/6T+支持HDMI/MIPI/EDP多屏异显+Android/Linux+QT)LGA焊接式核心板

• 从开源到闭源:Google的“帝国转身”如何撼动万亿级市场?

• Android系统主板应用配置默认获取管理所有文件权限方法

• 付费求购MT6752 android8.0的量产代码

• 寻找MT6739平台Android 10/11原始源码和调制解调器源码

• 瑞芯微开发板/主板Android配置APK默认开启性能模式方法

回复

举报

Copyright © 2022 世界杯积分_上一届世界杯冠军 - f0cai.com All Rights Reserved.