「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:
@@ -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