"filters": [],
"versionCode": 1,
"versionName": "1.0",
- "outputFile": "ICLoopPageLauncher_V43_202109031848_release.apk"
+ "outputFile": "ICLoopPageLauncher_V44_202109172053_release.apk"
}
]
}
\ No newline at end of file
}
private void getStepCount() {
- getValue(KEY_STEP_COUNT);
+ getValueByKey(KEY_STEP_COUNT);
}
private final BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() {
case KEY_TEMP:
bodyTempValue.postValue(value);
break;
+ case KEY_STEP_COUNT:
+ stepCountValue.postValue(value);
+ break;
}
}
import androidx.lifecycle.MutableLiveData;
import com.ic.iclooger.ICLogger;
+import com.ic.launcher.utils.IConState;
import com.ic.launcher.utils.SoundPlayUtils;
import com.ic.launcher.utils.SystemUtils;
import com.ic.launcher.utils.VibrateUtil;
//网络类型
public MutableLiveData<String> networkTypeValue = new MutableLiveData<>();
//未佩戴状态
- public MutableLiveData<Boolean> wearStateValue = new MutableLiveData<>();
+ public MutableLiveData<IConState> wearStateValue = new MutableLiveData<>();
//剪断状态
- public MutableLiveData<Boolean> cutStateValue = new MutableLiveData<>();
+ public MutableLiveData<IConState> cutStateValue = new MutableLiveData<>();
private Handler handler;
private TelephonyManager mTelephony;
private void getWearState() {
String isAntiOff = SystemUtils.getSystemPropertiesString("persist.sys.ic_antioff", "");
- ICLogger.d("isAntiOff ==> " + isAntiOff);
+ //ICLogger.d("isAntiOff ==> " + isAntiOff);
if ("true".equals(isAntiOff)) {
//未佩戴
- wearStateValue.postValue(Boolean.FALSE);
+ wearStateValue.postValue(IConState.TRUE);
+ } else if ("false".equals(isAntiOff)) {
+ wearStateValue.postValue(IConState.FALSE);
} else {
- wearStateValue.postValue(Boolean.TRUE);
+ wearStateValue.postValue(IConState.NONE);
}
}
private void getCutState() {
- String isAntiOff = SystemUtils.getSystemPropertiesString("persist.sys.ic_cutoff", "");
- ICLogger.d("isAntiOff ==> " + isAntiOff);
- if ("true".equals(isAntiOff)) {
+ String isCutOff = SystemUtils.getSystemPropertiesString("persist.sys.ic_cutoff", "");
+ //ICLogger.d("isAntiOff ==> " + isCutOff);
+ if ("true".equals(isCutOff)) {
//剪断了
- cutStateValue.postValue(Boolean.TRUE);
+ cutStateValue.postValue(IConState.TRUE);
+ } else if ("false".equals(isCutOff)) {
+ cutStateValue.postValue(IConState.FALSE);
} else {
- cutStateValue.postValue(Boolean.FALSE);
+ cutStateValue.postValue(IConState.NONE);
}
}
--- /dev/null
+package com.ic.launcher.utils;
+
+public enum IConState {
+ NONE, TRUE, FALSE
+}
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
+import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.ic.iclooger.ICLogger;
import com.ic.launcher.R;
import com.ic.launcher.presenter.StatusBarPresenter;
+import com.ic.launcher.utils.IConState;
public class StatusBarView extends FrameLayout {
private View silentIconView;
private View shakeView;
private View planeModeView;
+ private ImageView cuntStateView;
public StatusBarView(@NonNull Context context) {
this(context, null);
alarmView = findViewById(R.id.top_icon_alarm);
newMsgView = findViewById(R.id.top_icon_new_msg);
wearView = findViewById(R.id.top_icon_wear);
+ cuntStateView = findViewById(R.id.top_icon_lock);
phoneView = findViewById(R.id.top_icon_phone);
icTalkView = findViewById(R.id.top_icon_ic_talk);
silentIconView = findViewById(R.id.top_icon_silent);
phoneView.setVisibility(hasMiss == Boolean.TRUE ? VISIBLE : GONE);
});
statusBarPresenter.wearStateValue.observe(lifecycleOwner, hasWear -> {
- //是否有穿戴
- wearView.setVisibility(hasWear == Boolean.TRUE ? GONE : VISIBLE);
+ if (hasWear == IConState.TRUE || hasWear == IConState.NONE) {
+ //没有佩戴
+ wearView.setVisibility(GONE);
+ } else {
+ wearView.setVisibility(VISIBLE);
+ }
+
});
statusBarPresenter.cutStateValue.observe(lifecycleOwner, hasWear -> {
//是否剪断,如果没有剪断,则会显示图标,如果剪断了,那么就没有图标了
- wearView.setVisibility(hasWear == Boolean.TRUE ? VISIBLE : GONE);
+ if (hasWear == IConState.NONE) {
+ cuntStateView.setVisibility(GONE);
+ } else {
+ cuntStateView.setVisibility(VISIBLE);
+ cuntStateView.setImageResource(hasWear == IConState.TRUE ? R.mipmap.unlock : R.mipmap.lock);
+ }
});
statusBarPresenter.msgUnReadState.observe(lifecycleOwner, hasRead -> {
//消息是否有读
android:visibility="gone" />
+ <ImageView
+ android:id="@+id/top_icon_lock"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@mipmap/lock"
+ android:visibility="gone" />
+
+
<ImageView
android:id="@+id/top_icon_wear"
android:layout_width="wrap_content"
-#Fri Sep 03 18:48:57 CST 2021
-VERSION_CODE=43
+#Fri Sep 17 21:30:21 CST 2021
+VERSION_CODE=45