「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:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
//设置鹰眼本地参数配置监听
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
@@ -51,7 +50,6 @@ public class IdentifyDataDrawer {
|
||||
|
||||
private IdentifyDataDrawer() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
addPreVehicleModel();
|
||||
}
|
||||
|
||||
public static IdentifyDataDrawer getInstance() {
|
||||
@@ -178,44 +176,4 @@ public class IdentifyDataDrawer {
|
||||
trafficDataUuidList.clear();
|
||||
}
|
||||
|
||||
private void addPreVehicleModel() {
|
||||
CallerLogger.INSTANCE.d(TAG, "添加感知模型到地图中……");
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI, "添加感知模型到地图中……preVehicleStrWeiZhi=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE, "添加感知模型到地图中……preVehicleStrPeople=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE, "添加感知模型到地图中……preVehicleStrBicycle=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE, "添加感知模型到地图中……preVehicleStrTaChe=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO, "添加感知模型到地图中……preVehicleStrMoto=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_BUS, "添加感知模型到地图中……preVehicleStrBus=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_TRUCK, "添加感知模型到地图中……preVehicleStrTruck=");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模型到地图中
|
||||
*
|
||||
* @param typeTrafficIdWeiZhi
|
||||
* @param s
|
||||
*/
|
||||
private void addPreVehicleModelWeiZhi(TrafficTypeEnum typeTrafficIdWeiZhi, String s) {
|
||||
String preVehicleStrWeiZhi = MogoMarkerManager.getInstance(mContext)
|
||||
.addPreVehicleModel(typeTrafficIdWeiZhi.getType(),
|
||||
typeTrafficIdWeiZhi.getTraffic3DIconId());
|
||||
CallerLogger.INSTANCE.d(TAG, s + preVehicleStrWeiZhi);
|
||||
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerLogger.INSTANCE.w(TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
addPreVehicleModelWeiZhi(typeTrafficIdWeiZhi, s);
|
||||
}
|
||||
}, 1000L);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
@@ -25,7 +28,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
||||
public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
implements MapView, IMoGoMapFragmentProvider {
|
||||
implements MapView, IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener {
|
||||
|
||||
private static final String TAG = "MapFragment";
|
||||
|
||||
@@ -71,6 +74,8 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
if (mMogoMap != null) {
|
||||
mMogoMap.getUIController().showMyLocation(true);
|
||||
}
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -163,6 +168,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
CallerSkinModeListenerManager.INSTANCE.removeListener(TAG);
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onDestroy();
|
||||
mMogoMapView = null;
|
||||
@@ -226,4 +232,14 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
public CenterLine getCenterLineInfo(double lon, double lat, float angle) {
|
||||
return mMogoMapView.getMap().getUIController().getCenterLineInfo(lon, lat, angle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkinModeChange(int skinMode) {
|
||||
if (skinMode == 0) {
|
||||
CallerHDMapManager.INSTANCE.stepInVrMode(false);
|
||||
} else if (skinMode == 1) {
|
||||
CallerHDMapManager.INSTANCE.stepInVrMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user