切换地图的逻辑修改
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_shell_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
android:resizeableActivity="false"
|
||||
|
||||
@@ -156,8 +156,8 @@ 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.5",
|
||||
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
|
||||
adasapi : "com.zhidao.autopilot.support:adas:1.0.6.2",
|
||||
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.4",
|
||||
|
||||
// 个人中心的SDK
|
||||
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
|
||||
|
||||
@@ -19,11 +19,7 @@ class AMapViewHandler {
|
||||
private static IMogoMapView sMapView;
|
||||
|
||||
public static void createMapView( Context context ) {
|
||||
if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
|
||||
sMapView = new AMapNaviViewWrapper( new AMapNaviView( context ) );
|
||||
} else {
|
||||
sMapView = new AMapNaviViewWrapper( new AMapNaviView( context ) );
|
||||
}
|
||||
sMapView = new AMapNaviViewWrapper( new AMapNaviView( context ) );
|
||||
}
|
||||
|
||||
public static IMogoMapView getMapView() {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -28,7 +29,6 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
private static final String TAG = "LocationClient";
|
||||
private final Context mContext;
|
||||
|
||||
private Set< IMogoLocationListener > sListeners = new HashSet<>( 10 );
|
||||
private MogoLocation mLastLocation;
|
||||
private AMapLocationListener mListener = new InternalLocationListener();
|
||||
|
||||
@@ -76,28 +76,12 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
|
||||
@Override
|
||||
public void addLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.add( listener );
|
||||
}
|
||||
}
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.remove( listener );
|
||||
}
|
||||
}
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,10 +99,6 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
@Override
|
||||
public synchronized void destroy() {
|
||||
mIsDestroyed = true;
|
||||
if ( sListeners != null ) {
|
||||
sListeners.clear();
|
||||
}
|
||||
sListeners = null;
|
||||
if ( mClient != null ) {
|
||||
mClient.unRegisterLocationListener( mListener );
|
||||
mClient.stopLocation();
|
||||
@@ -142,8 +122,9 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
}
|
||||
Trace.beginSection( "timer.onLocationChanged" );
|
||||
mLastLocation = ObjectUtils.fromAMap( aMapLocation );
|
||||
synchronized ( sListeners ) {
|
||||
Iterator< IMogoLocationListener > listenerIterator = sListeners.iterator();
|
||||
Set<IMogoLocationListener> listeners = MogoLocationListenerRegister.getInstance().getListeners();
|
||||
synchronized ( listeners ) {
|
||||
Iterator< IMogoLocationListener > listenerIterator = listeners.iterator();
|
||||
while ( listenerIterator.hasNext() ) {
|
||||
listenerIterator.next().onLocationChanged( mLastLocation );
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
@@ -64,7 +65,6 @@ public class NaviClient implements IMogoNavi {
|
||||
private boolean mIsRealNavi;
|
||||
|
||||
private Location mCarLocation;
|
||||
private IMogoCarLocationChangedListener2 mCarLocationChangedListener;
|
||||
private LocationSource.OnLocationChangedListener mOnLocationChangedListener;
|
||||
/**
|
||||
* 巡航模式配置状态
|
||||
@@ -249,9 +249,7 @@ public class NaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
if ( mAMapNaviListener != null ) {
|
||||
mAMapNaviListener.setLineClickInteraction( lineClickInteraction );
|
||||
}
|
||||
// do not impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,15 +301,16 @@ public class NaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
mCarLocationChangedListener = listener;
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
public void syncCarLocation( Location location ) {
|
||||
mCarLocation = location;
|
||||
if ( mCarLocationChangedListener != null ) {
|
||||
mCarLocationChangedListener.onCarLocationChanged2( mCarLocation );
|
||||
mCarLocation = location;
|
||||
if ( MogoCarLocationChangedListenerRegister.getInstance().getListener() != null ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2( location );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,12 +267,6 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
if ( mNaviOverlayHelper != null ) {
|
||||
mNaviOverlayHelper.setLineClickInteraction( lineClickInteraction );
|
||||
}
|
||||
}
|
||||
|
||||
public void clearCalculatePaths() {
|
||||
if ( mNaviOverlayHelper != null ) {
|
||||
mNaviOverlayHelper.clearCalculatedOverlay();
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.mogo.map.impl.amap.R;
|
||||
import com.mogo.map.impl.amap.overlay.RouteOverLayWrapper;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoOperationListenerRegister;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -64,7 +65,6 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
|
||||
private int mSelectedPathId;
|
||||
private CalculatePathItem mSelectedCalculatePathItem;
|
||||
private OnCalculatePathItemClickInteraction mLineClickInteraction;
|
||||
|
||||
/**
|
||||
* 起点终点marker
|
||||
@@ -299,8 +299,8 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
if ( mPaths != null && !mPaths.isEmpty() ) {
|
||||
for ( MogoCalculatePath path : mPaths ) {
|
||||
if ( TextUtils.equals( path.getTagId(), polyline.getId() ) ) {
|
||||
if ( mLineClickInteraction != null ) {
|
||||
mLineClickInteraction.onItemClicked( path.getTagId() );
|
||||
if ( MogoOperationListenerRegister.getInstance().getItemClickInteraction() != null ) {
|
||||
MogoOperationListenerRegister.getInstance().getItemClickInteraction().onItemClicked( path.getTagId() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -440,10 +440,6 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
mLineClickInteraction = lineClickInteraction;
|
||||
}
|
||||
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( bounds != null ) {
|
||||
mBoundRect = bounds;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -195,7 +196,7 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
NaviClient.getInstance( mContext ).registerCarLocationChangedListener( listener );
|
||||
//do not impl
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,7 +55,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-online-9'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-online-12'
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -203,7 +203,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
@Override
|
||||
public void onResume() {
|
||||
if (mMapView != null) {
|
||||
// mMapView.onResume();
|
||||
mMapView.onResume();
|
||||
Logger.d(TAG, "map onResume");
|
||||
}
|
||||
}
|
||||
@@ -211,7 +211,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
@Override
|
||||
public void onPause() {
|
||||
if (mMapView != null) {
|
||||
// mMapView.onPause();
|
||||
mMapView.onPause();
|
||||
Logger.d(TAG, "map onPause");
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
@Override
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setTraffic(visible);
|
||||
//mMapView.getMapAutoViewHelper().setTraffic(visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.map.impl.custom;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.IMogoMapViewCreator;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
@@ -14,21 +15,22 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AMapBaseMapView implements IMogoMapViewCreator {
|
||||
public class CustomMapView implements IMogoMapViewCreator {
|
||||
|
||||
private static final String TAG = "AMapBaseMapView";
|
||||
|
||||
private MapAutoView mapAutoView;
|
||||
private static IMogoMapView mapView;
|
||||
|
||||
@Override
|
||||
public IMogoMapView create( Context context ) {
|
||||
MapAutoApi.INSTANCE.init( context, MapParams.Companion.init().setDebugMode( false )
|
||||
MapAutoApi.INSTANCE.init( context, MapParams.Companion.init().setDebugMode( DebugConfig.isDebug() )
|
||||
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
|
||||
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
|
||||
.setZoom( 16 )
|
||||
.setPointToCenter( 0.5f, 0.5f )
|
||||
.setStyleMode( MapParams.MAP_STYLE_NIGHT ) );
|
||||
mapAutoView = new MapAutoView( context );
|
||||
return new AMapViewWrapper( mapAutoView );
|
||||
MapAutoView mapAutoView = new MapAutoView( context );
|
||||
mapView = new AMapViewWrapper( mapAutoView );
|
||||
return mapView;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationClient;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationListener;
|
||||
@@ -27,7 +28,6 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
|
||||
private static final String TAG = "LocationClient";
|
||||
|
||||
private Set< IMogoLocationListener > sListeners = new HashSet<>( 10 );
|
||||
private MogoLocation mLastLocation;
|
||||
private LocationListener mListener = new InternalLocationListener();
|
||||
|
||||
@@ -79,28 +79,12 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
|
||||
@Override
|
||||
public void addLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.add( listener );
|
||||
}
|
||||
}
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
}
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.remove( listener );
|
||||
}
|
||||
}
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,10 +99,6 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
@Override
|
||||
public synchronized void destroy() {
|
||||
mIsDestroyed = true;
|
||||
if ( sListeners != null ) {
|
||||
sListeners.clear();
|
||||
}
|
||||
sListeners = null;
|
||||
if ( mClient != null ) {
|
||||
mClient.unRegisterListener( mListener );
|
||||
mClient.destory();
|
||||
@@ -130,7 +110,7 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
private class InternalLocationListener implements LocationListener {
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
public void onLocationChanged( @NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location ) {
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
@@ -140,10 +120,11 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
location.getLon() == 0.0D ) {
|
||||
return;
|
||||
}
|
||||
Trace.beginSection("timer.onLocationChanged");
|
||||
Trace.beginSection( "timer.onLocationChanged" );
|
||||
mLastLocation = ObjectUtils.fromLocation( location );
|
||||
synchronized ( sListeners ) {
|
||||
Iterator< IMogoLocationListener > listenerIterator = sListeners.iterator();
|
||||
Set< IMogoLocationListener > listeners = MogoLocationListenerRegister.getInstance().getListeners();
|
||||
synchronized ( listeners ) {
|
||||
Iterator< IMogoLocationListener > listenerIterator = listeners.iterator();
|
||||
while ( listenerIterator.hasNext() ) {
|
||||
listenerIterator.next().onLocationChanged( mLastLocation.clone() );
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
@@ -62,7 +63,6 @@ public class NaviClient implements IMogoNavi {
|
||||
private boolean mIsRealNavi;
|
||||
|
||||
private Location mCarLocation = new Location("GPS");
|
||||
private IMogoCarLocationChangedListener2 mCarLocationChangedListener;
|
||||
/**
|
||||
* 巡航模式配置状态
|
||||
*/
|
||||
@@ -217,9 +217,7 @@ public class NaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.setLineClickInteraction( lineClickInteraction );
|
||||
// }
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -268,15 +266,15 @@ public class NaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
mCarLocationChangedListener = listener;
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
public void syncCarLocation( Location location ) {
|
||||
mCarLocation = location;
|
||||
if ( mCarLocationChangedListener != null ) {
|
||||
mCarLocationChangedListener.onCarLocationChanged2( mCarLocation );
|
||||
if ( MogoCarLocationChangedListenerRegister.getInstance().getListener() != null ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2( location );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,10 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -22,7 +18,10 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
|
||||
private static final String TAG = "MogoBaseMapView";
|
||||
|
||||
private IMogoMapView mMapView;
|
||||
protected IMogoMapView mMapView;
|
||||
|
||||
protected IMogoMapView mAMapView;
|
||||
protected IMogoMapView mCustomMapView;
|
||||
|
||||
public MogoBaseMapView( Context context ) {
|
||||
this( context, null );
|
||||
@@ -38,27 +37,14 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
}
|
||||
|
||||
private void init( Context context ) {
|
||||
mMapView = createMapView( context );
|
||||
if ( mMapView != null ) {
|
||||
final View mapView = mMapView.getMapView();
|
||||
if ( mapView != null ) {
|
||||
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
||||
MogoMap.getInstance().init( context, getMap() );
|
||||
} else {
|
||||
Logger.e( TAG, "create MapView instance failed." );
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
}
|
||||
addDleMaps();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建地图实例
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected abstract IMogoMapView createMapView( Context context );
|
||||
protected abstract void addDleMaps();
|
||||
|
||||
public abstract void display2DMap( boolean invokeCreateAuto, boolean invokeResumeAuto );
|
||||
|
||||
public abstract void displayVRMap( boolean invokeCreateAuto, boolean invokeResumeAuto );
|
||||
|
||||
@Override
|
||||
public void onCreate( Bundle bundle ) {
|
||||
@@ -109,8 +95,4 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IMogoMapView getMapView() {
|
||||
return mMapView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package com.mogo.map.location;
|
||||
* <p>
|
||||
* 定位接口
|
||||
*/
|
||||
public interface IMogoLocationClient {
|
||||
public interface IMogoLocationClient extends IMogoLocationListenerRegister {
|
||||
|
||||
/**
|
||||
* 开始定位
|
||||
@@ -25,20 +25,6 @@ public interface IMogoLocationClient {
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* 注册定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void addLocationListener( IMogoLocationListener listener );
|
||||
|
||||
/**
|
||||
* 注销定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void removeLocationListener( IMogoLocationListener listener );
|
||||
|
||||
/**
|
||||
* 返回上一次有效定位
|
||||
*
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.map.location;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 地图监听注册管理
|
||||
*/
|
||||
public interface IMogoLocationListenerRegister {
|
||||
|
||||
/**
|
||||
* 注册定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void addLocationListener( IMogoLocationListener listener );
|
||||
|
||||
/**
|
||||
* 注销定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void removeLocationListener( IMogoLocationListener listener );
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.mogo.map.location;
|
||||
|
||||
import java.sql.ClientInfoStatus;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 地图监听注册管理
|
||||
*/
|
||||
public class MogoLocationListenerRegister implements IMogoLocationListenerRegister {
|
||||
|
||||
private static volatile MogoLocationListenerRegister sInstance;
|
||||
|
||||
private MogoLocationListenerRegister() {
|
||||
}
|
||||
|
||||
public static MogoLocationListenerRegister getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoLocationListenerRegister.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoLocationListenerRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private Set< IMogoLocationListener > sListeners = new HashSet<>( 10 );
|
||||
|
||||
/**
|
||||
* 注册定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void addLocationListener( IMogoLocationListener listener ) {
|
||||
if ( listener == null ) {
|
||||
return;
|
||||
}
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.add( listener );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销定位回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void removeLocationListener( IMogoLocationListener listener ) {
|
||||
if ( listener == null ) {
|
||||
return;
|
||||
}
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.remove( listener );
|
||||
}
|
||||
}
|
||||
|
||||
public Set< IMogoLocationListener > getListeners() {
|
||||
return sListeners;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface IMogoCarLocationChangedListenerRegister {
|
||||
|
||||
/**
|
||||
* 注册车辆位置变化监听,非业务使用
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener );
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* 导航操作
|
||||
*/
|
||||
public interface IMogoNavi {
|
||||
public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMogoOperationListenerRegister{
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
@@ -97,12 +97,6 @@ public interface IMogoNavi {
|
||||
*/
|
||||
OnCalculatePathItemClickInteraction getItemClickInteraction();
|
||||
|
||||
|
||||
/**
|
||||
* 设置线条点击回调
|
||||
*/
|
||||
void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction );
|
||||
|
||||
/**
|
||||
* 清除规划的路线
|
||||
*/
|
||||
@@ -151,13 +145,6 @@ public interface IMogoNavi {
|
||||
*/
|
||||
Location getCarLocation2();
|
||||
|
||||
/**
|
||||
* 注册车辆位置变化监听,非业务使用
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener );
|
||||
|
||||
/**
|
||||
* 打开巡航模式
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface IMogoOperationListenerRegister {
|
||||
|
||||
/**
|
||||
* 设置线条点击回调
|
||||
*/
|
||||
void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction );
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MogoCarLocationChangedListenerRegister implements IMogoCarLocationChangedListenerRegister {
|
||||
|
||||
private static volatile MogoCarLocationChangedListenerRegister sInstance;
|
||||
private IMogoCarLocationChangedListener2 listener;
|
||||
|
||||
private MogoCarLocationChangedListenerRegister(){}
|
||||
|
||||
public static MogoCarLocationChangedListenerRegister getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( MogoCarLocationChangedListenerRegister.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new MogoCarLocationChangedListenerRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册车辆位置变化监听,非业务使用
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public IMogoCarLocationChangedListener2 getListener() {
|
||||
return listener;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MogoOperationListenerRegister implements IMogoOperationListenerRegister {
|
||||
|
||||
private static volatile MogoOperationListenerRegister sInstance;
|
||||
private OnCalculatePathItemClickInteraction itemClickInteraction;
|
||||
|
||||
private MogoOperationListenerRegister(){}
|
||||
|
||||
public static MogoOperationListenerRegister getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( MogoOperationListenerRegister.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new MogoOperationListenerRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置线条点击回调
|
||||
*/
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
this.itemClickInteraction = itemClickInteraction;
|
||||
}
|
||||
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
return itemClickInteraction;
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,11 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.impl.amap.location.ALocationClient;
|
||||
import com.mogo.map.listener.MogoHosListenerRegister;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -56,16 +58,12 @@ public class MogoLocationClient implements IMogoLocationClient {
|
||||
|
||||
@Override
|
||||
public void addLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.addLocationListener( listener );
|
||||
}
|
||||
MogoLocationListenerRegister.getInstance().addLocationListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocationListener( IMogoLocationListener listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.removeLocationListener( listener );
|
||||
}
|
||||
MogoLocationListenerRegister.getInstance().removeLocationListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.impl.amap.AMapBaseMapView;
|
||||
import com.mogo.map.impl.amap.location.ALocationClient;
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.map.impl.amap.search.GeocodeSearchClient;
|
||||
@@ -66,25 +65,6 @@ class MogoMapDelegateFactory {
|
||||
return AMapUIController.getInstance();
|
||||
}
|
||||
|
||||
private static IMogoMapView sMapView;
|
||||
|
||||
public static void createMapView( Context context ) {
|
||||
if ( DebugConfig.isUseCustomMap() ) {
|
||||
Logger.d( TAG, "use custom IMogoMapViewCreator" );
|
||||
sMapView = new com.mogo.map.impl.custom.AMapBaseMapView().create( context );
|
||||
} else {
|
||||
sMapView = new AMapBaseMapView().create( context );
|
||||
}
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
sMapView = null;
|
||||
}
|
||||
|
||||
public static IMogoMapView getMapView() {
|
||||
return sMapView;
|
||||
}
|
||||
|
||||
public static IMogoNavi getNaviDelegate( Context context ) {
|
||||
|
||||
if ( DebugConfig.isUseCustomNavi() ) {
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -23,6 +24,8 @@ import java.util.List;
|
||||
* 描述
|
||||
*/
|
||||
public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
private static final String TAG = "MogoMapUIController";
|
||||
|
||||
private IMogoMapUIController mDelegate;
|
||||
|
||||
@@ -43,6 +46,10 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void setDelegate( IMogoMapUIController mDelegate ) {
|
||||
this.mDelegate = mDelegate;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
@@ -73,6 +80,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
@Override
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
if (mDelegate != null) {
|
||||
Logger.d( TAG, "set type: %s", mode.name() );
|
||||
mDelegate.changeMapMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,15 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.map.impl.amap.AMapBaseMapView;
|
||||
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
|
||||
import com.mogo.map.impl.custom.CustomMapView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -30,15 +36,63 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
super( context, attrs, defStyleAttr );
|
||||
}
|
||||
|
||||
private boolean mIsFirstDisplayVRMode = true;
|
||||
|
||||
@Override
|
||||
public IMogoMap getMap() {
|
||||
return super.getMap();
|
||||
protected void addDleMaps() {
|
||||
mAMapView = new AMapBaseMapView().create( getContext() );
|
||||
mCustomMapView = new CustomMapView().create( getContext() );
|
||||
|
||||
if ( mAMapView != null ) {
|
||||
final View mapView = mAMapView.getMapView();
|
||||
if ( mapView != null ) {
|
||||
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
||||
} else {
|
||||
Logger.e( TAG, "create MapView instance failed." );
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
}
|
||||
|
||||
// if ( mCustomMapView != null ) {
|
||||
// final View mapView = mCustomMapView.getMapView();
|
||||
// if ( mapView != null ) {
|
||||
// addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
||||
// } else {
|
||||
// Logger.e( TAG, "create MapView instance failed." );
|
||||
// }
|
||||
// } else {
|
||||
// Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
// }
|
||||
|
||||
mMapView = mAMapView;
|
||||
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMogoMapView createMapView( Context context ) {
|
||||
MogoMapDelegateFactory.createMapView( context );
|
||||
return MogoMapDelegateFactory.getMapView();
|
||||
public void display2DMap( boolean invokeCreateAuto, boolean invokeResumeAuto ) {
|
||||
MogoMap.getInstance().init( getContext(), mAMapView.getMap() );
|
||||
MogoMapUIController.getInstance().setDelegate( AMapUIController.getInstance() );
|
||||
MogoMarkerManager.getInstance( getContext() ).removeMarkers();
|
||||
mCustomMapView.onPause();
|
||||
mCustomMapView.getMapView().setVisibility( View.GONE );
|
||||
mAMapView.onResume();
|
||||
mAMapView.getMapView().setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayVRMap( boolean invokeCreateAuto, boolean invokeResumeAuto ) {
|
||||
if ( mIsFirstDisplayVRMode ) {
|
||||
mCustomMapView.onCreate( null );
|
||||
mIsFirstDisplayVRMode = false;
|
||||
}
|
||||
MogoMap.getInstance().init( getContext(), mCustomMapView.getMap() );
|
||||
MogoMapUIController.getInstance().setDelegate( com.mogo.map.impl.custom.uicontroller.AMapUIController.getInstance() );
|
||||
MogoMarkerManager.getInstance( getContext() ).removeMarkers();
|
||||
mCustomMapView.onResume();
|
||||
mCustomMapView.getMapView().setVisibility( View.VISIBLE );
|
||||
mAMapView.onPause();
|
||||
mAMapView.getMapView().setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,14 +111,12 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
Logger.d( TAG, "onPause" );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Logger.d( TAG, "onDestroy" );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,9 +128,4 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapView getMapView() {
|
||||
return super.getMapView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ import com.mogo.map.impl.automap.navi.AutoNaviClient;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoOperationListenerRegister;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.AppUtils;
|
||||
|
||||
@@ -132,9 +134,7 @@ public class MogoNavi implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setLineClickInteraction( itemClickInteraction );
|
||||
}
|
||||
MogoOperationListenerRegister.getInstance().setLineClickInteraction( itemClickInteraction );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,9 +193,7 @@ public class MogoNavi implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.registerCarLocationChangedListener( listener );
|
||||
}
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -157,8 +157,14 @@ public class EventDispatchCenter implements
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
private boolean mIsMapLoaded = false;
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if ( mIsMapLoaded ) {
|
||||
return;
|
||||
}
|
||||
mIsMapLoaded = true;
|
||||
if ( mMapLoadedCallback != null ) {
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -12,7 +13,9 @@ 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.MogoApisHandler;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
@@ -24,7 +27,7 @@ import com.mogo.utils.logger.Logger;
|
||||
* <p>
|
||||
* 地图图层,地图操作都在这个图层完成
|
||||
*/
|
||||
public class MapFragment extends MvpFragment< MapView, MapPresenter > implements MapView {
|
||||
public class MapFragment extends MvpFragment< MapView, MapPresenter > implements MapView, IMogoMapFrameController {
|
||||
|
||||
private static final String TAG = "MapFragment";
|
||||
|
||||
@@ -33,6 +36,8 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
|
||||
private boolean mIsControllerByOthersStatus = false;
|
||||
|
||||
private boolean mIsFirstLoadCustomMap = true;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_map_fragment_map;
|
||||
@@ -40,6 +45,30 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().initDelegate( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDelegate( IMogoMapFrameController controller ) {
|
||||
// do not implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeTo2dMode() {
|
||||
mMogoMapView.display2DMap( false, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
mMogoMapView.displayVRMap( mIsFirstLoadCustomMap, true );
|
||||
if ( mIsFirstLoadCustomMap ) {
|
||||
mIsFirstLoadCustomMap = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
// do not implement
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,8 +77,10 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
mMogoMapView = findViewById( R.id.module_map_id_map );
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
mMogoMap.getUIController().showMyLocation( true );
|
||||
mMogoMap.getUIController().recoverLockMode();// 启动锁车
|
||||
if ( mMogoMap.getUIController() != null ) {
|
||||
mMogoMap.getUIController().showMyLocation( true );
|
||||
mMogoMap.getUIController().recoverLockMode();// 启动锁车
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -129,11 +160,18 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
uiSettings.setZoomControlsEnabled( false );
|
||||
//设置双指缩放手势是否可用。
|
||||
uiSettings.setZoomGesturesEnabled( true );
|
||||
mMogoMap.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
if ( mMogoMap.getUIController() != null ) {
|
||||
mMogoMap.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
return mMogoMap.getUIController();
|
||||
@@ -146,5 +184,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
mMogoMapView.onDestroy();
|
||||
}
|
||||
MapBroadCastHelper.getInstance( getContext() ).release();
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.gson.internal.$Gson$Preconditions;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
|
||||
@Route( path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER )
|
||||
class MapFrameController implements IMogoMapFrameController {
|
||||
|
||||
private IMogoMapFrameController mController;
|
||||
|
||||
@Override
|
||||
public void initDelegate( IMogoMapFrameController controller ) {
|
||||
mController = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeTo2dMode() {
|
||||
if ( mController != null ) {
|
||||
mController.changeTo2dMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
if ( mController != null ) {
|
||||
mController.changeToVRMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mController = null;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.service.autopilot;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -22,21 +23,21 @@ class AutoPilotRemoteController {
|
||||
|
||||
private IMogoSocketManager mMogoSocketManager;
|
||||
|
||||
private IMogoOnMessageListener< AutoPilotParameters > mParametersListener = new IMogoOnMessageListener< AutoPilotParameters >() {
|
||||
private IMogoOnMessageListener< RemoteControlAutoPilotParameters > mParametersListener = new IMogoOnMessageListener< RemoteControlAutoPilotParameters >() {
|
||||
@Override
|
||||
public Class< AutoPilotParameters > target() {
|
||||
return AutoPilotParameters.class;
|
||||
public Class< RemoteControlAutoPilotParameters > target() {
|
||||
return RemoteControlAutoPilotParameters.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived( AutoPilotParameters obj ) {
|
||||
public void onMsgReceived( RemoteControlAutoPilotParameters obj ) {
|
||||
if ( obj == null ) {
|
||||
Logger.e( TAG, "远端控制参数为null", new NullPointerException() );
|
||||
return;
|
||||
}
|
||||
String json = GsonUtil.jsonFromObject( obj );
|
||||
Logger.d( TAG, json );
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData( json );
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData( obj );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeResult;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.MogoServiceProvider;
|
||||
@@ -357,6 +358,14 @@ public class MockIntentHandler implements IntentHandler {
|
||||
case 33:
|
||||
AIAssist.getInstance( context ).speakTTSVoice( "庞帆说这个是一个 hard coding." );
|
||||
break;
|
||||
case 34:
|
||||
int type = intent.getIntExtra( "type", 0 );
|
||||
if ( type != 0 ) {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeToVRMode();
|
||||
} else {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeTo2dMode();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.launcher.IMogoLauncher;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
@@ -239,42 +240,57 @@ public interface IMogoServiceApis extends IProvider {
|
||||
|
||||
/**
|
||||
* 获取授权服务
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoAuthManager getAuthManagerApi();
|
||||
|
||||
/**
|
||||
* 获取探路服务
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoTanluProvider getTanluApi();
|
||||
|
||||
/**
|
||||
* 获取Monitor相关api
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoMonitorProvider getMogoMonitorApi();
|
||||
|
||||
/**
|
||||
* 获取探路ui服务
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoTanluUiProvider getTanluUiApi();
|
||||
|
||||
/**
|
||||
* 皮肤管理接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoSkinSupportInstaller getSkinSupportInstallerApi();
|
||||
|
||||
/**
|
||||
* 获取crashWarnProvider
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoCrashWarnProvider getCrashWarnProvider();
|
||||
|
||||
/**
|
||||
* 在线车辆面板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoOnlineCarListPanelProvider getOnlineCarPanelApi();
|
||||
|
||||
/**
|
||||
* 地图图层控制接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoMapFrameController getMapFrameControllerApi();
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class MogoServicePaths {
|
||||
* 授权服务
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_AGREEMENT = "/agreement/showFragment";
|
||||
public static final String PATH_AGREEMENT = "/agreement/showFragment";
|
||||
|
||||
/**
|
||||
* 日志上传
|
||||
@@ -266,4 +266,9 @@ public class MogoServicePaths {
|
||||
* 在线好友面板
|
||||
*/
|
||||
public static final String PATH_ONLINE_CAR_PANEL = "/onlinecar/panel";
|
||||
|
||||
/**
|
||||
* 自研地图和高德地图切换
|
||||
*/
|
||||
public static final String PATH_MAP_FRAME_CONTROLLER = "/mapframe/controller";
|
||||
}
|
||||
|
||||
@@ -72,7 +72,20 @@ public interface IMogoADASController extends IProvider {
|
||||
/**
|
||||
* 给adas传递数据
|
||||
*
|
||||
* @param json
|
||||
* @param result
|
||||
*/
|
||||
void aiCloudToAdasData( String json );
|
||||
void aiCloudToAdasData( RemoteControlAutoPilotParameters result );
|
||||
|
||||
|
||||
/**
|
||||
* 添加adas数据回调接口
|
||||
* @param callback 回调接口
|
||||
*/
|
||||
void addAdasDataCallback(IMogoAdasDataCallback callback);
|
||||
|
||||
/**
|
||||
* 移除adas数据回调接口
|
||||
* @param callback 待移除的callback
|
||||
*/
|
||||
void removeAdasDataCallback(IMogoAdasDataCallback callback);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
/**
|
||||
* adas 数据回调接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoAdasDataCallback {
|
||||
/**
|
||||
* adas 数据回调
|
||||
* @param msg 具体数据
|
||||
*/
|
||||
void onAdasDataCallback(String msg);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
/**
|
||||
* adas 物体识别数据回调接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoAdasRecognizedDataCallback {
|
||||
/**
|
||||
* adas 数据回调
|
||||
* @param msg 具体数据
|
||||
*/
|
||||
void onAdasDataCallback( String msg );
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.service.autopilot;
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,7 +9,7 @@ public
|
||||
*
|
||||
* 自动驾驶参数
|
||||
*/
|
||||
class AutoPilotParameters {
|
||||
class RemoteControlAutoPilotParameters {
|
||||
|
||||
public AutoPilotLonLat startLatLon;
|
||||
public List< AutoPilotLonLat > wayLatLons;
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.service.map;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.IDestroyable;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 地图图层切换:高德地图 <-> 自研地图,过渡期使用
|
||||
*/
|
||||
interface IMogoMapFrameController extends IProvider, IDestroyable {
|
||||
|
||||
void initDelegate( IMogoMapFrameController controller );
|
||||
|
||||
/**
|
||||
* 切换到高德2D
|
||||
*/
|
||||
void changeTo2dMode();
|
||||
|
||||
/**
|
||||
* 切换到自研vr
|
||||
*/
|
||||
void changeToVRMode();
|
||||
}
|
||||
@@ -42,6 +42,7 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.adasapi
|
||||
implementation rootProject.ext.dependencies.adasconfigapi
|
||||
implementation "com.zhidao.support.adas:high:1.1.4.4"
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.launcher.IMogoLauncher;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
@@ -210,32 +211,37 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
|
||||
@Override
|
||||
public IMogoTanluProvider getTanluApi() {
|
||||
return getApiInstance(IMogoTanluProvider.class, MogoServicePaths.PATH_TANLU_API);
|
||||
return getApiInstance( IMogoTanluProvider.class, MogoServicePaths.PATH_TANLU_API );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMonitorProvider getMogoMonitorApi() {
|
||||
return getApiInstance(IMogoMonitorProvider.class,MogoServicePaths.PATH_MOGO_MONITOR);
|
||||
return getApiInstance( IMogoMonitorProvider.class, MogoServicePaths.PATH_MOGO_MONITOR );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTanluUiProvider getTanluUiApi(){
|
||||
return getApiInstance(IMogoTanluUiProvider.class, MogoServicePaths.PATH_TANLU_UI_API);
|
||||
public IMogoTanluUiProvider getTanluUiApi() {
|
||||
return getApiInstance( IMogoTanluUiProvider.class, MogoServicePaths.PATH_TANLU_UI_API );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoSkinSupportInstaller getSkinSupportInstallerApi() {
|
||||
return getApiInstance( IMogoSkinSupportInstaller.class, SkinSupportInstallerConstants.PATH);
|
||||
return getApiInstance( IMogoSkinSupportInstaller.class, SkinSupportInstallerConstants.PATH );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoCrashWarnProvider getCrashWarnProvider() {
|
||||
return getApiInstance(IMogoCrashWarnProvider.class, MogoServicePaths.PATH_CRASH_WARNING);
|
||||
return getApiInstance( IMogoCrashWarnProvider.class, MogoServicePaths.PATH_CRASH_WARNING );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoOnlineCarListPanelProvider getOnlineCarPanelApi() {
|
||||
return getApiInstance( IMogoOnlineCarListPanelProvider.class, MogoServicePaths.PATH_ONLINE_CAR_PANEL);
|
||||
return getApiInstance( IMogoOnlineCarListPanelProvider.class, MogoServicePaths.PATH_ONLINE_CAR_PANEL );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapFrameController getMapFrameControllerApi() {
|
||||
return getApiInstance( IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER );
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance( Class< T > clazz, String path ) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class AdasControlCommandParameter {
|
||||
|
||||
public String action;
|
||||
public Object result;
|
||||
|
||||
public AdasControlCommandParameter( String action, Object result ) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
@@ -13,10 +12,13 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
||||
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.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.zhidao.adasconfig.api.AdasConfigApiController;
|
||||
import com.zhidao.adasconfig.common.config.EnumCarChatIncognitoMode;
|
||||
@@ -24,9 +26,16 @@ import com.zhidao.adasconfig.common.config.EnumCarHeading;
|
||||
import com.zhidao.adasconfig.common.config.EnumSkinStyle;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
import com.zhidao.autopilot.support.api.IAutopilotServiceStatusListener;
|
||||
import com.zhidao.autopilot.support.api.IAutopolitDataCallBack;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.msg.MyMessageFactory;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.common.utils.SPConst.getSpGuide;
|
||||
@@ -56,6 +65,50 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
private boolean mIsReleased = true;
|
||||
|
||||
private List< IMogoAdasDataCallback > mAdasDataCallbackList = new ArrayList<>();
|
||||
|
||||
private OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
|
||||
@Override
|
||||
public void onRectData( RectInfo rectInfo ) {
|
||||
// 物体识别返回
|
||||
Logger.d( TAG, "onRectData = %s", rectInfo.toString() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarnMessage( WarnMessageInfo warnMessageInfo ) {
|
||||
// 警告消息
|
||||
Logger.d( TAG, "onWarnMessage = %s", warnMessageInfo.toString() );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private MyMessageFactory mAdasMessageFactory;
|
||||
private IAutopolitDataCallBack mAutoPilotDataCallBack = new IAutopolitDataCallBack() {
|
||||
@Override
|
||||
public void sendMsg( String msg ) {
|
||||
Logger.d( TAG, "收到adas数据回调: " + msg );
|
||||
for ( IMogoAdasDataCallback callback : mAdasDataCallbackList ) {
|
||||
callback.onAdasDataCallback( msg );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cameraEyeDetectResult( String detectResult ) {
|
||||
try {
|
||||
JSONObject jsonObjectWs = new JSONObject( detectResult );
|
||||
String action = jsonObjectWs.optString( "action" );
|
||||
if ( TextUtils.isEmpty( action ) ) {
|
||||
Logger.w( TAG, "--->action is null" );
|
||||
return;
|
||||
}
|
||||
mAdasMessageFactory.createMessage( action ).handlerMsg( GsonUtil.getGson(), mOnAdasListener, detectResult );
|
||||
} catch ( JSONException e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void openADAS() {
|
||||
showADAS();
|
||||
@@ -89,7 +142,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
} );
|
||||
invokeShowADASOperation();
|
||||
|
||||
AutopilotServiceManage.getInstance().registerAutopilotDataListener( mAutoPilotDataCallBack );
|
||||
}
|
||||
|
||||
private void invokeShowADASOperation() {
|
||||
@@ -157,6 +210,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void init( Context context ) {
|
||||
AutopilotServiceManage.getInstance().init( context );
|
||||
mIsReleased = false;
|
||||
mAdasMessageFactory = new MyMessageFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -212,25 +266,23 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void aiCloudToAdasData( String json ) {
|
||||
public void aiCloudToAdasData( RemoteControlAutoPilotParameters result ) {
|
||||
try {
|
||||
syncControlCmdToADAS( "aiCloudToStartAutopilot", json );
|
||||
syncControlCmdToADAS( "aiCloudToStartAutopilot", result );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "notifyAdas" );
|
||||
Logger.e( TAG, e, "aiCloudToAdasData" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param action 操作执行
|
||||
* @param json 指令数据
|
||||
* @param action
|
||||
* @param result
|
||||
*/
|
||||
private void syncControlCmdToADAS( String action, String json ) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
private void syncControlCmdToADAS( String action, Object result ) {
|
||||
AdasControlCommandParameter parameter = new AdasControlCommandParameter( action, result );
|
||||
//位置信息 action是aiCloudToStartAutopilot
|
||||
try {
|
||||
jsonObject.put( "action", action );
|
||||
jsonObject.put( "result", json );
|
||||
AutopilotServiceManage.getInstance().aiCloudToAdasData( jsonObject.toString() );
|
||||
AutopilotServiceManage.getInstance().aiCloudToAdasData( GsonUtil.jsonFromObject( parameter ) );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -239,6 +291,17 @@ public class MogoADASController implements IMogoADASController {
|
||||
@Override
|
||||
public void release() {
|
||||
mIsReleased = true;
|
||||
AutopilotServiceManage.getInstance().unRegisterAutopilotDataListener( mAutoPilotDataCallBack );
|
||||
AutopilotServiceManage.getInstance().release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdasDataCallback( IMogoAdasDataCallback callback ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAdasDataCallback( IMogoAdasDataCallback callback ) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.CarLaneInfo;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.LightStatueInfo;
|
||||
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
abstract class OnAdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
@Override
|
||||
public void onWarnMessage( WarnMessageInfo warnMessageInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSize( int width, int height ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRectData( RectInfo rectInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStateData( CarStateInfo carStateInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightStateData( LightStatueInfo lightStatueInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObstaclesInfo( ObstaclesInfo obstaclesInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLaneInfo( CarLaneInfo carLaneInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus( AutopilotStatus autopilotStatus ) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user