diff --git a/config.gradle b/config.gradle
index d8372e74c5..1b35de82ec 100644
--- a/config.gradle
+++ b/config.gradle
@@ -154,7 +154,7 @@ targetSdkVersion : 22,
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
- adasapi : "com.zhidao.autopilot.support:adas:1.0.6.3",
+ adasapi : "com.zhidao.autopilot.support:adas:1.0.6.5",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
// 个人中心的SDK
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
index 20095d285f..1653a18a3c 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
@@ -1,27 +1,17 @@
package com.mogo.map.impl.amap;
import android.content.Context;
-import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
import android.location.Location;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
import android.os.SystemClock;
import android.os.Trace;
-import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Interpolator;
-import android.widget.ImageView;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import com.amap.api.maps.AMap;
import com.amap.api.maps.AMapUtils;
@@ -35,15 +25,13 @@ import com.amap.api.maps.model.MyLocationStyle;
import com.amap.api.maps.model.Poi;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.animation.Animation;
+import com.amap.api.maps.model.animation.ScaleAnimation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.amap.api.navi.AMapNaviView;
import com.amap.api.navi.AMapNaviViewListener;
import com.amap.api.navi.AMapNaviViewOptions;
import com.amap.api.navi.enums.AMapNaviViewShowMode;
import com.amap.api.navi.model.NaviInfo;
-import com.bumptech.glide.request.RequestOptions;
-import com.bumptech.glide.request.target.SimpleTarget;
-import com.bumptech.glide.request.transition.Transition;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoMapView;
import com.mogo.map.MogoLatLng;
@@ -62,11 +50,8 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
-import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WindowUtils;
-import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
-import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.List;
@@ -87,8 +72,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
AMapNaviViewListener,
AMapMessageListener,
AMap.OnCameraChangeListener,
- AMap.OnMyLocationChangeListener,
- Handler.Callback{
+ AMap.OnMyLocationChangeListener{
private static final String TAG = "AMapNaviViewWrapper";
@@ -137,7 +121,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
// 设置自车的图片对象
- checkDefaultOption();
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
options.setCompassEnabled( false );
@@ -565,18 +548,38 @@ public class AMapNaviViewWrapper implements IMogoMapView,
mMapView.getMap().setMyLocationStyle( style );
if ( visible ) {
// 强制刷新一遍车标
- setCarCursorOption(null);
+ setCarCursorOption(mCarCursorOption);
// style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
}
}
}
- private boolean isInEmphasizeAnim = false;
-
@Override
public void emphasizeMyLocation() {
- isInEmphasizeAnim = true;
- setCarCursorOption(null);
+ if (mMyLocationMarker == null) {
+ initMyLocationMarker();
+ }
+
+ ScaleAnimation animation = new ScaleAnimation(1f, 1.2f, 1f, 1.2f);
+ animation.setDuration(250);
+
+ mMyLocationMarker.setAnimation(animation);
+// mMyLocationMarker.setAnimationListener(new Animation.AnimationListener() {
+// @Override
+// public void onAnimationStart() {
+//
+// }
+//
+// @Override
+// public void onAnimationEnd() {
+// mMyLocationMarker.setAnimationListener(null);
+// ScaleAnimation animation = new ScaleAnimation(1.5f, 1f, 1.5f, 1f);
+// animation.setDuration(250);
+// mMyLocationMarker.setAnimation(animation);
+// mMyLocationMarker.startAnimation();
+// }
+// });
+ mMyLocationMarker.startAnimation();
}
@Override
@@ -939,42 +942,25 @@ public class AMapNaviViewWrapper implements IMogoMapView,
return mIsCarLocked;
}
- private String myLocationConfigCache = null;
- private boolean isUseDefaultOption = false;
-
- private void checkDefaultOption(){
- String myLocationConfig = SharedPrefsMgr.getInstance(getContext()).getString(
- "MY_LOCATION_CONFIG", "");
- if (myLocationConfigCache == null || !myLocationConfigCache.equals(myLocationConfig)) {
- // 内存缓存的地址为空,或者内存缓存的地址和sp保存的config不一致,那得重新获取bitmap
- loadMyLocationIcon(myLocationConfig);
- } else if (isInEmphasizeAnim) {
- DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(myLocationBitmap));
- }
-
- }
-
@Override
public void setCarCursorOption( CarCursorOption option ) {
if (!isVisible) {
// 当前自车图标没有显示,所以先不走下面的流程
return;
}
- if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
- mCarCursorOption.destroy();
- }
- checkDefaultOption();
- if ( option != null ) {
- try {
- isUseDefaultOption = false;
- mCarCursorOption = option.clone();
- } catch ( Exception e ) {
- isUseDefaultOption = true;
+// if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION) {
+// mCarCursorOption.destroy();
+// }
+ if(option != mCarCursorOption) {
+ if (option != null) {
+ try {
+ mCarCursorOption = option.clone();
+ } catch (Exception e) {
+ mCarCursorOption = DEFAULT_OPTION;
+ }
+ } else {
mCarCursorOption = DEFAULT_OPTION;
}
- } else {
- isUseDefaultOption = true;
- mCarCursorOption = DEFAULT_OPTION;
}
if ( !checkAMapView() ) {
return;
@@ -1032,96 +1018,4 @@ public class AMapNaviViewWrapper implements IMogoMapView,
mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) );
}
}
-
- protected void loadMyLocationIcon(String url) {
- if ( Looper.myLooper() != Looper.getMainLooper() ) {
- UiThreadHandler.post( ()-> loadMyLocationIconInUiThread(url));
- } else {
- loadMyLocationIconInUiThread(url);
- }
- }
-
- private void loadMyLocationIconInUiThread(String url) {
-
- if (!url.isEmpty()) {
- RequestOptions options = new RequestOptions()
- .placeholder( DEFAULT_OPTION.getCarCursorRes() )
- .error( DEFAULT_OPTION.getCarCursorRes() )
- .dontAnimate();
- GlideApp.with( getContext() )
- .asBitmap()
- .load( url )
- .apply( options )
- .into( new SimpleTarget< Bitmap >() {
- @Override
- public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition< ? super Bitmap > transition ) {
- if (isUseDefaultOption) {
- myLocationConfigCache = url;
- myLocationBitmap = resource;
- DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(resource));
- setCarCursorOption(null);
- }
- }
-
- @Override
- public void onLoadStarted( @Nullable Drawable placeholder ) {
- }
-
- @Override
- public void onLoadCleared( @Nullable Drawable placeholder ) {
- }
-
- @Override
- public void onLoadFailed( @Nullable Drawable errorDrawable ) {
- }
- } );
- }
- }
-
- private float emphasizeAnimOffset = 1f;
-
- private Bitmap inflateMyLocation(Bitmap res) {
- if (res == null) {
- throw new IllegalArgumentException("inflate myLocation bitmap can not be null!");
- }
- View root =
- LayoutInflater.from(getContext()).inflate(R.layout.module_map_amap_my_location, null, false);
- ImageView iv = root.findViewById(R.id.module_map_amap_my_location_iv);
- iv.setImageBitmap(res);
- if (isInEmphasizeAnim) {
- iv.setScaleX(emphasizeAnimOffset);
- iv.setScaleY(emphasizeAnimOffset);
- handler.sendEmptyMessageDelayed(MSG_CONTINUE_EMPHASIZE_ANIM, EMPHASIZE_ANIM_DELAY);
- }
- return BitmapDescriptorFactory.fromView(root).getBitmap();
- }
-
- /**
- * 目前仅用于强调动画
- */
- private Handler handler = new Handler(this);
- private static final int MSG_CONTINUE_EMPHASIZE_ANIM = 1001;
- private static final long EMPHASIZE_ANIM_DELAY = 80;
- private int emphasizeAnimProgress = 0;
- private Bitmap myLocationBitmap;
-
- @Override
- public boolean handleMessage(Message msg) {
- if (msg.what == MSG_CONTINUE_EMPHASIZE_ANIM) {
- if (emphasizeAnimProgress < 5) {
- emphasizeAnimOffset += 0.1;
- emphasizeAnimProgress++;
- }else if(emphasizeAnimProgress<10){
- emphasizeAnimOffset -= 0.1;
- emphasizeAnimProgress++;
- } else if (emphasizeAnimProgress == 10) {
- isInEmphasizeAnim = false;
- emphasizeAnimProgress = 0;
- emphasizeAnimOffset = 1;
- }
- setCarCursorOption(null);
- return true;
- }
- return false;
- }
}
diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/module_map_amap_my_location_icon.png b/libraries/map-amap/src/main/res/drawable-xhdpi/module_map_amap_my_location_icon.png
deleted file mode 100644
index b71e0a3b1d..0000000000
Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/module_map_amap_my_location_icon.png and /dev/null differ
diff --git a/libraries/map-amap/src/main/res/values/dimens.xml b/libraries/map-amap/src/main/res/values/dimens.xml
index 6898799649..21d58bd9ed 100644
--- a/libraries/map-amap/src/main/res/values/dimens.xml
+++ b/libraries/map-amap/src/main/res/values/dimens.xml
@@ -1,7 +1,7 @@
60px
- 78px
- 120px
+ 44px
+ 66px
146px
\ No newline at end of file
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java
new file mode 100644
index 0000000000..347447f467
--- /dev/null
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java
@@ -0,0 +1,107 @@
+package com.mogo.module.common.map;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.os.Looper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.amap.api.maps.model.BitmapDescriptorFactory;
+import com.bumptech.glide.request.RequestOptions;
+import com.bumptech.glide.request.target.SimpleTarget;
+import com.bumptech.glide.request.transition.Transition;
+import com.mogo.map.uicontroller.CarCursorOption;
+import com.mogo.module.common.MogoApisHandler;
+import com.mogo.module.common.R;
+import com.mogo.utils.UiThreadHandler;
+import com.mogo.utils.glide.GlideApp;
+
+/**
+ * 自车图标工具类
+ *
+ * @author tongchenfei
+ */
+public class MyLocationUtil {
+
+ private static boolean isLoadingIcon = false;
+ private static boolean needEmphasizeMyLocation = false;
+
+ public static void emphasizeMyLocation(){
+ if (!isLoadingIcon) {
+ MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
+ }else{
+ needEmphasizeMyLocation = true;
+ }
+ }
+
+ private static final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder()
+ .build();
+
+ public static void setMyLocationIconUrl(Context context, String url) {
+ if (url == null || url.isEmpty()) {
+ return;
+ }
+
+ if (Looper.myLooper() != Looper.getMainLooper()) {
+ UiThreadHandler.post(() -> loadMyLocationIconInUiThread(context, url));
+ } else {
+ loadMyLocationIconInUiThread(context, url);
+ }
+ }
+
+ private static void loadMyLocationIconInUiThread(Context context, String url) {
+ if (!url.isEmpty()) {
+ isLoadingIcon = true;
+ RequestOptions options = new RequestOptions()
+ .placeholder(DEFAULT_OPTION.getCarCursorRes())
+ .error(DEFAULT_OPTION.getCarCursorRes())
+ .dontAnimate();
+ GlideApp.with(context)
+ .asBitmap()
+ .load(url)
+ .apply(options)
+ .into(new SimpleTarget() {
+ @Override
+ public void onResourceReady(@NonNull Bitmap resource,
+ @Nullable Transition super Bitmap> transition) {
+ DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(context, resource));
+ MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().setCarCursorOption(DEFAULT_OPTION);
+ if (needEmphasizeMyLocation) {
+ needEmphasizeMyLocation = false;
+ MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
+ }
+ isLoadingIcon = false;
+ }
+
+ @Override
+ public void onLoadStarted(@Nullable Drawable placeholder) {
+ }
+
+ @Override
+ public void onLoadCleared(@Nullable Drawable placeholder) {
+ }
+
+ @Override
+ public void onLoadFailed(@Nullable Drawable errorDrawable) {
+ }
+ });
+ }
+ }
+
+ private static Bitmap inflateMyLocation(Context context, Bitmap res) {
+ if (res == null) {
+ throw new IllegalArgumentException("inflate myLocation bitmap can not be null!");
+ }
+ View root =
+ LayoutInflater.from(context).inflate(R.layout.module_map_amap_my_location, null, false);
+ ImageView iv =
+ root.findViewById(R.id.module_map_amap_my_location_iv);
+ iv.setImageBitmap(res);
+ return BitmapDescriptorFactory.fromView(root).getBitmap();
+ }
+}
diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png
new file mode 100644
index 0000000000..7538da98b2
Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png differ
diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png
new file mode 100644
index 0000000000..7538da98b2
Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png differ
diff --git a/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml b/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml
new file mode 100644
index 0000000000..690f7b6c48
--- /dev/null
+++ b/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index 52e86d3716..28b1bccd75 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -1,11 +1,15 @@
package com.mogo.module.extensions.entrance;
import android.content.Intent;
+import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
+import android.text.SpannableString;
+import android.text.Spanned;
import android.text.TextUtils;
+import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -21,6 +25,7 @@ import androidx.constraintlayout.widget.ConstraintSet;
import androidx.constraintlayout.widget.Group;
import com.alibaba.android.arouter.launcher.ARouter;
+import com.amap.api.maps.model.MyLocationStyle;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
@@ -42,6 +47,7 @@ import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
import com.mogo.module.common.map.CustomNaviInterrupter;
import com.mogo.module.common.map.MapCenterPointStrategy;
+import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.module.extensions.ExtensionsModuleConst;
@@ -836,7 +842,10 @@ public class EntranceFragment extends MvpFragment {
- MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
+ MyLocationUtil.emphasizeMyLocation();
// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
// TextView tv = v.findViewById(R.id.tvIndex);
// tv.setText("sub view height: " + currentHeight + ": " + v);
@@ -879,7 +888,12 @@ public class EntranceFragment extends MvpFragment TipToast.tip("分享成功"));
+ findViewById(R.id.btnShowTextTip).setOnClickListener(v-> TipToast.tip("分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功"));
findViewById(R.id.btnShowDrawableTip).setOnClickListener(v->{
mMsgContainer.setVisibility(View.VISIBLE);
@@ -928,9 +942,17 @@ public class EntranceFragment extends MvpFragment{
mMsgContainer.setVisibility(View.GONE);
- TipDrawable drawable =
- new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
- TipToast.tip("分享成功",drawable);
+
+
+ String enthusiasmIndex = "一般的字加粗的字一般的字";
+ SpannableString spannableStringUnSelectCountStr = new SpannableString(enthusiasmIndex);
+ ForegroundColorSpan foregroundColorSpanUnSelectCount = new ForegroundColorSpan(Color.RED);
+ spannableStringUnSelectCountStr.setSpan(foregroundColorSpanUnSelectCount, 4, 7, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
+
+ TipToast.tip(spannableStringUnSelectCountStr.toString());
+// TipDrawable drawable =
+// new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
+// TipToast.tip("分享成功",drawable);
});
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
index 457428d4b4..31ac15568d 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java
@@ -244,6 +244,7 @@ public class EntrancePresenter extends Presenter implements Weathe
private void requestCarModelList() {
Map params = new HashMap<>(8);
params.put("sn", Utils.getSn());
+// params.put("sn", "ZD802B1932L00617");
mNetWork.create(UserInfoNetApiServices.class, DztHttpConstant.getBaseUrl()).
requestCarModelList(params).
subscribeOn(Schedulers.io()).
diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java
index 0ad88b5e6e..90e40bb097 100644
--- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java
+++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapFragment.java
@@ -12,11 +12,13 @@ import com.mogo.map.IMogoUiSettings;
import com.mogo.map.MogoMapView;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
+import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.logger.Logger;
+import com.mogo.utils.storage.SharedPrefsMgr;
/**
* @author congtaowang
@@ -50,6 +52,8 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
mMogoMap = mMogoMapView.getMap();
mMogoMap.getUIController().showMyLocation( true );
mMogoMap.getUIController().recoverLockMode();// 启动锁车
+ // 根据本地配置设置自车图标
+ MyLocationUtil.setMyLocationIconUrl(getContext(), SharedPrefsMgr.getInstance(getContext()).getString("MY_LOCATION_CONFIG", ""));
}
@NonNull
diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
index 7770ed5df4..4da127db85 100644
--- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
+++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
@@ -9,12 +9,14 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
+import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.adas.IMogoAdasDataCallback;
import com.mogo.service.impl.singleton.SingletonsHolder;
import com.mogo.service.statusmanager.IMogoStatusManager;
+import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
@@ -74,6 +76,8 @@ public class MogoADASController implements IMogoADASController {
}
}
+ private volatile boolean needEmphasizeMyLocation = false;
+
@Override
public void showADAS() {
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
@@ -109,10 +113,10 @@ public class MogoADASController implements IMogoADASController {
@Override
public void selectCarModelUrl(String carStyleUrl) {
Logger.d(TAG,"selectCarModelUrl: "+carStyleUrl);
- // todo 修改自车图标展示
+ needEmphasizeMyLocation = true;
+ // 修改自车图标展示
SharedPrefsMgr.getInstance(context).putString("MY_LOCATION_CONFIG", carStyleUrl);
- MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().setCarCursorOption(null);
-// MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showMyLocation();
+ MyLocationUtil.setMyLocationIconUrl(context, carStyleUrl);
}
@Override
@@ -122,6 +126,19 @@ public class MogoADASController implements IMogoADASController {
AutopilotServiceManage.getInstance().settingCarModelListInfo(SharedPrefsMgr.getInstance(context).getString(
"CAR_MODEL_LIST", "default-value"));
}
+
+ @Override
+ public void clickSettingBack() {
+ if (needEmphasizeMyLocation) {
+ MyLocationUtil.emphasizeMyLocation();
+ }
+ needEmphasizeMyLocation = false;
+ }
+
+ @Override
+ public void showToast(String msg) {
+ UiThreadHandler.post(() -> TipToast.tip(msg));
+ }
});
}