Merge branch 'feature/v1.0.2' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into feature/v1.0.2
This commit is contained in:
@@ -4,6 +4,7 @@ import com.amap.api.maps.model.Marker;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -19,11 +20,12 @@ public class AMapMarkerClickHandler {
|
||||
}
|
||||
if ( marker.getObject() instanceof IMogoMarker ) {
|
||||
IMogoMarker mogoMarker = ( ( IMogoMarker ) marker.getObject() );
|
||||
MogoMarkersHandler.getInstance().onMarkerClicked( mogoMarker );
|
||||
final IMogoMarkerClickListener listener = mogoMarker.getOnMarkerClickListener();
|
||||
Logger.d( "AMapMarkerWrapper", "marker 点击回调:%s -> %s", mogoMarker, marker );
|
||||
if ( listener != null ) {
|
||||
return listener.onMarkerClicked( mogoMarker );
|
||||
listener.onMarkerClicked( mogoMarker );
|
||||
}
|
||||
return MogoMarkersHandler.getInstance().onMarkerClicked( mogoMarker );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Trace;
|
||||
@@ -15,6 +16,7 @@ import android.view.animation.Interpolator;
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.AMapUtils;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.CustomRenderer;
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
import com.amap.api.maps.model.CameraPosition;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
@@ -36,6 +38,7 @@ import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.amap.hook.BnHooker;
|
||||
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
||||
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
||||
@@ -51,6 +54,9 @@ import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
import retrofit2.http.HEAD;
|
||||
|
||||
/**
|
||||
@@ -81,6 +87,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
public AMapNaviViewWrapper( AMapNaviView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView, this );
|
||||
try {
|
||||
new BnHooker( mMapView.getMap() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
@@ -372,7 +383,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.zoomOut();
|
||||
}
|
||||
Logger.i( TAG, "mapview zoom = " + mMapView.getMap().getCameraPosition().zoom );
|
||||
Logger.i( TAG, "scalePerPixel = " + getMap().getScalePerPixel() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,12 +469,20 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.getMap().setMyLocationEnabled( true );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
|
||||
style.interval( 1000 );
|
||||
style.interval( 500 );
|
||||
style.anchor( 0.5F, 0.5F );
|
||||
style.strokeColor( Color.TRANSPARENT );
|
||||
style.strokeWidth( 0 );
|
||||
style.radiusFillColor( Color.TRANSPARENT );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
mMapView.getMap().setOnMyLocationChangeListener(
|
||||
new AMap.OnMyLocationChangeListener() {
|
||||
@Override
|
||||
public void onMyLocationChange( Location location ) {
|
||||
Logger.d( TAG, location.toString() );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.map.impl.amap.hook;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.autonavi.base.amap.api.mapcore.IAMapDelegate;
|
||||
import com.autonavi.base.amap.mapcore.interfaces.IAMapListener;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-12
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class BnHooker implements InvocationHandler {
|
||||
|
||||
private static final String TAG = "BnHooker";
|
||||
|
||||
private Object host;
|
||||
|
||||
public BnHooker( AMap map ) throws Exception {
|
||||
|
||||
|
||||
if ( map == null ) {
|
||||
return;
|
||||
}
|
||||
Field field = AMap.class.getDeclaredField( "a" );
|
||||
field.setAccessible( true );
|
||||
host = field.get( map );
|
||||
Object object = Proxy.newProxyInstance( BnHooker.class.getClassLoader(),
|
||||
new Class[]{com.amap.api.col.n3.ft.a.class, IAMapDelegate.class, IAMapListener.class},
|
||||
this
|
||||
);
|
||||
field.set( map, object );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable {
|
||||
if ( method.getName().equals( "setRenderFps" ) ) {
|
||||
return method.invoke( host, 10 );
|
||||
}
|
||||
return method.invoke( host, args );
|
||||
}
|
||||
}
|
||||
@@ -325,10 +325,10 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
return;
|
||||
}
|
||||
|
||||
ScaleAnimation animationScale = new ScaleAnimation(fromX, toX, fromY, toY);
|
||||
animationScale.setDuration(duration);
|
||||
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
|
||||
animationScale.setInterpolator(interpolator);
|
||||
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
|
||||
animationScale.setDuration( duration );
|
||||
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
|
||||
animationScale.setInterpolator( interpolator );
|
||||
|
||||
mMarker.setAnimation( animationScale );
|
||||
mMarker.startAnimation();
|
||||
|
||||
@@ -91,7 +91,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
MogoNaviListenerHandler.getInstance().onInitNaviSuccess();
|
||||
//mAMapNavi.startAimlessMode(AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED);
|
||||
mAMapNavi.startAimlessMode(AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -145,8 +145,11 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mMove2CurrentLocation.setOnClickListener( view -> {
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
if ( !mMogoStatusManager.isADASShow() ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
mMApUIController.setLockZoom( 16 );
|
||||
}
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
|
||||
@@ -324,6 +324,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
if ( mMogoModuleHandler != null ) {
|
||||
mMogoModuleHandler.onMarkerClicked( marker );
|
||||
}
|
||||
switch2Card( marker.getOwner(), false );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
/**
|
||||
@@ -43,6 +44,7 @@ public class MarkerServiceHandler {
|
||||
private static IMogoSocketManager mMogoSocketManager;
|
||||
private static IMogoCardManager mMogoCardManager;
|
||||
private static IMogoAnalytics mMogoAnalytics;
|
||||
private static IMogoRegisterCenter mRegisterCenter;
|
||||
|
||||
private static MapMarkerManager mMapMarkerManager;
|
||||
|
||||
@@ -59,6 +61,7 @@ public class MarkerServiceHandler {
|
||||
mNavi = mMapService.getNavi( context );
|
||||
mMapUIController = mMapService.getMapUIController();
|
||||
mLocationClient = mMapService.getSingletonLocationClient( context );
|
||||
mRegisterCenter = mApis.getRegisterCenterApi();
|
||||
|
||||
mMapMarkerManager = MapMarkerManager.getInstance();
|
||||
mMapMarkerManager.init( context );
|
||||
@@ -108,6 +111,9 @@ public class MarkerServiceHandler {
|
||||
return mMapMarkerManager;
|
||||
}
|
||||
|
||||
public static IMogoRegisterCenter getRegisterCenter() {
|
||||
return mRegisterCenter;
|
||||
}
|
||||
|
||||
//TODO -------------以下方法是临时过度使用的,后面统一使用,getMapMarkerManager进行调用
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
@@ -47,6 +48,7 @@ import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Iterator;
|
||||
@@ -64,7 +66,7 @@ import java.util.List;
|
||||
* 4. 用户交互语音导致地图视图移动,缩放,不触发刷新
|
||||
*/
|
||||
@Route( path = ServiceConst.PATH_REFRESH_STRATEGY )
|
||||
public class MogoServiceProvider implements IMogoModuleProvider{
|
||||
public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
|
||||
private static final String TAG = "MogoRefreshStrategyProvider";
|
||||
|
||||
@@ -126,6 +128,8 @@ public class MogoServiceProvider implements IMogoModuleProvider{
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
MogoServices.getInstance().init( context );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
}, 5_000L );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Trace;
|
||||
@@ -13,14 +14,11 @@ import android.view.MotionEvent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoAimlessModeListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
@@ -36,6 +34,8 @@ import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.refresh.AutoRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.RefreshObject;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
@@ -166,7 +166,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
*/
|
||||
private void invokeAutoRefresh() {
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, false );
|
||||
mUiController.changeZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
|
||||
mUiController.setLockZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
|
||||
mStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mUiController.recoverLockMode();
|
||||
notifyRefreshData( mLastAutoRefreshLocation, ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS, mAutoRefreshCallback );
|
||||
}
|
||||
@@ -190,7 +192,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
mLoopRequest = false;
|
||||
mRefreshRemainingTimeStatus = false;
|
||||
// 用户手动操作地图刷新成功后,设置状态为 true,引发延时策略
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
|
||||
}
|
||||
@@ -232,35 +233,66 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
};
|
||||
|
||||
// 延时状态
|
||||
private boolean mRefreshRemainingTimeStatus = false;
|
||||
private HandlerThread mHandlerThread;
|
||||
|
||||
private Handler mThreadHandler;
|
||||
|
||||
public void init( Context context ) {
|
||||
mContext = context;
|
||||
mRefreshModel = new RefreshModel( context );
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( context );
|
||||
IMogoServiceApis apis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mMogoMapService = apis.getMapServiceApi();
|
||||
mUiController = mMogoMapService.getMapUIController();
|
||||
mStatusManager = ( IMogoStatusManager ) ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( context );
|
||||
mStatusManager = apis.getStatusManagerApi();
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEARCH_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.V2X_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ADAS_UI, this );
|
||||
|
||||
//TODO 初始化地图地图绘制大而全的Marker
|
||||
MarkerServiceHandler.init( mContext );
|
||||
registerAIReceiver( context );
|
||||
|
||||
IMogoRegisterCenter registerCenter = ( IMogoRegisterCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_REGISTER_CENTER ).navigation( context );
|
||||
IMogoRegisterCenter registerCenter = apis.getRegisterCenterApi();
|
||||
registerCenter.registerMogoLocationListener( ServiceConst.TYPE, this );
|
||||
registerCenter.registerMogoNaviListener( ServiceConst.TYPE, this );
|
||||
registerCenter.registerMogoMapListener( ServiceConst.TYPE, this );
|
||||
registerCenter.registerMogoAimlessModeListener( ServiceConst.TYPE, this );
|
||||
|
||||
mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( context );
|
||||
mIntentManager = apis.getIntentManagerApi();
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTIION_ADAS, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_POWER_CONNECTED, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_POWER_DISCONNECTED, this );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_NWD_ACC, this );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_VOICE_UI, this );
|
||||
|
||||
initWorkThread();
|
||||
}
|
||||
|
||||
private void initWorkThread() {
|
||||
mHandlerThread = new HandlerThread( "mogo-handler-thread" );
|
||||
mHandlerThread.start();
|
||||
mThreadHandler = new Handler( mHandlerThread.getLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
Logger.d( TAG, "thread = %s", Thread.currentThread().getName() );
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == ServiceConst.MSG_MAP_CHANGED ) {
|
||||
if ( msg.obj instanceof RefreshObject ) {
|
||||
RefreshObject ro = ( ( RefreshObject ) msg.obj );
|
||||
if ( invokeRefreshWhenTranslationByUser( ro.mLonLat ) ) {
|
||||
notifyRefreshData( ro.mLonLat, ro.mRadius, ro.mCallback );
|
||||
mLastCustomRefreshCenterLocation = ro.mLonLat;
|
||||
}
|
||||
}
|
||||
} else if ( msg.what == ServiceConst.MSG_REQUEST_DATA ) {
|
||||
if ( msg.obj instanceof RefreshObject ) {
|
||||
RefreshObject ro = ( ( RefreshObject ) msg.obj );
|
||||
mRefreshModel.refreshData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
|
||||
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void registerAIReceiver( Context context ) {
|
||||
@@ -299,7 +331,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
refreshCameraPosition();
|
||||
initMapStatus();
|
||||
}
|
||||
|
||||
private void initMapStatus() {
|
||||
@@ -326,7 +358,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
try {
|
||||
return Utils.calculateLineDistance( mCameraNorthEastPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
|
||||
} catch ( Exception e ) {
|
||||
return 1000f;
|
||||
return ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,25 +371,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
try {
|
||||
return Utils.calculateLineDistance( mCameraSouthWestPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
|
||||
} catch ( Exception e ) {
|
||||
return 1000f;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新视图范围坐标
|
||||
*/
|
||||
private void refreshCameraPosition() {
|
||||
mCameraSouthWestPosition = mUiController.getCameraSouthWestPosition();
|
||||
mCameraNorthEastPosition = mUiController.getCameraNorthEastPosition();
|
||||
|
||||
initMapStatus();
|
||||
|
||||
if ( mIsVertical ) {
|
||||
float width = getMapCameraFactWidth();
|
||||
Logger.i( TAG, "current zoom level width: %f m", width );
|
||||
} else {
|
||||
float height = getMapCameraFactHeight();
|
||||
Logger.i( TAG, "current zoom level height: %f m", height );
|
||||
return ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,19 +421,15 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLastZoomLevel = zoom;
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mIsCameraInited = false;
|
||||
initMapStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mLastZoomLevel != zoom || mCameraNorthEastPosition == null ) {
|
||||
refreshCameraPosition();
|
||||
}
|
||||
|
||||
// 部分非用户操作导致地图视图变化:绘线、圈点等不触发用户刷新
|
||||
// 消费状态
|
||||
if ( mStatusManager.isUserInteracted() ) {
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mLastZoomLevel = zoom;
|
||||
refreshCameraPosition();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -427,7 +437,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( mStatusManager.isADASShow() ) {
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mLastZoomLevel = zoom;
|
||||
refreshCameraPosition();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -441,14 +450,16 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLastZoomLevel = zoom;
|
||||
} else if ( mLastZoomLevel == zoom ) {
|
||||
// 手动平移
|
||||
if ( invokeRefreshWhenTranslationByUser( latLng ) ) {
|
||||
notifyRefreshData( latLng, getQueryRadius(), mCustomRefreshCallback );
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
}
|
||||
Message msg = Message.obtain();
|
||||
msg.what = ServiceConst.MSG_MAP_CHANGED;
|
||||
msg.obj = new RefreshObject( mCustomRefreshCallback, getQueryRadius(), latLng, 0 );
|
||||
mThreadHandler.sendMessage( msg );
|
||||
}
|
||||
}
|
||||
|
||||
private int getQueryRadius() {
|
||||
mCameraSouthWestPosition = mUiController.getCameraSouthWestPosition();
|
||||
mCameraNorthEastPosition = mUiController.getCameraNorthEastPosition();
|
||||
if ( mIsVertical ) {
|
||||
return ( ( int ) ( getMapCameraFactWidth() / 2 ) );
|
||||
}
|
||||
@@ -514,6 +525,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLastAutoRefreshLocation = point;
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,8 +537,11 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
Logger.d( TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新" );
|
||||
int amount = mLastZoomLevel >= 10 ? 5 : 10;
|
||||
mRefreshModel.refreshData( latLng, radius, amount, callback );
|
||||
Logger.i( TAG, "刷新半径 = %d, 点 = %s, zoomLevel = %f, amount = %d", radius, latLng, mLastZoomLevel, amount );
|
||||
|
||||
Message msg = Message.obtain();
|
||||
msg.what = ServiceConst.MSG_REQUEST_DATA;
|
||||
msg.obj = new RefreshObject( callback, radius, latLng, amount );
|
||||
mThreadHandler.sendMessage( msg );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -556,8 +571,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
Logger.d( TAG, "状态发生改变---descriptor---" + descriptor + "----isTrue---" + isTrue );
|
||||
switch ( descriptor ) {
|
||||
case USER_INTERACTED:
|
||||
if ( isTrue && !mRefreshRemainingTimeStatus ) {
|
||||
mRefreshRemainingTimeStatus = true;
|
||||
if ( isTrue ) {
|
||||
mRefreshRemainingTime = ServiceConst.DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT;
|
||||
Logger.i( TAG, "用户状态改变,下次刷新时间:%ss后", mRefreshRemainingTime );
|
||||
}
|
||||
@@ -573,17 +587,17 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V2X_UI:
|
||||
case ADAS_UI:
|
||||
try {
|
||||
if ( isTrue ) {
|
||||
// V2X_UI时,不在自动刷新打点策略
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
} else {
|
||||
// 主动刷新
|
||||
refreshStrategy();
|
||||
// V2X_UI后,打开打点策略
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
@@ -646,8 +660,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
|
||||
mUiController.setLockZoom( status == 1 ? 15 : ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
|
||||
mStatusManager.setADASUIShow( ServiceConst.TYPE, status == 1 );
|
||||
if ( status != 1 ) {
|
||||
mUiController.setLockZoom( ServiceConst.DEFAULT_LOCK_CAR_ZOOM_LEVEL );
|
||||
}
|
||||
mUiController.showMyLocation( true );
|
||||
} else if ( Intent.ACTION_POWER_CONNECTED.equals( command ) ) {
|
||||
mStatusManager.setAccStatus( ServiceConst.TYPE, true );
|
||||
|
||||
@@ -87,5 +87,25 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final int DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT = 30 * 1_000;
|
||||
|
||||
/**
|
||||
* 所有卡片显示的每类点的最大数据量
|
||||
*/
|
||||
public static final int MAX_AMOUNT_ALL = 5;
|
||||
|
||||
/**
|
||||
* 单个卡片显示时的最大数据量
|
||||
*/
|
||||
public static final int MAX_AMOUNT_SINGLE_CARD = 10;
|
||||
|
||||
/**
|
||||
* 地图变化消息
|
||||
*/
|
||||
public static final int MSG_MAP_CHANGED = 0x200;
|
||||
|
||||
/**
|
||||
* 请求刷新数据
|
||||
*/
|
||||
public static final int MSG_REQUEST_DATA = 0x201;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
@@ -21,6 +22,7 @@ import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -70,37 +72,44 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV
|
||||
|
||||
protected void loadImageWithMarker(final MarkerShowEntity markerShowEntity) {
|
||||
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( ()-> {
|
||||
runOnUiThread( markerShowEntity );
|
||||
});
|
||||
} else {
|
||||
runOnUiThread( markerShowEntity );
|
||||
}
|
||||
}
|
||||
|
||||
private void runOnUiThread(final MarkerShowEntity markerShowEntity){
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getIconUrl())) {
|
||||
MarkerServiceHandler
|
||||
.getImageloader()
|
||||
.displayImage(markerShowEntity.getIconUrl(),
|
||||
ivUserHead,
|
||||
WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
MarkerServiceHandler.getImageloader().displayImage(markerShowEntity.getIconUrl(),
|
||||
ivUserHead,
|
||||
WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
Logger.d(TAG, "loadImageWithMarker loaded.");
|
||||
// 使用view渲染地图marker,刷新纹理的时候,需要重新用view生成纹理,然后在设置
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setIcon( fromView( MapMarkerBaseView.this ) );
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
Logger.d(TAG, "loadImageWithMarker loaded.");
|
||||
// 使用view渲染地图marker,刷新纹理的时候,需要重新用view生成纹理,然后在设置
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setIcon( fromView( MapMarkerBaseView.this ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "loadImageWithMarker onFailure.");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "loadImageWithMarker onFailure.");
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
ivUserHead.setBackgroundResource(R.drawable.icon_default_user_head);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Bitmap fromView( View view ) {
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.TextureView;
|
||||
import android.view.animation.BounceInterpolator;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
|
||||
import com.alibaba.idst.nls.internal.utils.L;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -21,7 +23,6 @@ import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShareMusic;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.module.service.datamanager.MogoDataHandler;
|
||||
@@ -51,9 +52,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
IMogoOnMessageListener< MarkerResponse >,
|
||||
IMogoCardChangedListener {
|
||||
private static final String TAG = "MapMarkerManager";
|
||||
// 是否同步在线数据给在线卡片, ACC ON 的标记记录
|
||||
private boolean mIsAccOn = false;
|
||||
private boolean isSynchronousOnLineData = true;
|
||||
// 是否选中在线卡片及气泡,语音搜索触发
|
||||
private boolean mIsAISearchOnlineData = false;
|
||||
|
||||
@@ -70,6 +68,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 记录上次请求数据,切换卡片时做数据处理
|
||||
private MarkerCardResult mLastDataResult;
|
||||
|
||||
private boolean mIsMarkerClicked = false;
|
||||
|
||||
private MapMarkerManager() {
|
||||
}
|
||||
|
||||
@@ -97,22 +97,25 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
// ACC ON 的时候重置为true,ACC OFF 设置为 false
|
||||
// 保留 - 外部模块调用
|
||||
public void setCheckOnLineData( boolean checkOnLineData ) {
|
||||
mIsAccOn = checkOnLineData;
|
||||
public void setCheckOn( boolean checkOnLineData ) {
|
||||
Logger.e( TAG, "do not invoke anymore." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitched( int position, String moduleName ) {
|
||||
Logger.d( TAG, "当前C位卡片:" + moduleName );
|
||||
// highlightedMarker( moduleName, false );
|
||||
mCurrentModuleName = moduleName;
|
||||
if ( !mIsAccOn ) {
|
||||
mIsAccOn = true;
|
||||
Logger.d( TAG, "refresh data" );
|
||||
MogoServices.getInstance().refreshStrategy();
|
||||
if ( ( TextUtils.isEmpty( mCurrentModuleName )
|
||||
|| TextUtils.equals( mCurrentModuleName, ServiceConst.CARD_TYPE_BUSINESS_OPERATION ) )
|
||||
&& mIsMarkerClicked ) {
|
||||
mIsMarkerClicked = false;
|
||||
runOnTargetThread( () -> {
|
||||
// 在广告位(默认位置)点击marker造成卡片切换的,还是现实全部marker 【需求:os2.0.2-2.5-4】
|
||||
highlightedMarker( moduleName, false );
|
||||
mCurrentModuleName = moduleName;
|
||||
} );
|
||||
} else {
|
||||
runOnTargetThread( () -> {
|
||||
Logger.d( TAG, "switch data" );
|
||||
mCurrentModuleName = moduleName;
|
||||
MarkerServiceHandler.getMarkerManager().removeMarkers();
|
||||
drawMarkerByCurrentType( mLastDataResult );
|
||||
} );
|
||||
@@ -124,6 +127,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
mIsMarkerClicked = true;
|
||||
Logger.d( TAG, "onMarkerClicked 点击了大而全中的Marker:" + marker );
|
||||
try {
|
||||
if ( mLastCheckMarker != null ) {
|
||||
@@ -387,17 +391,17 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
drawAllMarker( markerCardResult );
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_NOVELTY:
|
||||
drawNoveltyMarker( noveltyInfoList );
|
||||
drawNoveltyMarker( noveltyInfoList, ServiceConst.MAX_AMOUNT_SINGLE_CARD );
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_CARS_CHATTING:
|
||||
case ServiceConst.CARD_TYPE_USER_DATA:
|
||||
drawOnlineCarMarkers( onlineCarList );
|
||||
drawOnlineCarMarkers( onlineCarList, ServiceConst.MAX_AMOUNT_SINGLE_CARD );
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
|
||||
drawRoadConditionMarker( exploreWayList );
|
||||
drawRoadConditionMarker( exploreWayList, ServiceConst.MAX_AMOUNT_SINGLE_CARD );
|
||||
break;
|
||||
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
|
||||
drawShareMusicMarker( shareMusicList );
|
||||
drawShareMusicMarker( shareMusicList, ServiceConst.MAX_AMOUNT_SINGLE_CARD );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -413,10 +417,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
List< MarkerShareMusic > shareMusicList = markerCardResult.getShareMusic();
|
||||
List< MarkerNoveltyInfo > noveltyInfoList = markerCardResult.getNoveltyInfo();
|
||||
|
||||
drawOnlineCarMarkers( onlineCarList );
|
||||
drawRoadConditionMarker( exploreWayList );
|
||||
drawShareMusicMarker( shareMusicList );
|
||||
drawNoveltyMarker( noveltyInfoList );
|
||||
drawOnlineCarMarkers( onlineCarList, ServiceConst.MAX_AMOUNT_ALL );
|
||||
drawRoadConditionMarker( exploreWayList, ServiceConst.MAX_AMOUNT_ALL );
|
||||
drawShareMusicMarker( shareMusicList, ServiceConst.MAX_AMOUNT_ALL );
|
||||
drawNoveltyMarker( noveltyInfoList, ServiceConst.MAX_AMOUNT_ALL );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,17 +428,18 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*
|
||||
* @param onlineCarList
|
||||
*/
|
||||
private void drawOnlineCarMarkers( List< MarkerOnlineCar > onlineCarList ) {
|
||||
private void drawOnlineCarMarkers( List< MarkerOnlineCar > onlineCarList, int maxAmount ) {
|
||||
// 将数据同步给在线车辆,避免每次 perform 的时候去拉取,造成消耗
|
||||
if ( onlineCarList == null || onlineCarList.isEmpty() ) {
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_USER_DATA, new ArrayList<>( ) );
|
||||
dispatchDataToBiz( ServiceConst.CARD_TYPE_USER_DATA, new ArrayList<>() );
|
||||
return;
|
||||
}
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_USER_DATA, onlineCarList );
|
||||
dispatchDataToBiz( ServiceConst.CARD_TYPE_USER_DATA, onlineCarList );
|
||||
double nearlyDistance = Float.MAX_VALUE;
|
||||
for ( MarkerOnlineCar markerOnlineCar : onlineCarList ) {
|
||||
int size = getAppropriateSize( maxAmount, onlineCarList );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
MarkerOnlineCar markerOnlineCar = onlineCarList.get( i );
|
||||
MarkerLocation markerLocation = markerOnlineCar.getLocation();
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj( markerOnlineCar );
|
||||
markerShowEntity.setMarkerLocation( markerLocation );
|
||||
@@ -479,16 +484,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
mIsAISearchOnlineData = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( mIsAccOn && isSynchronousOnLineData ) {
|
||||
isSynchronousOnLineData = false;
|
||||
if ( mNearlyMarker != null ) {
|
||||
Logger.d( TAG, "ACC ON 触发,将附近的在线车辆数据同步给卡片:" + mNearlyMarker );
|
||||
openMarker( mNearlyMarker );
|
||||
// 将数据同步给在线用户卡片
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_USER_DATA, mNearlyMarker );
|
||||
}
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -499,13 +494,15 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*
|
||||
* @param exploreWayList
|
||||
*/
|
||||
private void drawRoadConditionMarker( List< MarkerExploreWay > exploreWayList ) {
|
||||
private void drawRoadConditionMarker( List< MarkerExploreWay > exploreWayList, int maxAmount ) {
|
||||
// 将数据同步给探路,避免探路每次 perform 的时候去拉取,造成消耗
|
||||
MogoDataHandler.getInstance().invoke( ServiceConst.CARD_TYPE_ROAD_CONDITION, exploreWayList );
|
||||
dispatchDataToBiz( ServiceConst.CARD_TYPE_ROAD_CONDITION, exploreWayList );
|
||||
if ( exploreWayList == null || exploreWayList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
for ( MarkerExploreWay markerExploreWay : exploreWayList ) {
|
||||
int size = getAppropriateSize( maxAmount, exploreWayList );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
|
||||
if ( !markerExploreWay.getCanLive() ) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
|
||||
@@ -525,13 +522,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*
|
||||
* @param shareMusicList
|
||||
*/
|
||||
private void drawShareMusicMarker( List< MarkerShareMusic > shareMusicList ) {
|
||||
private void drawShareMusicMarker( List< MarkerShareMusic > shareMusicList, int maxAmount ) {
|
||||
if ( shareMusicList == null ) {
|
||||
return;
|
||||
}
|
||||
for ( MarkerShareMusic markerShareMusic : shareMusicList ) {
|
||||
int size = getAppropriateSize( maxAmount, shareMusicList );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
MarkerShareMusic markerShareMusic = shareMusicList.get( i );
|
||||
MarkerLocation markerLocation = markerShareMusic.getLocation();
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj( markerShareMusic );
|
||||
markerShowEntity.setMarkerLocation( markerLocation );
|
||||
@@ -548,11 +546,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*
|
||||
* @param noveltyInfoList
|
||||
*/
|
||||
private void drawNoveltyMarker( List< MarkerNoveltyInfo > noveltyInfoList ) {
|
||||
private void drawNoveltyMarker( List< MarkerNoveltyInfo > noveltyInfoList, int maxAmount ) {
|
||||
dispatchDataToBiz( ServiceConst.CARD_TYPE_NOVELTY, noveltyInfoList );
|
||||
if ( noveltyInfoList == null ) {
|
||||
return;
|
||||
}
|
||||
for ( MarkerNoveltyInfo noveltyInfo : noveltyInfoList ) {
|
||||
int size = getAppropriateSize( maxAmount, noveltyInfoList );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
MarkerNoveltyInfo noveltyInfo = noveltyInfoList.get( i );
|
||||
MarkerLocation markerLocation = noveltyInfo.getLocation();
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj( noveltyInfo );
|
||||
@@ -563,6 +564,18 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param maxAmount 展示的最大数量
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
private int getAppropriateSize( int maxAmount, List list ) {
|
||||
if ( list == null ) {
|
||||
return 0;
|
||||
}
|
||||
return Math.min( maxAmount, list.size() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统计地图内数据获取
|
||||
@@ -629,6 +642,24 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据分发
|
||||
*
|
||||
* @param biz
|
||||
* @param object
|
||||
*/
|
||||
private void dispatchDataToBiz( String biz, Object object ) {
|
||||
if ( TextUtils.isEmpty( biz ) ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Logger.d( TAG, "dispatch data to %s", biz );
|
||||
MogoDataHandler.getInstance().invoke( biz, object );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计埋点
|
||||
*/
|
||||
@@ -712,7 +743,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
private boolean ignoreDrawRequest() {
|
||||
return MarkerServiceHandler.getMogoStatusManager().isSearchUIShow()
|
||||
|| MarkerServiceHandler.getMogoStatusManager().isV2XShow();
|
||||
|| MarkerServiceHandler.getMogoStatusManager().isADASShow();
|
||||
}
|
||||
|
||||
private void runOnTargetThread( Runnable runnable ) {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.module.service.refresh;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-11
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class RefreshObject {
|
||||
|
||||
public final RefreshCallback mCallback;
|
||||
public final int mRadius;
|
||||
public final MogoLatLng mLonLat;
|
||||
public final int mAmount;
|
||||
|
||||
public RefreshObject( RefreshCallback callback, int radius, MogoLatLng lonLat, int amount ) {
|
||||
this.mCallback = callback;
|
||||
this.mRadius = radius;
|
||||
this.mLonLat = lonLat;
|
||||
this.mAmount = amount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user