"filters": [],
"versionCode": 1,
"versionName": "1.0",
- "outputFile": "ICLoopPageLauncher_V13_202106231708_release.apk"
+ "outputFile": "ICLoopPageLauncher_V14_202106232048_release.apk"
}
]
}
\ No newline at end of file
@Override
public void onBackPressed() {
- looperPage.setCurrentItem(mainPageAdapter.getItemCount() / 2, false);
+ looperPage.setCurrentItem(mainPageAdapter.getItemCount() / 2, true);
}
private void initPresenter() {
private OnItemClickListener mItemClickListener = null;
- private List<AppItem> appItemList = new ArrayList<>();
+ private final List<AppItem> appItemList = new ArrayList<>();
public static int TYPE_MAIN = 0x1;
public static int TYPE_APP_ITEM = 0x2;
itemTitle.setText(appItem.getTitleResId());
ImageView iconView = itemView.findViewById(R.id.app_icon_iv);
iconView.setImageResource(appItem.getIconResId());
- itemView.setOnClickListener(v -> {
+ iconView.setOnClickListener(v -> {
if (mItemClickListener != null) {
mItemClickListener.onItemClick(appItem);
}
mContext.registerReceiver(batteryLevReceiver, batteryFilter);
}
-
private final BroadcastReceiver batteryLevReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent batteryStatus) {
});
}
-
private int mOldSimCardState = -1;
-
private boolean querySimCardState() {
if (mTelephony == null) {
}
private void checkHasMissCall() {
- // missCallState.postValue(true);
+ // missCallState.postValue(true);
}
private void getSilentState() {
- // silentState.postValue(true);
+ // silentState.postValue(true);
}
private void checkIcTalkMsg() {
- // icTalkMsgState.postValue(true);
+ // icTalkMsgState.postValue(true);
}
private void getWarningMsgReadState() {
- // warningReadState.postValue(true);
+ // warningReadState.postValue(true);
}
private void getAlarmState() {
- // alarmState.postValue(true);
+ // alarmState.postValue(true);
}
private void getUnReadMsgState() {
- // msgUnReadState.postValue(true);
+ // msgUnReadState.postValue(true);
}
private void getWearState() {
- // wearState.postValue(true);
+ // wearState.postValue(true);
}
private void getBtState() {
IntentFilter btFilter = new IntentFilter();
btFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
mContext.registerReceiver(mBtReceiver, btFilter);
+ //先获取当前的状态
+ BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
+ if (defaultAdapter != null) {
+ btState.postValue(defaultAdapter.isEnabled());
+ }
}
private void retestSize() {
ICLogger.d("showText ==> " + showText);
//不同size
- if (isNoNetwork || showText.equals(getContext().getString(R.string.no_sim_service))) {
+ if (noSimCard || showText.equals(getContext().getString(R.string.no_sim_service))) {
textPaint.setTextSize(no_sim_card_size);
} else {
textPaint.setTextSize(type_size);
}
textWidth = textPaint.measureText(showText);
//如果没有信号的时候,宽度则为文字的宽度
- if (isNoNetwork) {
+ if (noSimCard) {
totalWidth = (int) textWidth;
} else {
totalWidth = width;
private int currentPic = R.mipmap.top_no_sim_card;
- private boolean isNoNetwork = false;
+ private boolean noSimCard = false;
private void updateBitMap() {
}
public void updateNetworkType(String text) {
- if (!TextUtils.isEmpty(text) && currentPic == R.mipmap.top_no_sim_card) {
- currentPic = R.mipmap.top_signal_0;
+ //得有sim卡才显示
+ if (this.noSimCard) {
+ return;
}
-
if (TextUtils.isEmpty(text)) {
text = getContext().getString(R.string.no_sim_service);
}
-
- this.isNoNetwork = false;
if (!showText.equals(text)) {
showText = text;
retestSize();
}
public void updateLev(int lev) {
+ //如果没有sim卡返回
+ if (this.noSimCard) {
+ return;
+ }
this.lastLev = lev;
ICLogger.d("update level..." + lev);
- if (lev < 0 || lev > 5 || isNoNetwork) {
+ if (lev < 0 || lev > 5 || noSimCard) {
return;
}
//根据信号去显示对应的图标
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ICLogger.d("onMeasure...");
int size = MeasureSpec.getSize(heightMeasureSpec);
- setMeasuredDimension(totalWidth, isNoNetwork ? size : targetHeight);
+ setMeasuredDimension(totalWidth, noSimCard ? size : targetHeight);
}
private PaintFlagsDrawFilter mPaintFlagsFilter = new PaintFlagsDrawFilter(0,
}
}
- private boolean hasSimCard = false;
/**
* 更新是否有sim卡
public void updateSimCardState(Boolean hasSimCard) {
if (hasSimCard == null || !hasSimCard) {
//没有sim card
- this.hasSimCard = false;
+ this.noSimCard = true;
//如果没有sim卡,显示没有sim卡的图标
//显示图片图标
this.currentPic = R.mipmap.top_no_sim_card;
updateBitMap();
invalidate();
} else {
- this.hasSimCard = true;
+ this.noSimCard = false;
}
}
}
package com.ic.launcher.view;
import android.content.Context;
-import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import androidx.lifecycle.LifecycleOwner;
+import com.ic.iclooger.ICLogger;
import com.ic.launcher.R;
import com.ic.launcher.presenter.MainPagePresenter;
import com.ic.launcher.presenter.StatusBarPresenter;
R.layout.item_simple_status_bar, this
);
signalView = findViewById(R.id.signal_view);
- signalView.noNetwork();
timeText = findViewById(R.id.simple_status_bar_time_tv);
-
}
public void initViewModel(LifecycleOwner lifecycleOwner) {
timeText.setText(timeValue);
});
statusBarPresenter.networkTypeValue.observe(lifecycleOwner, type -> {
- //ICLogger.d("type == > " + type);
- if (TextUtils.isEmpty(type)) {
- signalView.noNetwork();
+ signalView.updateNetworkType(type);
+ });
+ statusBarPresenter.signalLev.observe(lifecycleOwner, lev -> {
+ ICLogger.d("lev == > " + lev);
+ //信号强度
+ if (lev == null) {
+ signalView.updateLev(0);
} else {
- signalView.updateNetworkType(type);
+ signalView.updateLev(lev);
}
});
+ statusBarPresenter.hasSimCardValue.observe(lifecycleOwner, hasSimCard -> {
+ ICLogger.d("hasSimCard == > " + hasSimCard);
+ signalView.updateSimCardState(hasSimCard);
+ });
statusBarPresenter.signalLev.observe(lifecycleOwner, lev -> {
//ICLogger.d("lev == > " + lev);
//信号强度
}
});
}
-
-
}
package com.ic.launcher.view;
import android.content.Context;
-import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
private void initView() {
signalView = findViewById(R.id.signal_view);
- signalView.noNetwork();
batteryView = findViewById(R.id.right_battery_view);
batteryValueTv = findViewById(R.id.battery_value);
wifiView = findViewById(R.id.top_icon_wifi);
statusBarPresenter = StatusBarPresenter.getInstance(getContext());
statusBarPresenter.alarmState.observe(lifecycleOwner, isAlarmOpen -> {
//设置闹钟图标显示还是隐藏
- alarmView.setVisibility(isAlarmOpen ? VISIBLE : GONE);
+ alarmView.setVisibility(isAlarmOpen == Boolean.TRUE ? VISIBLE : GONE);
});
statusBarPresenter.btState.observe(lifecycleOwner, isOpen -> {
//蓝牙是否显示
- btView.setVisibility(isOpen ? VISIBLE : GONE);
+ btView.setVisibility(isOpen == Boolean.TRUE ? VISIBLE : GONE);
});
statusBarPresenter.gpsState.observe(lifecycleOwner, isOpen -> {
//GPS定位是否打开
- locationView.setVisibility(isOpen ? VISIBLE : GONE);
+ locationView.setVisibility(isOpen == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.icTalkMsgState.observe(lifecycleOwner, hasIcTalkMsg -> {
//是否有微聊消息
- icTalkView.setVisibility(hasIcTalkMsg ? VISIBLE : GONE);
+ icTalkView.setVisibility(hasIcTalkMsg== Boolean.TRUE ? VISIBLE : GONE);
});
statusBarPresenter.isWifiOpen.observe(lifecycleOwner, isWifiOpen -> {
//wifi是否打开
- wifiView.setVisibility(isWifiOpen ? VISIBLE : GONE);
+ wifiView.setVisibility(isWifiOpen == Boolean.TRUE ? VISIBLE : GONE);
});
statusBarPresenter.missCallState.observe(lifecycleOwner, hasMiss -> {
//是否有未接电话
- phoneView.setVisibility(hasMiss ? VISIBLE : GONE);
+ phoneView.setVisibility(hasMiss == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.wearState.observe(lifecycleOwner, hasWear -> {
//是否有穿戴
- wearView.setVisibility(hasWear ? VISIBLE : GONE);
+ wearView.setVisibility(hasWear == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.msgUnReadState.observe(lifecycleOwner, hasRead -> {
//消息是否有读
- newMsgView.setVisibility(hasRead ? VISIBLE : GONE);
+ newMsgView.setVisibility(hasRead == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.warningReadState.observe(lifecycleOwner, hasRead -> {
//警告消息是否有没阅读
- warningMsgUnReadView.setVisibility(hasRead ? VISIBLE : GONE);
+ warningMsgUnReadView.setVisibility(hasRead == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.silentState.observe(lifecycleOwner, isSilent -> {
//是不是静音状态
- silentIconView.setVisibility(isSilent ? VISIBLE : GONE);
+ silentIconView.setVisibility(isSilent == Boolean.TRUE? VISIBLE : GONE);
});
statusBarPresenter.batteryLev.observe(lifecycleOwner, lev -> {
//电量还有多少
}
});
statusBarPresenter.networkTypeValue.observe(lifecycleOwner, type -> {
- ICLogger.d("type == > " + type);
- if (TextUtils.isEmpty(type)) {
- signalView.noNetwork();
- } else {
- signalView.updateNetworkType(type);
- }
+ signalView.updateNetworkType(type);
});
statusBarPresenter.signalLev.observe(lifecycleOwner, lev -> {
ICLogger.d("lev == > " + lev);
<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ic.launcher.view.SignalView
android:id="@+id/signal_view"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent" />
+ android:layout_height="wrap_content" />
<TextView
android:id="@+id/simple_status_bar_time_tv"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
android:text="12:12"
android:textColor="@color/white"
android:textSize="22sp"
- android:textStyle="bold"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintRight_toRightOf="parent" />
+ android:textStyle="bold" />
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
+</RelativeLayout>
\ No newline at end of file
android:id="@+id/mar_queue_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="90dp"
android:layout_toRightOf="@id/signal_view">
<string name="app_package_name_contact">com.ic.iccontact</string>
<string name="app_package_name_camera">com.ic.camera</string>
<string name="app_package_name_photo">com.eqc.gallery</string>
- <string name="app_package_name_sms">com.ic.sms</string>
+ <string name="app_package_name_sms">com.ic.icmms</string>
<string name="app_package_name_record">com.ic.record</string>
<string name="app_package_name_sign">com.ic.sign</string>
- <string name="app_package_name_settings">com.ic.settings</string>
+ <string name="app_package_name_settings">com.ic.setting</string>
<string name="no_application_tips_text">未找到相关应用.</string>
<string name="monday">星期一</string>
-#Wed Jun 23 17:08:39 CST 2021
-VERSION_CODE=13
+#Wed Jun 23 20:48:07 CST 2021
+VERSION_CODE=14