[Upload]
删除冗余代码 MoGoEagleEye.modules.mogo-module-map MoGoEagleEye.modules.mogo-module-service MoGoEagleEye.modules.mogo-module-share MoGoEagleEye.services.mogo-service-api Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @since 2020-11-05
|
||||
* <p>
|
||||
* 巡航代理
|
||||
*/
|
||||
public class MogoAimless implements IMogoAimless {
|
||||
|
||||
private IMogoAimless mDelegate;
|
||||
|
||||
private static volatile MogoAimless sInstance;
|
||||
|
||||
private MogoAimless( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getAimless( context );
|
||||
}
|
||||
|
||||
public static MogoAimless getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoAimless.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoAimless( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,7 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
import com.mogo.map.impl.automap.navi.AutoNaviClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
@@ -51,24 +46,10 @@ class MogoMapDelegateFactory {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
public static IMogoNavi getNaviDelegate(Context context) {
|
||||
|
||||
if (DebugConfig.isUseCustomNavi()) {
|
||||
return getApiBuilder().getNavi(context);
|
||||
} else if (AppUtils.isAppInstalled(context, "com.autonavi.amapauto")) {
|
||||
return AutoNaviClient.getInstance(context);
|
||||
}
|
||||
return getApiBuilder().getNavi(context);
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate(Context context, MogoPoiSearchQuery query) {
|
||||
return getApiBuilder().getPoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
public static IMogoAimless getAimless(Context context) {
|
||||
return getApiBuilder().getAimless(context);
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航代理
|
||||
*/
|
||||
public class MogoNavi implements IMogoNavi {
|
||||
|
||||
private IMogoNavi mDelegate;
|
||||
|
||||
private static volatile MogoNavi sInstance;
|
||||
|
||||
private MogoNavi( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getNaviDelegate( context );
|
||||
}
|
||||
|
||||
public static MogoNavi getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoNavi.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoNavi( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.reCalculateRoute( config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startNavi( isRealNavi );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.isNaviing();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedStrategies();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedPathPos();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getItemClickInteraction();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
MogoOperationListenerRegister.getInstance().setLineClickInteraction( itemClickInteraction );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.clearCalculatePaths();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setCalculatePathDisplayBounds( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviConfig();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.setBroadcastMode( mode );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviPathCoordinates();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation2();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setUseExtraGPSData( use );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user