修改故障求助marker显示实现方式
修改自车图标设置实现
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
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.Looper;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Trace;
|
||||
import android.util.Log;
|
||||
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;
|
||||
@@ -32,7 +39,9 @@ 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.mogo.commons.debug.DebugConfig;
|
||||
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;
|
||||
@@ -51,8 +60,11 @@ 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;
|
||||
|
||||
@@ -122,6 +134,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// 设置自车的图片对象
|
||||
checkDefaultOption();
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
options.setCompassEnabled( false );
|
||||
@@ -525,9 +538,12 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isVisible = false;
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
Logger.d( TAG, "showMyLocation1 %s", visible );
|
||||
isVisible = visible;
|
||||
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
@@ -543,11 +559,12 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
if ( visible ) {
|
||||
// 强制刷新一遍车标
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
setCarCursorOption(null);
|
||||
// style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -911,18 +928,39 @@ 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
|
||||
myLocationConfigCache = myLocationConfig;
|
||||
loadMyLocationIcon(myLocationConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
} else {
|
||||
isUseDefaultOption = true;
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
if ( !checkAMapView() ) {
|
||||
@@ -981,4 +1019,55 @@ 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) {
|
||||
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 Bitmap inflateMyLocation(Bitmap res) {
|
||||
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);
|
||||
return BitmapDescriptorFactory.fromView(root).getBitmap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_map_amap_my_location_iv"
|
||||
android:layout_width="@dimen/module_map_amap_my_location_size"
|
||||
android:layout_height="@dimen/module_map_amap_my_location_size" />
|
||||
</FrameLayout>
|
||||
4
libraries/map-amap/src/main/res/values-xhdpi/dimens.xml
Normal file
4
libraries/map-amap/src/main/res/values-xhdpi/dimens.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_map_amap_my_location_size">370px</dimen>
|
||||
</resources>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="path_width">60px</dimen>
|
||||
<dimen name="module_map_amap_my_location_size">146px</dimen>
|
||||
</resources>
|
||||
@@ -6,8 +6,11 @@ package com.mogo.module.common.entity;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OwnCarModelEntity {
|
||||
private boolean isLocked;
|
||||
private String ownCarLocationUrl;
|
||||
private String adasCarModelUrl;
|
||||
/**
|
||||
* 图片锁定 1-是 0-否
|
||||
*/
|
||||
private int isLock;
|
||||
private String imageUrl;
|
||||
private String imageName;
|
||||
private int level;
|
||||
}
|
||||
|
||||
@@ -31,12 +31,14 @@ import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
|
||||
import com.mogo.utils.DeviceIdUtils;
|
||||
import com.mogo.utils.digest.DigestUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
@@ -240,14 +242,17 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
|
||||
}
|
||||
|
||||
private void requestCarModelList() {
|
||||
Map<String, String> params = new HashMap<>(8);
|
||||
params.put("sn", Utils.getSn());
|
||||
mNetWork.create(UserInfoNetApiServices.class, DztHttpConstant.getBaseUrl()).
|
||||
requestCarModelList().
|
||||
requestCarModelList(params).
|
||||
subscribeOn(Schedulers.io()).
|
||||
observeOn(Schedulers.io()).
|
||||
subscribe(new SubscribeImpl<CarModelListResponse>(RequestOptions.create(context)) {
|
||||
@Override
|
||||
public void onSuccess(CarModelListResponse o) {
|
||||
super.onSuccess(o);
|
||||
Logger.d(TAG, "请求车模列表成功: " + o);
|
||||
// todo 保存到sp中
|
||||
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST",
|
||||
GsonUtil.jsonFromObject(o.getResult()));
|
||||
@@ -265,6 +270,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
|
||||
Logger.e(TAG, "请求自车模型失败: " + message);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ public interface UserInfoNetApiServices {
|
||||
Single<UserInfoResponse> requestUserInfo(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("carlife/carMachine/getAccountInfo")
|
||||
Observable<CarModelListResponse> requestCarModelList();
|
||||
Observable<CarModelListResponse> requestCarModelList(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.module.extensions.userinfo;
|
||||
|
||||
import com.mogo.module.common.entity.OwnCarModelEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CarModelListInfo {
|
||||
private String sn;
|
||||
/**
|
||||
* 热心指数 eg: 1 1.5 2 2.5
|
||||
*/
|
||||
private float enthusiasmIndex;
|
||||
private List<OwnCarModelEntity> imageData;
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public float getEnthusiasmIndex() {
|
||||
return enthusiasmIndex;
|
||||
}
|
||||
|
||||
public void setEnthusiasmIndex(float enthusiasmIndex) {
|
||||
this.enthusiasmIndex = enthusiasmIndex;
|
||||
}
|
||||
|
||||
public List<OwnCarModelEntity> getImageData() {
|
||||
return imageData;
|
||||
}
|
||||
|
||||
public void setImageData(List<OwnCarModelEntity> imageData) {
|
||||
this.imageData = imageData;
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,13 @@ import java.util.List;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class CarModelListResponse extends BaseData {
|
||||
private List<OwnCarModelEntity> result;
|
||||
private CarModelListInfo result;
|
||||
|
||||
public List<OwnCarModelEntity> getResult() {
|
||||
public CarModelListInfo getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(List<OwnCarModelEntity> result) {
|
||||
public void setResult(CarModelListInfo result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,17 +54,19 @@ class ADASStatusIntentHandler implements IntentHandler {
|
||||
}
|
||||
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
|
||||
MarkerServiceHandler.getMogoStatusManager().setADASUIShow( ServiceConst.TYPE, status == 1 );
|
||||
} else {
|
||||
String msg = intent.getStringExtra( "adasMsg" );
|
||||
if ( TextUtils.isEmpty( msg ) ) {
|
||||
return;
|
||||
}
|
||||
CarStateInfo stateInfo = GsonUtil.objectFromJson( msg, CarStateInfo.class );
|
||||
if ( stateInfo != null ) {
|
||||
changeCarHeadstockDirection( context, stateInfo.getValues().getHeading() );
|
||||
// changeMyLocation( stateInfo.getValues() );
|
||||
}
|
||||
}
|
||||
// 由于adas可能调高此处的调用频率,存在anr风险,且此处没有作用,所以暂时注释掉
|
||||
// else {
|
||||
// String msg = intent.getStringExtra( "adasMsg" );
|
||||
// if ( TextUtils.isEmpty( msg ) ) {
|
||||
// return;
|
||||
// }
|
||||
// CarStateInfo stateInfo = GsonUtil.objectFromJson( msg, CarStateInfo.class );
|
||||
// if ( stateInfo != null ) {
|
||||
// changeCarHeadstockDirection( context, stateInfo.getValues().getHeading() );
|
||||
// // changeMyLocation( stateInfo.getValues() );
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private void changeCarHeadstockDirection( final Context context, final double degree ) {
|
||||
|
||||
@@ -104,16 +104,17 @@ public class CarIconDisplayStrategy {
|
||||
private static volatile CarIconDisplayStrategy sInstance;
|
||||
|
||||
private IMogoMarker mSeekHelpingMarker;
|
||||
private ArrayList< Bitmap > mBitmapFrames = new ArrayList<>();
|
||||
private ArrayList<Bitmap> mBitmapFrames = new ArrayList<>();
|
||||
|
||||
private CarIconDisplayStrategy() {
|
||||
mOption = new CarCursorOption.Builder().carCursorRes( R.drawable.module_service_ic_seek_helping ).build();
|
||||
mOption =
|
||||
new CarCursorOption.Builder().carCursorRes(R.drawable.module_service_ic_seek_helping).build();
|
||||
}
|
||||
|
||||
public static CarIconDisplayStrategy getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( CarIconDisplayStrategy.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (CarIconDisplayStrategy.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new CarIconDisplayStrategy();
|
||||
}
|
||||
}
|
||||
@@ -127,19 +128,41 @@ public class CarIconDisplayStrategy {
|
||||
|
||||
private Handler mSeekHelpingHandler;
|
||||
private CarCursorOption mOption;
|
||||
private MogoMarkerOptions seekHelpMarkerOptions;
|
||||
// private IMogoMarker seekHelpMarker;
|
||||
|
||||
public void changeCarIconStatus( boolean seekHelpingStatus ) {
|
||||
if ( CarSeries.isF8xxSeries() ) {
|
||||
if ( seekHelpingStatus ) {
|
||||
|
||||
public void changeCarIconStatus(boolean seekHelpingStatus) {
|
||||
if (CarSeries.isF8xxSeries()) {
|
||||
if (seekHelpingStatus) {
|
||||
playSeekHelpingAnim();
|
||||
} else {
|
||||
stopSeekHelpingAnim();
|
||||
}
|
||||
} else {
|
||||
if ( seekHelpingStatus ) {
|
||||
MarkerServiceHandler.getMapUIController().setCarCursorOption( mOption );
|
||||
if (seekHelpingStatus) {
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(false);
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(
|
||||
TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icon(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), R.drawable.module_service_ic_seek_helping))
|
||||
.period(1)
|
||||
.zIndex(1000)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption( mOption );
|
||||
} else {
|
||||
MarkerServiceHandler.getMapUIController().setCarCursorOption( null );
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(true);
|
||||
try {
|
||||
if (mSeekHelpingMarker != null) {
|
||||
mSeekHelpingMarker.destroy();
|
||||
mSeekHelpingMarker = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,29 +171,29 @@ public class CarIconDisplayStrategy {
|
||||
initHandler();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = MSG_SEEK_HELPING_ANIM;
|
||||
mSeekHelpingHandler.sendMessageDelayed( msg, 0 );
|
||||
mSeekHelpingHandler.sendMessageDelayed(msg, 0);
|
||||
}
|
||||
|
||||
private void initHandler() {
|
||||
if ( mSeekHelpingHandler != null ) {
|
||||
if (mSeekHelpingHandler != null) {
|
||||
return;
|
||||
}
|
||||
mSeekHelpingHandler = new Handler( WorkThreadHandler.getInstance().getLooper() ) {
|
||||
mSeekHelpingHandler = new Handler(WorkThreadHandler.getInstance().getLooper()) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
switch ( msg.what ) {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case MSG_SEEK_HELPING_ANIM:
|
||||
try {
|
||||
playAnim();
|
||||
} catch ( Exception e ) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case MSG_STOP_SEEK_HELPING_ANIM:
|
||||
try {
|
||||
stopAnim();
|
||||
} catch ( Exception e ) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
@@ -183,48 +206,59 @@ public class CarIconDisplayStrategy {
|
||||
initHandler();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = MSG_STOP_SEEK_HELPING_ANIM;
|
||||
mSeekHelpingHandler.sendMessageDelayed( msg, 0 );
|
||||
mSeekHelpingHandler.sendMessageDelayed(msg, 0);
|
||||
}
|
||||
|
||||
private void playAnim() {
|
||||
try {
|
||||
for ( int i : sFrame ) {
|
||||
mBitmapFrames.add( BitmapFactory.decodeResource( AbsMogoApplication.getApp().getResources(), i ) );
|
||||
for (int i : sFrame) {
|
||||
mBitmapFrames.add(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), i));
|
||||
}
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker( TAG, new MogoMarkerOptions()
|
||||
.icons( mBitmapFrames )
|
||||
.period( 1 )
|
||||
.zIndex( 1000 )
|
||||
.autoManager( false )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
.position( MarkerServiceHandler.getMapService().getNavi( AbsMogoApplication.getApp() ).getCarLocation2() ) );
|
||||
} catch ( Exception e ) {
|
||||
MarkerServiceHandler.getMapUIController().setCarCursorOption( new CarCursorOption.Builder().carCursorRes( R.drawable.module_service_ic_seek_helping_00036 ).build() );
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icons(mBitmapFrames)
|
||||
.period(1)
|
||||
.zIndex(1000)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(
|
||||
TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icon(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), R.drawable.module_service_ic_seek_helping))
|
||||
.period(1)
|
||||
.zIndex(1000)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption(new CarCursorOption.Builder().carCursorRes(R.drawable.module_service_ic_seek_helping_00036).build());
|
||||
}
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation( false );
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(false);
|
||||
}
|
||||
|
||||
private void stopAnim() {
|
||||
try {
|
||||
if ( mSeekHelpingMarker != null ) {
|
||||
if (mSeekHelpingMarker != null) {
|
||||
mSeekHelpingMarker.destroy();
|
||||
mSeekHelpingMarker = null;
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
try {
|
||||
if ( !mBitmapFrames.isEmpty() ) {
|
||||
for ( Bitmap bitmapFrame : mBitmapFrames ) {
|
||||
if ( bitmapFrame != null && !bitmapFrame.isRecycled() ) {
|
||||
if (!mBitmapFrames.isEmpty()) {
|
||||
for (Bitmap bitmapFrame : mBitmapFrames) {
|
||||
if (bitmapFrame != null && !bitmapFrame.isRecycled()) {
|
||||
bitmapFrame.recycle();
|
||||
}
|
||||
}
|
||||
mBitmapFrames.clear();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation( true );
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
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.utils.CarSeries;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
@@ -109,13 +110,16 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void selectCarModelUrl(String carStyleUrl) {
|
||||
Logger.d(TAG,"selectCarModelUrl: "+carStyleUrl);
|
||||
// todo 修改自车图标展示
|
||||
SharedPrefsMgr.getInstance(context).putString("MY_LOCATION_CONFIG", carStyleUrl);
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().setCarCursorOption(null);
|
||||
// MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showMyLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestGetCarModelListInfo() {
|
||||
Logger.d(TAG, "requestGetCarModelListInfo");
|
||||
// 向adas发送车模list
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo(SharedPrefsMgr.getInstance(ContextHolderUtil.getContext()).getString(
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo(SharedPrefsMgr.getInstance(context).getString(
|
||||
"CAR_MODEL_LIST", "default-value"));
|
||||
}
|
||||
});
|
||||
@@ -182,9 +186,11 @@ public class MogoADASController implements IMogoADASController {
|
||||
app.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
private Context context;
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
AutopilotServiceManage.getInstance().init( context );
|
||||
this.context = context;
|
||||
mIsReleased = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user