「Change」

1、增加白天夜间模式切换
进入白天模式
 CallerMoGoUiSettingManager.stepInDayMode()
退出白天模式
 CallerMoGoUiSettingManager.stepOutDayMode()
监听换肤模式切换,需要实现IMoGoSkinModeChangeListener接口
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
移除换肤模式切换
2、增加切换白天、黑夜模式变换状态栏文字颜色

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-04-13 21:30:51 +08:00
parent 517805220e
commit bb1baa023b
22 changed files with 353 additions and 180 deletions

View File

@@ -40,6 +40,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerSmpManager
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
@@ -460,10 +461,14 @@ class DebugSettingView @JvmOverloads constructor(
/**
* 修改地图样式按钮(白天模式、夜间模式)
* 修改皮肤样式按钮(白天模式、夜间模式)
*/
tbChangeCurrentMapStyle.setOnCheckedChangeListener { _, isChecked ->
CallerHDMapManager.stepInVrMode(isChecked)
tbChangeCurrentSkinMode.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerMoGoUiSettingManager.stepInDayMode()
} else {
CallerMoGoUiSettingManager.stepOutDayMode()
}
}
//设置鹰眼本地参数配置监听

View File

@@ -15,9 +15,12 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.mogo.service.intent.IMogoIntentListener;
/**
@@ -25,7 +28,7 @@ import com.mogo.service.intent.IMogoIntentListener;
*
* @author tongchenfei
*/
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener {
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IMoGoSkinModeChangeListener {
private static final String TAG = "MainLauncherActivity";
protected boolean mIsHomeKeyDown = false;
private final static Handler handlerV2XEvent = new Handler();
@@ -54,6 +57,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
protected void onStart() {
super.onStart();
getApis().getIntentManagerApi().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
// 添加换肤监听
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
//ActivityLifecycleManager.getInstance().setAppActive(true);
}
@@ -106,6 +111,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
} catch (Exception e) {
e.printStackTrace();
}
// 移除换肤监听
CallerSkinModeListenerManager.INSTANCE.removeListener(TAG);
}
private void stopCountDown() {
@@ -115,4 +122,12 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
}
}
@Override
public void onSkinModeChange(int skinMode) {
if (skinMode == 0) {
BarUtils.setStatusBarLightMode(this, false);
} else {
BarUtils.setStatusBarLightMode(this, true);
}
}
}

View File

@@ -701,8 +701,7 @@
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
android:textOff="车辆状态"
android:textOn="车辆状态"
/>
android:textOn="车辆状态" />
<LinearLayout
android:id="@+id/vehicleStateLayout"
@@ -716,8 +715,7 @@
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="方向盘转向角:"
/>
android:text="方向盘转向角:" />
<View
android:layout_width="match_parent"
@@ -729,8 +727,7 @@
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="挂挡档位:"
/>
android:text="挂挡档位:" />
<View
android:layout_width="match_parent"
@@ -844,13 +841,12 @@
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:text="设置刹车加速度阈值"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
/>
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
@@ -893,8 +889,7 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnBrakeThreshold"
/>
app:layout_constraintTop_toBottomOf="@id/btnBrakeThreshold" />
<Button
android:id="@+id/btnConnectServerIp"
@@ -902,13 +897,12 @@
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="连接司机屏IP"
android:textSize="@dimen/dp_24"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@id/brakeThresholdDivider"
android:text="连接司机屏IP"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
/>
app:layout_constraintTop_toBottomOf="@id/brakeThresholdDivider" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etConnectServerIp"
@@ -924,9 +918,9 @@
android:textColor="#1A1A1A"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@id/btnConnectServerIp"
app:layout_constraintTop_toTopOf="@id/btnConnectServerIp"
app:layout_constraintLeft_toRightOf="@id/btnConnectServerIp"
app:layout_constraintRight_toRightOf="parent"/>
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/btnConnectServerIp" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -949,6 +943,19 @@
android:columnCount="2"
android:visibility="gone">
<ToggleButton
android:id="@+id/tbChangeCurrentSkinMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="切换地图为「白天模式」"
android:textOn="切换地图为「夜间模式」"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
<ToggleButton
android:id="@+id/tbSpeedView"
android:layout_width="wrap_content"
@@ -1128,18 +1135,6 @@
app:layout_constraintRight_toLeftOf="@id/btnDrawTrolley"
app:layout_constraintTop_toBottomOf="@id/reset_changesight" />
<ToggleButton
android:id="@+id/tbChangeCurrentMapStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="切换地图为「白天模式」"
android:textOn="切换地图为「夜间模式」"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
<Button
android:id="@+id/btnDrawTrolley"
android:layout_width="0dp"
@@ -1643,90 +1638,82 @@
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
android:textOff="应用包管理中心"
android:textOn="应用包管理中心"
/>
android:textOn="应用包管理中心" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/apkCenterLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
>
android:visibility="gone">
<ImageView
android:id="@+id/ivApkSearch"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/icon_search"
android:padding="10dp"
android:layout_marginEnd="10dp"
/>
android:padding="10dp"
android:src="@drawable/icon_search"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etApkSearch"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivApkSearch"
app:layout_constraintTop_toTopOf="@id/ivApkSearch"
app:layout_constraintBottom_toBottomOf="@id/ivApkSearch"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/debug_setting_edit_bg"
android:gravity="center"
android:hint="请输入搜索关键字如版本号等"
android:textColor="#1A1A1A"
android:textSize="14sp"
android:hint="请输入搜索关键字如版本号等"
/>
app:layout_constraintBottom_toBottomOf="@id/ivApkSearch"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivApkSearch"
app:layout_constraintTop_toTopOf="@id/ivApkSearch" />
<CheckBox
android:id="@+id/cbApkOnline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:padding="@dimen/dp_10"
android:text="Online"
android:textColor="#000"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/cbApkQa"
app:layout_constraintTop_toBottomOf="@id/ivApkSearch"
android:checked="true"
/>
app:layout_constraintTop_toBottomOf="@id/ivApkSearch" />
<CheckBox
android:id="@+id/cbApkQa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:padding="@dimen/dp_10"
android:text="QA"
android:textColor="#000"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/cbApkOnline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivApkSearch"
android:checked="true"
/>
app:layout_constraintTop_toBottomOf="@id/ivApkSearch" />
<View
android:id="@+id/apkSearchDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/cbApkQa"
android:layout_marginTop="@dimen/dp_10"
/>
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/cbApkQa" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvUpgradeVersionList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/apkSearchDivider"
android:nestedScrollingEnabled="false"
/>
app:layout_constraintTop_toBottomOf="@id/apkSearchDivider" />
</androidx.constraintlayout.widget.ConstraintLayout>