JB3开始,双卡版本不插卡的情况下状态栏中只显示了一个信号图标,而不是两个信号图标,如何修改为2个图标
[SOLUTION]
这是JB3 default的设计,如果要恢复两个信号图标,请参考如下方法修改:
1. SignalClusterViewGemini.java文件
public void setMobileDataIndicators(int slotId, boolean visible, IconIdWrapper[] strengthIcon,
。。
mMobileVisible[slotId] = true;//visible; 将这行的visible修改为true,也就是一直显示
2. DefaultStatusBarPlugin.java文件
public boolean getMobileGroupVisible() {
return true;//false; //修改为true
}
public void setMobileDataIndicators(int slotId, boolean visible, IconIdWrapper[] strengthIcon,
。。
mMobileVisible[slotId] = true;//visible; 将这行的visible修改为true,也就是一直显示
2. DefaultStatusBarPlugin.java文件
public boolean getMobileGroupVisible() {
return true;//false; //修改为true
}
5.0版 在SignalClusterView.java->apply() -> if (noSIMinserted == mSlotCount) {}增加 可以显示两张卡
if (mMobileVisible[i] && !mIsAirplaneMode) {
if (!SIMHelper.isSimInsertedBySlot(mContext, i))
{
noSIMinserted ++;
// mSignalClusterCombo[i].setVisibility(View.GONE); //注释这句
continue;
}
if (noSIMinserted == mSlotCount) {
Log.d(TAG, "No SIM inserted: Show one empty signal icon only :" + mSlotCount);
mSignalClusterCombo[0].setVisibility(View.VISIBLE);
mMobile[0].setImageResource(R.drawable.stat_sys_signal_null);
mMobileType[0].setVisibility(View.GONE);
mMobileGroup[0].setVisibility(View.VISIBLE);
mSignalNetworkType[0].setImageDrawable(null);
mSignalNetworkType[0].setVisibility(View.GONE);
//增加这些
mSignalClusterCombo[1].setVisibility(View.VISIBLE);
mMobile[1].setImageResource(R.drawable.stat_sys_signal_null);
mMobileType[1].setVisibility(View.GONE);
mMobileGroup[1].setVisibility(View.VISIBLE);
mSignalNetworkType[1].setImageDrawable(null);
mSignalNetworkType[1].setVisibility(View.GONE);
}
dear:
参考: /// M: Show empty signal icon only when NO Sim is inserted. @{ if (noSIMinserted == mSlotCount) { *********************************************************** Log.d(TAG, "No SIM inserted: Show one empty signal icon only :" + mSlotCount); mSignalClusterCombo[0].setVisibility(View.VISIBLE); mMobile[0].setImageResource(R.drawable.stat_sys_signal_null); mMobileType[0].setVisibility(View.GONE); mMobileGroup[0].setVisibility(View.VISIBLE); mSignalNetworkType[0].setImageDrawable(null); mSignalNetworkType[0].setVisibility(View.GONE); ********************************************* } /// M: Show empty signal icon only when NO Sim is inserted. @} 将上面*内的内容复制并粘贴后,将0改为1还不行吗 |