diff --git a/libraries/map-amap/.gitignore b/libraries/map-amap/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/libraries/map-amap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/libraries/map-amap/build.gradle b/libraries/map-amap/build.gradle deleted file mode 100644 index e1ab5e71fa..0000000000 --- a/libraries/map-amap/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - // buildToolsVersion rootProject.ext.android.buildToolsVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - javaCompileOptions { - annotationProcessorOptions { - arguments = [AROUTER_MODULE_NAME: project.getName()] - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } - - lintOptions { - abortOnError false - } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - implementation rootProject.ext.dependencies.androidxappcompat - api rootProject.ext.dependencies.amapnavi3dmap - api rootProject.ext.dependencies.amapsearch - api rootProject.ext.dependencies.amaplocation - - implementation rootProject.ext.dependencies.arouter - annotationProcessor rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogomapapi - implementation rootProject.ext.dependencies.mogocommons - } else { - implementation project(':foudations:mogo-utils') - implementation project(':libraries:mogo-map-api') - implementation project(':foudations:mogo-commons') - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/libraries/map-amap/consumer-rules.pro b/libraries/map-amap/consumer-rules.pro deleted file mode 100644 index cffccde5a0..0000000000 --- a/libraries/map-amap/consumer-rules.pro +++ /dev/null @@ -1,10 +0,0 @@ -#-----library-MapAMap----- --keep class com.mogo.map.impl.amap.hook.BnHooker{*;} --keep class com.mogo.map.impl.amap.marker.CombineMovingPointOverlay.Status{*;} --keep class com.mogo.map.impl.amap.navi.PathPlanningErrorCodeConstants{*;} --keep class com.mogo.map.impl.amap.overlay.RouteOverLayWrapper{ - private hookRouteArrow(); -} --keep class com.mogo.map.impl.amap.utils.MapStyleUtils.ColorEnum{*;} --keep class com.mogo.map.impl.amap.AMapUiSettingsWrapper{*;} --keep class com.mogo.map.impl.amap.AMapViewWrapper{*;} \ No newline at end of file diff --git a/libraries/map-amap/gradle.properties b/libraries/map-amap/gradle.properties deleted file mode 100644 index bc8dabb558..0000000000 --- a/libraries/map-amap/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.map -POM_ARTIFACT_ID=map-amap -VERSION_CODE=1 \ No newline at end of file diff --git a/libraries/map-amap/proguard-rules.pro b/libraries/map-amap/proguard-rules.pro deleted file mode 100644 index 7959227525..0000000000 --- a/libraries/map-amap/proguard-rules.pro +++ /dev/null @@ -1,27 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -#-----library-MapAMap----- --keep class com.mogo.map.impl.amap.hook.BnHooker.*{*;} --keep class com.mogo.map.impl.amap.marker.CombineMovingPointOverlay.Status --keep class com.mogo.map.impl.amap.navi.PathPlanningErrorCodeConstants --keep class com.mogo.map.impl.amap.utils.MapStyleUtils.ColorEnum \ No newline at end of file diff --git a/libraries/map-amap/src/main/AndroidManifest.xml b/libraries/map-amap/src/main/AndroidManifest.xml deleted file mode 100644 index 170516de73..0000000000 --- a/libraries/map-amap/src/main/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapApiBuilder.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapApiBuilder.java deleted file mode 100644 index 74f76fc727..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapApiBuilder.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; -import android.view.ViewGroup; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.map.CoordinatesTransformer; -import com.mogo.map.IMogoMapApiBuilder; -import com.mogo.map.IMogoMapView; -import com.mogo.map.MapApiPath; -import com.mogo.map.impl.amap.location.ALocationClient; -import com.mogo.map.impl.amap.navi.AimlessClient; -import com.mogo.map.impl.amap.navi.NaviClient; -import com.mogo.map.impl.amap.search.GeocodeSearchClient; -import com.mogo.map.impl.amap.search.InputtipsSearch; -import com.mogo.map.impl.amap.search.PoiSearchClient; -import com.mogo.map.impl.amap.search.RoadSearchClient; -import com.mogo.map.impl.amap.search.TrafficSearchClient; -import com.mogo.map.impl.amap.uicontroller.AMapUIController; -import com.mogo.map.impl.amap.utils.IconTypeUtils; -import com.mogo.map.location.IMogoLocationClient; -import com.mogo.map.navi.IMogoAimless; -import com.mogo.map.navi.IMogoNavi; -import com.mogo.map.search.drive.IMogoRoadSearch; -import com.mogo.map.search.geo.IMogoGeoSearch; -import com.mogo.map.search.inputtips.IMogoInputtipsSearch; -import com.mogo.map.search.inputtips.query.MogoInputtipsQuery; -import com.mogo.map.search.poisearch.IMogoPoiSearch; -import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery; -import com.mogo.map.search.traffic.IMogoTrafficSearch; -import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.utils.logger.Logger; - -public -/** - * @author congtaowang - * @since 2020/12/9 - * - * 描述 - */ -@Route( path = MapApiPath.PATH ) -class AMapApiBuilder implements IMogoMapApiBuilder { - - private static final String TAG = "AMapApiBuilder"; - - @Override - public IMogoGeoSearch getGeoSearch( Context context ) { - return new GeocodeSearchClient( context ); - } - - @Override - public IMogoInputtipsSearch getInputtipsSearch( Context context, MogoInputtipsQuery query ) { - return new InputtipsSearch( context, query ); - } - - @Override - public IMogoLocationClient getLocationClient( Context context ) { - return new ALocationClient( context ); - } - - @Override - public IMogoMapUIController getMapUIController() { - return AMapUIController.getInstance(); - } - - @Override - public IMogoNavi getNavi( Context context ) { - return NaviClient.getInstance( context ); - } - - @Override - public IMogoPoiSearch getPoiSearchClient( Context context, MogoPoiSearchQuery query ) { - return new PoiSearchClient( context, query ); - } - - @Override - public IMogoRoadSearch getRoadSearch() { - return new RoadSearchClient(); - } - - @Override - public IMogoAimless getAimless( Context context ) { - return AimlessClient.getInstance( context ); - } - - @Override - public void createMapView( Context context ) { - AMapViewHandler.createMapView( context ); - } - - @Override - public void destroy() { - AMapViewHandler.destroy(); - } - - @Override - public IMogoMapView getMapView( Context context ) { -// Logger.e("lianglihui","AMapApiBuilder getMapView"); - IMogoMapView mapView = AMapViewHandler.getMapView(); - if ( mapView != null - && mapView.getMapView() != null - && mapView.getMapView().getParent() != null ) { - ViewGroup group = ( ViewGroup ) mapView.getMapView().getParent(); - group.removeView( mapView.getMapView() ); - } - return mapView; - } - - @Override - public IMogoTrafficSearch getTrafficSearch() { - return new TrafficSearchClient(); - } - - @Override - public int getResIdByIconType( Context context, int iconType ) { - return IconTypeUtils.getResIdByIconType( context, iconType ); - } - - @Override - public CoordinatesTransformer getCoordinatesTransformer() { - return AMapCoordinatesTransformer.getInstance(); - } - - @Override - public void init( Context context ) { - Logger.d( TAG, "init." ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapBaseMapView.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapBaseMapView.java deleted file mode 100644 index acbf86f00d..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapBaseMapView.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; -import android.view.ViewGroup; - -import com.mogo.map.IMogoMapView; -import com.mogo.map.IMogoMapViewCreator; - -/** - * @author congtaowang - * @since 2019-12-25 - *

- * 描述 - */ -public class AMapBaseMapView implements IMogoMapViewCreator { - - private static final String TAG = "AMapBaseMapView"; - - @Override - public IMogoMapView create( Context context ) { - IMogoMapView mapView = AMapViewHandler.getMapView(); - if ( mapView != null - && mapView.getMapView() != null - && mapView.getMapView().getParent() != null ) { - ViewGroup group = ( ViewGroup ) mapView.getMapView().getParent(); - group.removeView( mapView.getMapView() ); - } - return mapView; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapCoordinatesTransformer.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapCoordinatesTransformer.java deleted file mode 100644 index 5e08f60ae1..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapCoordinatesTransformer.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.mogo.map.impl.amap; - -import com.mogo.map.CoordinatesTransformer; - -public -/** - * @author congtaowang - * @since 2020/12/17 - * - * 描述 - */ -class AMapCoordinatesTransformer implements CoordinatesTransformer { - - private AMapCoordinatesTransformer() { - // private constructor - } - - private static final class InstanceHolder { - private static final AMapCoordinatesTransformer INSTANCE = new AMapCoordinatesTransformer(); - } - - public static AMapCoordinatesTransformer getInstance() { - return InstanceHolder.INSTANCE; - } - - private Object readResolve() { - // 阻止反序列化,必须实现 Serializable 接口 - return InstanceHolder.INSTANCE; - } - - @Override - public double[] transform( double lat, double lon ) { - double[] coor = new double[2]; - coor[0] = lat; - coor[1] = lon; - return coor; -// return new double[]{lat, lon}; -// return CoordinateUtils.transformGcj02toWgs84( lat, lon ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapMarkerClickHandler.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapMarkerClickHandler.java deleted file mode 100644 index 12ba116c43..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapMarkerClickHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.mogo.map.impl.amap; - -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 - * @since 2019-12-24 - *

- * marker 点击事件处理 - */ -public class AMapMarkerClickHandler { - - public boolean handleMarkerClicked( Marker marker ) { - if ( marker == null ) { - return false; - } - if ( marker.getObject() instanceof IMogoMarker ) { - IMogoMarker mogoMarker = ( ( IMogoMarker ) marker.getObject() ); - final IMogoMarkerClickListener listener = mogoMarker.getOnMarkerClickListener(); - Logger.d( "AMapMarkerWrapper", "marker 点击回调:%s -> %s", mogoMarker, marker ); - if ( listener != null ) { - boolean result = listener.onMarkerClicked( mogoMarker ); - if ( result ) { - return true; - } - } - return MogoMarkersHandler.getInstance().onMarkerClicked( mogoMarker ); - } - return false; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java deleted file mode 100644 index 42bd0084dd..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java +++ /dev/null @@ -1,1063 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; -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; -import android.view.MotionEvent; -import android.view.View; -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.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.CameraPosition; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MyLocationStyle; -import com.amap.api.maps.model.Poi; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.animation.Animation; -import com.amap.api.maps.model.animation.ScaleAnimation; -import com.amap.api.maps.model.animation.TranslateAnimation; -import com.amap.api.navi.AMapNaviView; -import com.amap.api.navi.AMapNaviViewListener; -import com.amap.api.navi.AMapNaviViewOptions; -import com.amap.api.navi.enums.AMapNaviViewShowMode; -import com.amap.api.navi.model.NaviInfo; -import com.mogo.map.IMogoMap; -import com.mogo.map.IMogoMapView; -import com.mogo.eagle.core.data.map.MogoLatLng; -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; -import com.mogo.map.impl.amap.navi.NaviClient; -import com.mogo.map.impl.amap.uicontroller.AMapUIController; -import com.mogo.map.impl.amap.utils.MogoMapUtils; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.listener.MogoMapListenerHandler; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.uicontroller.CarCursorOption; -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.map.uicontroller.VisualAngleMode; -import com.mogo.utils.WindowUtils; -import com.mogo.utils.logger.Logger; - -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 代理高德导航地图 - */ -public class AMapNaviViewWrapper implements IMogoMapView, - IMogoMapUIController, - AMap.OnMarkerClickListener, - AMap.OnMapLoadedListener, - AMap.OnMapTouchListener, - AMap.OnPOIClickListener, - AMap.OnMapClickListener, - AMap.OnPolylineClickListener, - AMapNaviViewListener, - AMapMessageListener, - AMap.OnCameraChangeListener, - AMap.OnMyLocationChangeListener{ - - private static final String TAG = "AMapNaviViewWrapper"; - - private AMapNaviView mMapView; - private IMogoMap mIMap; - - private AMapMarkerClickHandler mMarkerClickHandler; - private EnumMapUI mCurrentUIMode; - - private boolean mIsCarLocked = false; - - private float mDefaultZoomLevel = 16.0f; - private final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder() - .carCursorRes( R.drawable.map_api_ic_current_location2 ) - .naviCursorRes( R.drawable.ic_amap_navi_cursor ) - .build(); - private CarCursorOption mCarCursorOption = DEFAULT_OPTION; - - private BnHooker bnHooker; - - private Location mLastDriveLocationShadow = null; - private Marker mMyLocationMarker; - - public AMapNaviViewWrapper( AMapNaviView mapView ) { - this.mMapView = mapView; - this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView.getContext(), this ); - try { - bnHooker = new BnHooker( mMapView.getMap() ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - private void initMapView() { - if ( mMapView == null ) { - return; - } - AMapNaviViewOptions options = mMapView.getViewOptions(); - if ( options != null ) { - // 设置是否开启自动黑夜模式切换,默认为false,不自动切换 - options.setAutoNaviViewNightMode( false ); - // 设置6秒后是否自动锁车 - options.setAutoLockCar( false ); - // 设置路线上的摄像头气泡是否显示 - options.setCameraBubbleShow( true ); - // 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。 - // options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() ); - // 设置自车的图片对象 - options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) ); - // 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。 - options.setCompassEnabled( false ); - // 黑夜模式 - options.setNaviNight( true ); - //设置路况光柱条是否显示(只适用于驾车导航,需要联网)。 - options.setTrafficBarEnabled( false ); - // 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。 - options.setTrafficLayerEnabled( false ); - // 设置导航界面是否显示路线全览按钮。 - options.setRouteListButtonShow( false ); - // 设置屏幕是否常亮,默认开启 - options.setScreenAlwaysBright( false ); - // 设置交通播报是否打开(只适用于驾车导航,需要联网)。 - options.setTrafficInfoUpdateEnabled( true ); - // 设置摄像头播报是否打开(只适用于驾车导航)。 - options.setCameraInfoUpdateEnabled( true ); - // 设置菜单按钮是否在导航界面显示。 - options.setSettingMenuEnabled( false ); - // 设置是否绘制显示交通路况的线路(彩虹线),拥堵-红色,畅通-绿色,缓慢-黄色,未知-蓝色。默认不绘制彩虹线。 - options.setTrafficLine( true ); - // 设置是否绘制牵引线(当前位置到目的地的指引线)。默认不绘制牵引线。 - options.setLeaderLineEnabled( -1 ); - // 设置导航界面UI是否显示。 - options.setLayoutVisible( false ); - // 设置是否自动画路 - options.setAutoDrawRoute( false ); - // 设置是否显示路口放大图(实景图) - options.setRealCrossDisplayShow( false ); - // 设置是否显示路口放大图(路口模型图) - options.setModeCrossDisplayShow( false ); - // 设置是否显示道路信息view - options.setLaneInfoShow( false ); - // 设置是否自动改变缩放等级 - options.setAutoChangeZoom( false ); - // 设置是否自动全览模式,即在算路成功后自动进入全览模式 - options.setAutoDisplayOverview( false ); - // 设置路线转向箭头隐藏和显示 - options.setNaviArrowVisible( false ); - // 通过路线是否自动置灰,仅支持驾车导航 - options.setAfterRouteAutoGray( true ); - options.setZoom( ( ( int ) mDefaultZoomLevel ) ); - options.setPointToCenter( 0.7D, 0.5D ); - // 2D模式 - options.setTilt( 0 ); - mMapView.setViewOptions( options ); - } - mMapView.setRouteOverlayVisible( false ); - mMapView.setCarOverlayVisible( false ); - setUIMode( EnumMapUI.NorthUP_2D, null ); - } - - private void initListeners() { - - mMapView.setOnMarkerClickListener( this ); - mMarkerClickHandler = new AMapMarkerClickHandler(); - mMapView.setOnMapLoadedListener( this ); - mMapView.setOnMapTouchListener( this ); - mMapView.setOnPolylineClickListener( this ); - mMapView.setAMapNaviViewListener( this ); - mMapView.setOnCameraChangeListener( this ); - - final AMap aMap = mMapView.getMap(); - if ( aMap != null ) { - aMap.setOnPOIClickListener( this ); - aMap.setOnMapClickListener( this ); - aMap.setOnCameraChangeListener( this ); - aMap.setOnMyLocationChangeListener( this ); - } - AMapMessageManager.getInstance().clear(); - AMapMessageManager.getInstance().registerAMapMessageListener( this ); - } - - private Context getContext() { - return mMapView.getContext(); - } - - @Override - public View getMapView() { - return mMapView; - } - - @Override - public IMogoMap getMap() { - return mIMap; - } - - @Override - public void onCreate( Bundle bundle ) { - if ( mMapView != null ) { - mMapView.onCreate( bundle ); - Logger.d( TAG, "map onCreate" ); - initMapView(); - initListeners(); - initMyLocation(); - } - } - - @Override - public void onResume() { - if ( mMapView != null ) { - mMapView.onResume(); - Logger.d( TAG, "map onResume" ); - } - } - - @Override - public void onPause() { - if ( mMapView != null ) { - mMapView.onPause(); - Logger.d( TAG, "map onPause" ); - } - } - - @Override - public void onDestroy() { - if ( mMapView != null ) { - mMapView.onDestroy(); - mMapView = null; - AMapUIController.release(); - AMapWrapper.release(); - AMapMessageManager.getInstance().unregisterAMapMessageListener( this ); - Logger.d( TAG, "map onDestroy" ); - } - } - - @Override - public void onSaveInstanceState( Bundle outState ) { - if ( mMapView != null ) { - mMapView.onSaveInstanceState( outState ); - Logger.d( TAG, "map onSaveInstanceState" ); - } - } - - @Override - public void onLowMemory() { - Logger.d( TAG, "map onLowMemory" ); - } - - /** - * 地图marker点击 - */ - @Override - public boolean onMarkerClick( Marker marker ) { - return mMarkerClickHandler.handleMarkerClicked( marker ); - } - - /** - * 地图加载完毕 - */ - @Override - public void onMapLoaded() { - MogoMapListenerHandler.getInstance().onMapLoaded(); - } - - /** - * 地图点击回调 - */ - @Override - public void onTouch( MotionEvent motionEvent ) { - MogoMapListenerHandler.getInstance().onTouch( motionEvent ); - if ( motionEvent.getAction() == MotionEvent.ACTION_DOWN ) { - changeMyLocationType2UnFollow(); - } - if ( motionEvent.getAction() != MotionEvent.ACTION_UP ) { - try { - bnHooker.clearAllMessages(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } - - /** - * POI 点击 - */ - @Override - public void onPOIClick( Poi poi ) { - if ( InterceptorHandler.getInstance().ignorePoiClicked( getContext() ) ) { - return; - } - MogoMapListenerHandler.getInstance().onPOIClick( ObjectUtils.fromAMap( poi ) ); - } - - @Override - public void onMapClick( LatLng latLng ) { - if ( InterceptorHandler.getInstance().ignoreMapClicked( getContext() ) ) { - return; - } - MogoMapListenerHandler.getInstance().onMapClick( ObjectUtils.fromAMap( latLng ) ); - } - - @Override - public void onPolylineClick( Polyline polyline ) { - if ( !NaviClient.getInstance( getContext() ).isNaviing() ) { - NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline ); - } - } - - @Override - public void onNaviSetting() { - - } - - @Override - public void onNaviCancel() { - - } - - @Override - public boolean onNaviBackClick() { - return true; - } - - /** - * @param mode 0:车头朝上状态;1:正北朝上模式 - */ - @Override - public void onNaviMapMode( int mode ) { - Logger.i( TAG, "mode=" + mode ); - MogoMapListenerHandler.getInstance().onMapModeChanged( mode == 0 ? EnumMapUI.CarUp_2D : EnumMapUI.NorthUP_2D ); - } - - @Override - public void onNaviTurnClick() { - - } - - @Override - public void onNextRoadClick() { - - } - - @Override - public void onScanViewButtonClick() { - - } - - @Override - public void onLockMap( boolean isLock ) { - Logger.d( TAG, "lock status = %s", isLock ); - mIsCarLocked = isLock; - Trace.beginSection( "timer.onCameraChangeFinish" ); - MogoMapListenerHandler.getInstance().onLockMap( isLock ); - Trace.endSection(); - } - - @Override - public void onNaviViewLoaded() { - - } - - @Override - public void onMapTypeChanged( int type ) { - if ( type == 4 ) { - MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Light ); - } else if ( type == 3 ) { - MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Night ); - } - } - - @Override - public void onNaviViewShowMode( int i ) { - - long delay = mMapView.getViewOptions().getLockMapDelayed(); - switch ( i ) { - case AMapNaviViewShowMode.SHOW_MODE_DEFAULT: - Logger.d( TAG, "普通模式" ); - break; - case AMapNaviViewShowMode.SHOW_MODE_DISPLAY_OVERVIEW: - Logger.d( TAG, "全览模式" ); - break; - case AMapNaviViewShowMode.SHOW_MODE_LOCK_CAR: - Logger.d( TAG, "锁车模式: %s", delay ); - break; - } - } - - @Override - public void setTrafficEnabled( boolean visible ) { - if ( checkAMapView() ) { - mMapView.setTrafficLine( visible ); - } - } - - @Override - public MapControlResult changeZoom( boolean zoom ) { - if ( checkAMapView() ) { - mDefaultZoomLevel = ( int ) ( getMap().getZoomLevel() + 0.5f ); - - if ( zoom ) { - if ( mDefaultZoomLevel >= 20 ) { - return MapControlResult.TARGET; - } - } else { - if ( mDefaultZoomLevel <= 3 ) { - return MapControlResult.TARGET; - } - } - - if ( zoom ) { - mDefaultZoomLevel += 2f; - if ( mDefaultZoomLevel > 20 ) { - mDefaultZoomLevel = 20; - } - } else { - mDefaultZoomLevel -= 2f; - if ( mDefaultZoomLevel < 1 ) { - mDefaultZoomLevel = 1; - } - } - changeZoom( ( int ) mDefaultZoomLevel ); - } - return MapControlResult.SUCCESS; - } - - @Override - public MapControlResult changeZoom( float zoom ) { - Logger.d( TAG, "changeZoom %s", zoom ); - getMap().changeZoom( zoom ); - return MapControlResult.SUCCESS; - } - - @Override - public void changeMapMode( EnumMapUI ui ) { - if ( ui == null ) { - return; - } - if ( checkAMapView() ) { - AMapNaviViewOptions options = mMapView.getViewOptions(); - if ( options == null ) { - options = new AMapNaviViewOptions(); - } - switch ( ui ) { - case CarUp_2D: - case CarUp_3D: - case NorthUP_2D: - setUIMode( ui, options ); - break; - case Type_Light: - options.setNaviNight( false ); - options.setAutoNaviViewNightMode( false ); - break; - case Type_Night: - options.setNaviNight( true ); - options.setAutoNaviViewNightMode( false ); - break; - case Type_AUTO_LIGHT_Night: - options.setNaviNight( false ); - options.setAutoNaviViewNightMode( true ); - break; - } - mMapView.setViewOptions( options ); - changeMyLocationType2Follow(); - } - } - - @Override - public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) { - - } - - @Override - public VisualAngleMode getCurrentMapVisualAngle() { - return null; - } - - private void setUIMode( EnumMapUI ui, AMapNaviViewOptions options ) { - this.mCurrentUIMode = ui; - switch ( ui ) { - case CarUp_2D: - case CarUp_3D: - mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE ); - break; - case NorthUP_2D: - mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE ); - break; - } - - Logger.d( TAG, "mCurrentUIMode--->" + mCurrentUIMode.name() ); - if ( options == null ) { - return; - } - switch ( ui ) { - case CarUp_2D: - case NorthUP_2D: - options.setTilt( 0 ); - break; - case CarUp_3D: - options.setTilt( 60 ); - break; - } - } - - private boolean checkAMapView() { - if ( mMapView == null ) { - Logger.e( TAG, "高德mapView实例为空,请检查" ); - return false; - } - return true; - } - - @Override - public void moveToCenter( MogoLatLng latLng, boolean animate ) { - Logger.d( TAG, "move to center %s", latLng ); - if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) { - Logger.e( TAG, "latlng = null or is illegal" ); - return; - } - loseLockMode(); - if ( animate ) { - mMapView.getMap().animateCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) ); - } else { - mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) ); - } - } - - private boolean isVisible = false; - - @Override - public void showMyLocation( boolean visible ) { - Logger.d( TAG, "showMyLocation1 %s", visible ); - isVisible = visible; - if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) { - return; - } - - if ( checkAMapView() ) { - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - style.showMyLocation( visible ); - if ( mCurrentUIMode == EnumMapUI.CarUp_2D - || mCurrentUIMode == EnumMapUI.CarUp_3D ) { - - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER ); - } else { - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW ); - } - mMapView.getMap().setMyLocationStyle( style ); - if ( visible ) { - // 强制刷新一遍车标 - setCarCursorOption(mCarCursorOption); -// style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) ); - } - } - } - - @Override - public void emphasizeMyLocation() { - if (mMyLocationMarker == null) { - initMyLocationMarker(); - } - - ScaleAnimation animation = new ScaleAnimation(1f, 1.2f, 1f, 1.2f); - animation.setDuration(250); - - mMyLocationMarker.setAnimation(animation); -// mMyLocationMarker.setAnimationListener(new Animation.AnimationListener() { -// @Override -// public void onAnimationStart() { -// -// } -// -// @Override -// public void onAnimationEnd() { -// mMyLocationMarker.setAnimationListener(null); -// ScaleAnimation animation = new ScaleAnimation(1.5f, 1f, 1.5f, 1f); -// animation.setDuration(250); -// mMyLocationMarker.setAnimation(animation); -// mMyLocationMarker.startAnimation(); -// } -// }); - try { - mMyLocationMarker.startAnimation(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - @Override - public void showMyLocation( View view ) { - if ( NaviClient.getInstance( getContext() ).isNaviing() ) { - return; - } - if ( checkAMapView() ) { - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - if ( mCurrentUIMode == EnumMapUI.CarUp_2D - || mCurrentUIMode == EnumMapUI.CarUp_3D ) { - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER ); - } else { - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW ); - } - style.showMyLocation( true ); - style.myLocationIcon( BitmapDescriptorFactory.fromView( view ) ); - mMapView.getMap().setMyLocationStyle( style ); - } - } - - private void changeMyLocationType2UnFollow() { - if ( mCurrentUIMode == null ) { - return; - } - if ( !checkAMapView() ) { - return; - } - - MyLocationStyle style = getMyLocationStyle(); - switch ( mCurrentUIMode ) { - case NorthUP_2D: - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER ); - break; - case CarUp_2D: - case CarUp_3D: - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER ); - break; - } - mMapView.getMap().setMyLocationStyle( style ); - Logger.d( TAG, "设置" ); - } - - private void changeMyLocationType2Follow() { - if ( mCurrentUIMode == null ) { - return; - } - if ( !checkAMapView() ) { - return; - } - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - switch ( mCurrentUIMode ) { - case NorthUP_2D: - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW ); - break; - case CarUp_2D: - case CarUp_3D: - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE ); - break; - } - mMapView.getMap().setMyLocationStyle( style ); - } - - public void initMyLocation() { - if ( checkAMapView() ) { - mMapView.getMap().setMyLocationEnabled( true ); - MyLocationStyle style = getMyLocationStyle(); - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE ); - style.interval( 1000 ); - style.anchor( 0.5F, 0.5F ); - style.strokeColor( Color.TRANSPARENT ); - style.strokeWidth( 0 ); - style.radiusFillColor( Color.TRANSPARENT ); - mMapView.getMap().setMyLocationStyle( style ); - } - } - - @Override - public void recoverLockMode() { - if ( checkAMapView() ) { - Logger.d( TAG, "锁车" ); - mMapView.recoverLockMode(); - changeMyLocationType2Follow(); - mIsCarLocked = true; - } - } - - @Override - public void loseLockMode() { - Logger.d( TAG, "解锁锁车" ); - mIsCarLocked = false; - mockTouchEvent(); - } - - /** - * 模拟点击事件,达到锁车->普通事件 - */ - private void mockTouchEvent() { - long downTime = SystemClock.uptimeMillis(); - long eventTime = downTime + 1; - int metaState = 0; - MotionEvent motionEvent = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState ); - mMapView.dispatchTouchEvent( motionEvent ); - MotionEvent upEvent = MotionEvent.obtain( downTime + 1, eventTime + 2, MotionEvent.ACTION_UP, 0, 0, metaState ); - mMapView.dispatchTouchEvent( upEvent ); - } - - @Override - public void setLockZoom( int var1 ) { - if ( checkAMapView() ) { - Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 ); -// mMapView.setLockZoom( var1 ); - } - } - - @Override - public void displayOverview( Rect bounds ) { - if ( checkAMapView() ) { - if ( NaviClient.getInstance( getContext() ).isNaviing() ) { - loseLockMode(); - NaviClient.getInstance( getContext() ).displayOverview( bounds ); - } - } - } - - @Override - public float getScalePerPixel() { - return getMap().getScalePerPixel(); - } - - @Override - public float getZoomLevel() { - return getMap().getZoomLevel(); - } - - @Override - public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) { - return getMap().getRoadWidth(lon, lat, angle, isGpsLocation, isRTK); - } - - @Override - public void onNaviStarted() { - if ( checkAMapView() ) { - mMapView.setCarOverlayVisible( true ); - showMyLocation( false ); - } - } - - @Override - public void onNaviStopped() { - if ( checkAMapView() ) { - mMapView.setCarOverlayVisible( false ); - showMyLocation( true ); - NaviClient.getInstance( getContext() ).startAimlessMode(); - } - } - - @Override - public void onNaviInfoUpdat( NaviInfo naviInfo ) { - - } - - @Override - public void onCalculateSuccess() { - loseLockMode(); - } - - @Override - public void onCameraChange( CameraPosition cameraPosition ) { - } - - @Override - public void onCameraChangeFinish( CameraPosition cameraPosition ) { - if ( cameraPosition != null ) { - Trace.beginSection( "timer.onCameraChangeFinish" ); - MogoMapListenerHandler.getInstance().onMapChanged( ObjectUtils.fromAMap( cameraPosition.target ), - cameraPosition.zoom, - cameraPosition.tilt, - cameraPosition.bearing ); - Trace.endSection(); - } - } - - @Override - public MogoLatLng getCameraNorthEastPosition() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.northeast ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public MogoLatLng getCameraSouthWestPosition() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.southwest ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public MogoLatLng getWindowCenterLocation() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getCameraPosition().target ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public void setPointToCenter( double mapCenterX, double mapCenterY ) { - if ( checkAMapView() ) { - Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY ); - AMapNaviViewOptions options = mMapView.getViewOptions(); - options.setPointToCenter( mapCenterX, mapCenterY ); - mMapView.setViewOptions( options ); - } - } - - @Override - public Point getLocationPointInScreen( MogoLatLng latLng ) { - if ( checkAMapView() ) { - try { - return mMapView.getMap() - .getProjection() - .toScreenLocation( ObjectUtils.fromMogo2( latLng ) ); - } catch ( Exception e ) { - return null; - } - } - return null; - } - - @Override - public MogoLatLng getLocationMogoLatLngInScreen( Point point ) { - if ( checkAMapView() ) { - try { - return ObjectUtils.fromAMap( - mMapView.getMap().getProjection().fromScreenLocation( point ) ); - } catch ( Exception e ) { - return null; - } - } - return null; - } - - @Override - public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, - long duration ) { - if ( marker == null || high <= 0.0f || interpolator == null || duration < 0 ) { - return; - } - try { - final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() ); - Point point = mMapView.getMap().getProjection().toScreenLocation( latLng ); - point.y -= WindowUtils.dip2px( getContext(), high ); - LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point ); - //使用TranslateAnimation,填写一个需要移动的目标点 - Animation animation = new TranslateAnimation( target ); - animation.setInterpolator( interpolator ); - //整个移动所需要的时间 - animation.setDuration( duration ); - //设置动画 - if ( marker instanceof AMapMarkerWrapper ) { - ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation ); - ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation(); - } - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - @Override - public void setRenderFps( int fps ) { - if ( checkAMapView() ) { - if ( mMapView.getMap() != null ) { - mMapView.getMap().setRenderFps( fps ); - Logger.d( TAG, "设置刷新帧率 fps = %s", fps ); - } - } - } - - @Override - public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) { - if ( !checkAMapView() ) { - return; - } - try { - LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds( carPosition, lonLats, lockCarPosition ); - if ( !lockCarPosition ) { - changeMyLocationType2UnFollow(); - try { - bnHooker.clearAllMessages(); - } catch ( Exception e ) { - e.printStackTrace(); - } - loseLockMode(); - } - mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLngBoundsRect( latLngBounds, bound.left, bound.right, bound.top, bound.bottom ) ); - } catch ( Exception e ) { - Logger.e( TAG, e, "%s error.", tag ); - } - } - - @Override - public void forceRender() { - if ( checkAMapView() ) { - mMapView.getMap().runOnDrawFrame(); - } - } - - @Override - public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception { - if ( p1 == null || p2 == null ) { - throw new Exception( "计算距离的点不能为 null" ); - } - return AMapUtils.calculateLineDistance( ObjectUtils.fromMogo2( p1 ), ObjectUtils.fromMogo2( p2 ) ); - } - - @Override - public void onMyLocationChange( Location location ) { - if ( ( int ) location.getSpeed() > 0 ) { - mLastDriveLocationShadow = location; - } else { - if ( ( int ) location.getBearing() == 0 - && mLastDriveLocationShadow != null ) { - if ( mMyLocationMarker == null || mMyLocationMarker.isRemoved() ) { - initMyLocationMarker(); - } - if ( mMyLocationMarker != null ) { - mMyLocationMarker.setRotateAngle( 360 - mLastDriveLocationShadow.getBearing() ); - } - } - } - NaviClient.getInstance( getContext() ).syncCarLocation( location ); - } - - private void initMyLocationMarker() { - List< Marker > markers = mMapView.getMap().getMapScreenMarkers(); - if ( markers != null ) { - for ( Marker marker : markers ) { - if ( marker != null && marker.getObject() == null ) { - this.mMyLocationMarker = marker; - break; - } - } - } - } - - @Override - public EnumMapUI getCurrentUiMode() { - return mCurrentUIMode; - } - - @Override - public void changeMyLocation( Location location ) { - } - - @Override - public synchronized boolean isCarLocked() { - return mIsCarLocked; - } - - @Override - public void setCarCursorOption( CarCursorOption option ) { - if (!isVisible) { - // 当前自车图标没有显示,所以先不走下面的流程 - return; - } -// if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION) { -// mCarCursorOption.destroy(); -// } - if(option != mCarCursorOption) { - if (option != null) { - try { - mCarCursorOption = option.clone(); - } catch (Exception e) { - mCarCursorOption = DEFAULT_OPTION; - } - } else { - mCarCursorOption = DEFAULT_OPTION; - } - } - if ( !checkAMapView() ) { - return; - } - AMapNaviViewOptions options = mMapView.getViewOptions(); - if ( options != null && mCarCursorOption.getNaviCursorRes() != 0 ) { - options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), mCarCursorOption.getNaviCursorRes() ) ); - } else { - options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) ); - } - mMapView.setViewOptions( options ); - - if ( mMapView.getMap() == null ) { - return; - } - MyLocationStyle style = getMyLocationStyle(); - if ( mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled() ) { - style.myLocationIcon( BitmapDescriptorFactory.fromBitmap( mCarCursorOption.getCarCursorBmp() ) ); - } else { - if ( mCarCursorOption.getCarCursorRes() != 0 ) { - style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) ); - } else { - style.myLocationIcon( BitmapDescriptorFactory.fromResource( DEFAULT_OPTION.getCarCursorRes() ) ); - } - } - mMapView.getMap().setMyLocationStyle( style ); - } - - private MyLocationStyle getMyLocationStyle() { - MyLocationStyle style = null; - try { - style = mMapView.getMap().getMyLocationStyle(); - } catch ( Exception e ) { - style = new MyLocationStyle(); - } finally { - if ( style == null ) { - style = new MyLocationStyle(); - } - return style; - } - } - - @Override - public MapCameraPosition getMapCameraPosition() { - if ( checkAMapView() ) { - CameraPosition cameraPosition = mMapView.getMap().getCameraPosition(); - return ObjectUtils.fromAMap( cameraPosition ); - } - return null; - } - - @Override - public void changeBearing( float bearing ) { - if ( checkAMapView() ) { - mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) ); - } - } - - @Override - public long getTileId(double lon, double lat) { - return getMap().getUIController().getTileId(lon, lat); - } - - @Override - public void setAdasRecognizedResult(int drawlevel) { - - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapUiSettingsWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapUiSettingsWrapper.java deleted file mode 100644 index fa904a0afa..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapUiSettingsWrapper.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.mogo.map.impl.amap; - -import com.amap.api.maps.UiSettings; -import com.mogo.map.IMogoUiSettings; - -import java.lang.reflect.Method; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 代理高德地图UiSettings - */ -public class AMapUiSettingsWrapper implements IMogoUiSettings { - - private UiSettings mUiSettings; - - public AMapUiSettingsWrapper( UiSettings mUiSettings ) { - this.mUiSettings = mUiSettings; - } - - @Override - public void setScaleControlsEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setScaleControlsEnabled( enabled ); - } - } - - @Override - public void setZoomControlsEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setZoomControlsEnabled( enabled ); - } - } - - @Override - public void setCompassEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setCompassEnabled( enabled ); - } - } - - @Override - public void setMyLocationButtonEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setMyLocationButtonEnabled( enabled ); - } - } - - @Override - public void setScrollGesturesEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setScrollGesturesEnabled( enabled ); - } - } - - @Override - public void setZoomGesturesEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setZoomGesturesEnabled( enabled ); - } - } - - @Override - public void setTiltGesturesEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setTiltGesturesEnabled( enabled ); - } - } - - @Override - public void setRotateGesturesEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setRotateGesturesEnabled( enabled ); - } - } - - @Override - public void setAllGesturesEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setAllGesturesEnabled( enabled ); - } - } - - @Override - public void setIndoorSwitchEnabled( boolean enabled ) { - if ( mUiSettings != null ) { - mUiSettings.setIndoorSwitchEnabled( enabled ); - } - } - - @Override - public void setLogoEnable( boolean enabled ) { - if ( mUiSettings != null ) { - try { - Method method = mUiSettings.getClass().getMethod( "setLogoEnable", boolean.class ); - method.setAccessible( true ); - method.invoke( mUiSettings, enabled ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewHandler.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewHandler.java deleted file mode 100644 index 4116eca0d7..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; -import android.view.ViewGroup; - -import com.amap.api.maps.MapView; -import com.amap.api.navi.AMapNaviView; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.map.IMogoMapView; -import com.mogo.utils.logger.Logger; - -public -/** - * @author congtaowang - * @since 2020/9/10 - *

- * 描述 - */ -class AMapViewHandler { - - private static final String TAG = "AMapViewHandler"; - - private static IMogoMapView sMapView; - - public static void createMapView( Context context ) { - sMapView = new AMapNaviViewWrapper( new AMapNaviView( context ) ); - Logger.d( TAG, "created." ); - } - - public static IMogoMapView getMapView() { - return sMapView; - } - - public static void destroy() { - sMapView = null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java deleted file mode 100644 index a77d9729fe..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java +++ /dev/null @@ -1,832 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; -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; -import android.view.MotionEvent; -import android.view.View; -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.MapView; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.CameraPosition; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MyLocationStyle; -import com.amap.api.maps.model.Poi; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.animation.Animation; -import com.amap.api.maps.model.animation.TranslateAnimation; -import com.amap.api.navi.model.NaviInfo; -import com.mogo.map.IMogoMap; -import com.mogo.map.IMogoMapView; -import com.mogo.eagle.core.data.map.MogoLatLng; -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; -import com.mogo.map.impl.amap.navi.NaviClient; -import com.mogo.map.impl.amap.uicontroller.AMapUIController; -import com.mogo.map.impl.amap.utils.MogoMapUtils; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.listener.MogoMapListenerHandler; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.uicontroller.CarCursorOption; -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.map.uicontroller.VisualAngleMode; -import com.mogo.utils.NetworkUtils; -import com.mogo.utils.WindowUtils; -import com.mogo.utils.logger.Logger; - -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 代理高德导航地图 - */ -public class AMapViewWrapper implements IMogoMapView, - IMogoMapUIController, - AMap.OnMarkerClickListener, - AMap.OnMapLoadedListener, - AMap.OnMapTouchListener, - AMap.OnPOIClickListener, - AMap.OnMapClickListener, - AMap.OnPolylineClickListener, - AMapMessageListener, - AMap.OnCameraChangeListener, - AMap.OnMyLocationChangeListener { - - private static final String TAG = "AMapViewWrapper"; - - private final MapView mMapView; - private IMogoMap mIMap; - - private AMapMarkerClickHandler mMarkerClickHandler; - private EnumMapUI mCurrentUIMode; - - private boolean mIsCarLocked = false; - - private float mDefaultZoomLevel = 16.0f; - private final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder() - .carCursorRes( R.drawable.map_api_ic_current_location2 ) - .naviCursorRes( R.drawable.ic_amap_navi_cursor ) - .build(); - private CarCursorOption mCarCursorOption = DEFAULT_OPTION; - - public AMapViewWrapper( MapView mapView ) { - this.mMapView = mapView; - this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView.getContext(), this ); - try { - new BnHooker( mMapView.getMap() ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - private void initMapView() { - if ( mMapView == null ) { - return; - } -// AMapNaviViewOptions options = mMapView.getViewOptions(); -// if ( options != null ) { -// // 设置是否开启自动黑夜模式切换,默认为false,不自动切换 -// options.setAutoNaviViewNightMode( false ); -// // 设置6秒后是否自动锁车 -// options.setAutoLockCar( false ); -// // 设置路线上的摄像头气泡是否显示 -// options.setCameraBubbleShow( true ); -// // 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。 -// // options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() ); -// // 设置自车的图片对象 -// options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) ); -// // 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。 -// options.setCompassEnabled( false ); -// // 黑夜模式 -// options.setNaviNight( true ); -// //设置路况光柱条是否显示(只适用于驾车导航,需要联网)。 -// options.setTrafficBarEnabled( false ); -// // 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。 -// options.setTrafficLayerEnabled( false ); -// // 设置导航界面是否显示路线全览按钮。 -// options.setRouteListButtonShow( false ); -// // 设置屏幕是否常亮,默认开启 -// options.setScreenAlwaysBright( false ); -// // 设置交通播报是否打开(只适用于驾车导航,需要联网)。 -// options.setTrafficInfoUpdateEnabled( true ); -// // 设置摄像头播报是否打开(只适用于驾车导航)。 -// options.setCameraInfoUpdateEnabled( true ); -// // 设置菜单按钮是否在导航界面显示。 -// options.setSettingMenuEnabled( false ); -// // 设置是否绘制显示交通路况的线路(彩虹线),拥堵-红色,畅通-绿色,缓慢-黄色,未知-蓝色。默认不绘制彩虹线。 -// options.setTrafficLine( true ); -// // 设置是否绘制牵引线(当前位置到目的地的指引线)。默认不绘制牵引线。 -// options.setLeaderLineEnabled( -1 ); -// // 设置导航界面UI是否显示。 -// options.setLayoutVisible( false ); -// // 设置是否自动画路 -// options.setAutoDrawRoute( false ); -// // 设置是否显示路口放大图(实景图) -// options.setRealCrossDisplayShow( false ); -// // 设置是否显示路口放大图(路口模型图) -// options.setModeCrossDisplayShow( false ); -// // 设置是否显示道路信息view -// options.setLaneInfoShow( false ); -// // 设置是否自动改变缩放等级 -// options.setAutoChangeZoom( false ); -// // 设置是否自动全览模式,即在算路成功后自动进入全览模式 -// options.setAutoDisplayOverview( false ); -// // 设置路线转向箭头隐藏和显示 -// options.setNaviArrowVisible( false ); -// // 通过路线是否自动置灰,仅支持驾车导航 -// options.setAfterRouteAutoGray( true ); -// options.setZoom( ( ( int ) mDefaultZoomLevel ) ); -// options.setPointToCenter( 0.7D, 0.5D ); -// // 2D模式 -// options.setTilt( 0 ); -// mMapView.setViewOptions( options ); -// } -// mMapView.setRouteOverlayVisible( false ); -// mMapView.setCarOverlayVisible( false ); - changeMapMode( EnumMapUI.CarUp_2D ); - if ( NetworkUtils.isConnected( mMapView.getContext() ) ) { - setTrafficEnabled( true ); - } - mMapView.getMap().moveCamera( CameraUpdateFactory.zoomTo( mDefaultZoomLevel ) ); - } - - private void initListeners() { - - mMarkerClickHandler = new AMapMarkerClickHandler(); - final AMap aMap = mMapView.getMap(); - if ( aMap != null ) { - aMap.setOnMarkerClickListener( this ); - aMap.setOnMapLoadedListener( this ); - aMap.setOnMapTouchListener( this ); - aMap.setOnPolylineClickListener( this ); - aMap.setOnCameraChangeListener( this ); - aMap.setOnPOIClickListener( this ); - aMap.setOnMapClickListener( this ); - aMap.setOnCameraChangeListener( this ); - aMap.setOnMyLocationChangeListener( this ); - } - AMapMessageManager.getInstance().clear(); - AMapMessageManager.getInstance().registerAMapMessageListener( this ); - } - - private Context getContext() { - return mMapView.getContext(); - } - - @Override - public View getMapView() { - return mMapView; - } - - @Override - public IMogoMap getMap() { - return mIMap; - } - - @Override - public void onCreate( Bundle bundle ) { - if ( mMapView != null ) { - mMapView.onCreate( bundle ); - Logger.d( TAG, "map onCreate" ); - initMapView(); - initListeners(); - initMyLocation(); - } - } - - @Override - public void onResume() { - if ( mMapView != null ) { - mMapView.onResume(); - Logger.d( TAG, "map onResume" ); - } - } - - @Override - public void onPause() { - if ( mMapView != null ) { - mMapView.onPause(); - Logger.d( TAG, "map onPause" ); - } - } - - @Override - public void onDestroy() { - if ( mMapView != null ) { - mMapView.onDestroy(); - AMapUIController.getInstance().release(); - AMapWrapper.release(); - Logger.d( TAG, "map onDestroy" ); - } - } - - @Override - public void onSaveInstanceState( Bundle outState ) { - if ( mMapView != null ) { - mMapView.onSaveInstanceState( outState ); - Logger.d( TAG, "map onSaveInstanceState" ); - } - } - - @Override - public void onLowMemory() { - if ( mMapView != null ) { - mMapView.onLowMemory(); - } - Logger.d( TAG, "map onLowMemory" ); - } - - /** - * 地图marker点击 - */ - @Override - public boolean onMarkerClick( Marker marker ) { - return mMarkerClickHandler.handleMarkerClicked( marker ); - } - - /** - * 地图加载完毕 - */ - @Override - public void onMapLoaded() { - MogoMapListenerHandler.getInstance().onMapLoaded(); - } - - /** - * 地图点击回调 - */ - @Override - public void onTouch( MotionEvent motionEvent ) { - MogoMapListenerHandler.getInstance().onTouch( motionEvent ); - if ( mIsCarLocked ) { - loseLockMode(); - } - } - - /** - * POI 点击 - */ - @Override - public void onPOIClick( Poi poi ) { - if ( InterceptorHandler.getInstance().ignorePoiClicked( getContext() ) ) { - return; - } - MogoMapListenerHandler.getInstance().onPOIClick( ObjectUtils.fromAMap( poi ) ); - } - - @Override - public void onMapClick( LatLng latLng ) { - if ( InterceptorHandler.getInstance().ignoreMapClicked( getContext() ) ) { - return; - } - MogoMapListenerHandler.getInstance().onMapClick( ObjectUtils.fromAMap( latLng ) ); - } - - @Override - public void onPolylineClick( Polyline polyline ) { - if ( !NaviClient.getInstance( getContext() ).isNaviing() ) { - NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline ); - } - } - - @Override - public void setTrafficEnabled( boolean visible ) { - if ( checkMapView() ) { - Logger.d( TAG, "setTrafficEnabled" ); - mMapView.getMap().setTrafficEnabled( true ); - } - } - - @Override - public MapControlResult changeZoom( boolean zoom ) { - if ( checkMapView() ) { - mDefaultZoomLevel = ( int ) ( getMap().getZoomLevel() + 0.5f ); - - if ( zoom ) { - if ( mDefaultZoomLevel >= 20 ) { - return MapControlResult.TARGET; - } - } else { - if ( mDefaultZoomLevel <= 3 ) { - return MapControlResult.TARGET; - } - } - - if ( zoom ) { - mDefaultZoomLevel += 2f; - if ( mDefaultZoomLevel > 20 ) { - mDefaultZoomLevel = 20; - } - } else { - mDefaultZoomLevel -= 2f; - if ( mDefaultZoomLevel < 1 ) { - mDefaultZoomLevel = 1; - } - } - changeZoom( ( int ) mDefaultZoomLevel ); - } - return MapControlResult.SUCCESS; - } - - @Override - public MapControlResult changeZoom( float zoom ) { - Logger.d( TAG, "changeZoom %s", zoom ); - getMap().changeZoom( zoom ); - return MapControlResult.SUCCESS; - } - - @Override - public void changeMapMode( EnumMapUI ui ) { - if ( ui == null ) { - return; - } - if ( checkMapView() ) { - switch ( ui ) { - - case CarUp_3D: - mMapView.getMap().moveCamera( CameraUpdateFactory.changeTilt( 60 ) ); - break; - case NorthUP_2D: - mMapView.getMap().moveCamera( CameraUpdateFactory.changeTilt( 0 ) ); - break; - case CarUp_2D: - mMapView.getMap().moveCamera( CameraUpdateFactory.changeTilt( 0 ) ); - break; - case Type_Light: - mMapView.getMap().setMapType( AMap.MAP_TYPE_NORMAL ); - break; - case Type_Night: - mMapView.getMap().setMapType( AMap.MAP_TYPE_NIGHT ); - break; - case Type_AUTO_LIGHT_Night: - break; - } - } - } - - @Override - public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) { - - } - - @Override - public VisualAngleMode getCurrentMapVisualAngle() { - return null; - } - - private boolean checkMapView() { - if ( mMapView == null || mMapView.getMap() == null ) { - Logger.e( TAG, "高德mapView实例为空,请检查" ); - return false; - } - return true; - } - - @Override - public void moveToCenter( MogoLatLng latLng, boolean animate ) { - Logger.d( TAG, "move to center %s", latLng ); - if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) { - Logger.e( TAG, "latlng = null or is illegal" ); - return; - } - loseLockMode(); - if ( animate ) { - mMapView.getMap().animateCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) ); - } else { - mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) ); - } - } - - @Override - public void showMyLocation( boolean visible ) { - Logger.d( TAG, "showMyLocation1 %s", visible ); - if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) { - return; - } - if ( checkMapView() ) { - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - style.showMyLocation( visible ); - if ( visible ) { - // 强制刷新一遍车标 - style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) ); - } - mMapView.getMap().setMyLocationStyle( style ); - } - } - - @Override - public void emphasizeMyLocation() { - // 空实现 - } - - @Override - public void showMyLocation( View view ) { - if ( NaviClient.getInstance( getContext() ).isNaviing() ) { - return; - } - if ( checkMapView() ) { - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - style.showMyLocation( true ); - style.myLocationIcon( BitmapDescriptorFactory.fromView( view ) ); - mMapView.getMap().setMyLocationStyle( style ); - } - } - - public void initMyLocation() { - if ( checkMapView() ) { - mMapView.getMap().setMyLocationEnabled( true ); - MyLocationStyle style = getMyLocationStyle(); - style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER ); - style.interval( 1000 ); - style.anchor( 0.5F, 0.5F ); - style.strokeColor( Color.TRANSPARENT ); - style.strokeWidth( 0 ); - style.radiusFillColor( Color.TRANSPARENT ); - mMapView.getMap().setMyLocationStyle( style ); - } - } - - private MyLocationStyle getMyLocationStyle() { - MyLocationStyle style = null; - try { - style = mMapView.getMap().getMyLocationStyle(); - } catch ( Exception e ) { - style = new MyLocationStyle(); - } finally { - if ( style == null ) { - style = new MyLocationStyle(); - } - return style; - } - } - - @Override - public void recoverLockMode() { - if ( checkMapView() ) { - Logger.d( TAG, "锁车" ); - Location target = NaviClient.getInstance( getContext() ).getCarLocation2(); - if ( target != null ) { - mMapView.getMap().animateCamera( CameraUpdateFactory.newCameraPosition( - new CameraPosition( new LatLng( target.getLatitude(), target.getLongitude() ), - mDefaultZoomLevel, - 0, - 0 - ) - ), new AMap.CancelableCallback() { - @Override - public void onFinish() { - changeMyLocationStyle(); - } - - @Override - public void onCancel() { - changeMyLocationStyle(); - } - } ); - } else { - changeMyLocationStyle(); - } - mIsCarLocked = true; - } - } - - private void changeMyLocationStyle() { - MyLocationStyle style = getMyLocationStyle(); - if ( style == null ) { - style = new MyLocationStyle(); - } - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW ); - mMapView.getMap().setMyLocationStyle( style ); - } - - @Override - public void loseLockMode() { - Logger.d( TAG, "解锁锁车" ); - MyLocationStyle style = getMyLocationStyle(); - style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER ); - mMapView.getMap().setMyLocationStyle( style ); - mIsCarLocked = false; - } - - /** - * 模拟点击事件,达到锁车->普通事件 - */ - private void mockTouchEvent() { - long downTime = SystemClock.uptimeMillis(); - long eventTime = downTime + 1; - int metaState = 0; - MotionEvent motionEvent = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState ); - mMapView.dispatchTouchEvent( motionEvent ); - MotionEvent upEvent = MotionEvent.obtain( downTime + 1, eventTime + 2, MotionEvent.ACTION_UP, 0, 0, metaState ); - mMapView.dispatchTouchEvent( upEvent ); - } - - @Override - public void setLockZoom( int var1 ) { - if ( checkMapView() ) { - Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 ); -// mMapView.setLockZoom( var1 ); - } - } - - @Override - public void displayOverview( Rect bounds ) { - if ( checkMapView() ) { - if ( NaviClient.getInstance( getContext() ).isNaviing() ) { - loseLockMode(); - NaviClient.getInstance( getContext() ).displayOverview( bounds ); - } - } - } - - @Override - public float getScalePerPixel() { - return getMap().getScalePerPixel(); - } - - @Override - public float getZoomLevel() { - return getMap().getZoomLevel(); - } - - @Override - public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) { - return getMap().getRoadWidth(lon, lat, angle, isGpsLocation, isRTK); - } - - @Override - public void onNaviStarted() { - if ( checkMapView() ) { - showMyLocation( false ); - } - } - - @Override - public void onNaviStopped() { - if ( checkMapView() ) { - showMyLocation( true ); - NaviClient.getInstance( getContext() ).startAimlessMode(); - } - } - - @Override - public void onNaviInfoUpdat( NaviInfo naviInfo ) { - - } - - @Override - public void onCalculateSuccess() { - loseLockMode(); - } - - @Override - public void onCameraChange( CameraPosition cameraPosition ) { - } - - @Override - public void onCameraChangeFinish( CameraPosition cameraPosition ) { - if ( cameraPosition != null ) { - Trace.beginSection( "timer.onCameraChangeFinish" ); - MogoMapListenerHandler.getInstance().onMapChanged( ObjectUtils.fromAMap( cameraPosition.target ), - cameraPosition.zoom, - cameraPosition.tilt, - cameraPosition.bearing ); - Trace.endSection(); - } - } - - @Override - public MogoLatLng getCameraNorthEastPosition() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.northeast ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public MogoLatLng getCameraSouthWestPosition() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.southwest ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public MogoLatLng getWindowCenterLocation() { - try { - return ObjectUtils.fromAMap( mMapView.getMap().getCameraPosition().target ); - } catch ( Exception e ) { - - } - return null; - } - - @Override - public void setPointToCenter( double mapCenterX, double mapCenterY ) { - if ( checkMapView() ) { - Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY ); - mMapView.getMap().setPointToCenter( ( ( int ) ( mapCenterX * WindowUtils.getScreenWidth( getContext() ) ) ), - ( ( int ) ( mapCenterY * WindowUtils.getScreenHeight( getContext() ) ) ) ); - } - } - - @Override - public Point getLocationPointInScreen( MogoLatLng latLng ) { - if ( checkMapView() ) { - try { - return mMapView.getMap() - .getProjection() - .toScreenLocation( ObjectUtils.fromMogo2( latLng ) ); - } catch ( Exception e ) { - return null; - } - } - return null; - } - - @Override - public MogoLatLng getLocationMogoLatLngInScreen( Point point ) { - if ( checkMapView() ) { - try { - return ObjectUtils.fromAMap( - mMapView.getMap().getProjection().fromScreenLocation( point ) ); - } catch ( Exception e ) { - return null; - } - } - return null; - } - - @Override - public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, - long duration ) { - if ( marker == null || high <= 0.0f || interpolator == null || duration < 0 ) { - return; - } - try { - final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() ); - Point point = mMapView.getMap().getProjection().toScreenLocation( latLng ); - point.y -= WindowUtils.dip2px( getContext(), high ); - LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point ); - //使用TranslateAnimation,填写一个需要移动的目标点 - Animation animation = new TranslateAnimation( target ); - animation.setInterpolator( interpolator ); - //整个移动所需要的时间 - animation.setDuration( duration ); - //设置动画 - if ( marker instanceof AMapMarkerWrapper ) { - ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation ); - ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation(); - } - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - @Override - public void setRenderFps( int fps ) { - if ( checkMapView() ) { - if ( mMapView.getMap() != null ) { - mMapView.getMap().setRenderFps( fps ); - Logger.d( TAG, "设置刷新帧率 fps = %s", fps ); - } - } - } - - @Override - public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) { - if ( !checkMapView() ) { - return; - } - try { - LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds( carPosition, lonLats, lockCarPosition ); - if ( !lockCarPosition ) { - loseLockMode(); - } - mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLngBoundsRect( latLngBounds, bound.left, bound.right, bound.top, bound.bottom ) ); - } catch ( Exception e ) { - Logger.e( TAG, e, "%s error.", tag ); - } - } - - @Override - public void forceRender() { - if ( checkMapView() ) { - mMapView.getMap().runOnDrawFrame(); - } - } - - @Override - public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception { - if ( p1 == null || p2 == null ) { - throw new Exception( "计算距离的点不能为 null" ); - } - return AMapUtils.calculateLineDistance( ObjectUtils.fromMogo2( p1 ), ObjectUtils.fromMogo2( p2 ) ); - } - - @Override - public void onMyLocationChange( Location location ) { - NaviClient.getInstance( getContext() ).syncCarLocation( location ); - } - - @Override - public EnumMapUI getCurrentUiMode() { - return mCurrentUIMode; - } - - @Override - public void changeMyLocation( Location location ) { - } - - @Override - public synchronized boolean isCarLocked() { - return mIsCarLocked; - } - - @Override - public void setCarCursorOption( CarCursorOption option ) { - if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) { - mCarCursorOption.destroy(); - } - if ( option != null ) { - try { - mCarCursorOption = option.clone(); - } catch ( Exception e ) { - mCarCursorOption = DEFAULT_OPTION; - } - } else { - mCarCursorOption = DEFAULT_OPTION; - } - if ( !checkMapView() ) { - return; - } - if ( mMapView.getMap() == null ) { - return; - } - MyLocationStyle style = getMyLocationStyle(); - if ( mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled() ) { - style.myLocationIcon( BitmapDescriptorFactory.fromBitmap( mCarCursorOption.getCarCursorBmp() ) ); - } else { - if ( mCarCursorOption.getCarCursorRes() != 0 ) { - style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) ); - } else { - style.myLocationIcon( BitmapDescriptorFactory.fromResource( DEFAULT_OPTION.getCarCursorRes() ) ); - } - } - mMapView.getMap().setMyLocationStyle( style ); - } - - @Override - public MapCameraPosition getMapCameraPosition() { - if ( checkMapView() ) { - CameraPosition cameraPosition = mMapView.getMap().getCameraPosition(); - return ObjectUtils.fromAMap( cameraPosition ); - } - return null; - } - - @Override - public void changeBearing( float bearing ) { - if ( checkMapView() ) { - mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) ); - } - } - - @Override - public long getTileId(double lon, double lat) { - return getMap().getUIController().getTileId(lon,lat); - } - - @Override - public void setAdasRecognizedResult(int drawlevel) { - - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapWrapper.java deleted file mode 100644 index b85f792310..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapWrapper.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.CameraUpdateFactory; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.PolylineOptions; -import com.amap.api.navi.AMapNaviView; -import com.mogo.map.IMogoMap; -import com.mogo.map.IMogoUiSettings; -import com.mogo.map.impl.amap.marker.AMapInfoWindowAdapter; -import com.mogo.map.impl.amap.marker.AMapMarkerWrapper; -import com.mogo.map.impl.amap.overlay.AMapPolylineWrapper; -import com.mogo.map.impl.amap.uicontroller.AMapUIController; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.map.marker.MogoMarkersHandler; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; -import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 代理高德AMap - */ -public class AMapWrapper implements IMogoMap { - - private static final String TAG = "AMapWrapper"; - - private static AMap sAMap; - private final Context mContext; - private IMogoMapUIController mUIcontroller; - private AMap mAMap; - private IMogoUiSettings mUiSettings; - - public AMapWrapper( AMap map, Context context, IMogoMapUIController controller ) { - this.mAMap = map; - sAMap = map; - mContext = context.getApplicationContext(); - mUIcontroller = controller; - // 设置实现自定义 info window - if(mAMap!=null) { - mAMap.setInfoWindowAdapter(new AMapInfoWindowAdapter()); - } - AMapUIController.getInstance().initClient( mUIcontroller ); - } - - public static AMap getAMap() { - return sAMap; - } - - public static void release(){ - sAMap = null; - } - - @Override - public IMogoUiSettings getUiSettings() { - if ( !checkAMap() ) { - return null; - } - if ( mUiSettings == null ) { - mUiSettings = new AMapUiSettingsWrapper( mAMap.getUiSettings() ); - } - return mUiSettings; - } - - @Override - public IMogoMapUIController getUIController() { - return mUIcontroller; - } - - @Override - public IMogoMarker addMarker( String tag, MogoMarkerOptions options ) { - if ( !checkAMap() ) { - return null; - } - MarkerOptions markerOptions = ObjectUtils.fromMogo( options ); - if ( markerOptions == null ) { - Logger.e( TAG, "marker参数为空" ); - return null; - } - final IMogoMarker mogoMarker = new AMapMarkerWrapper( mAMap.addMarker( markerOptions ), options ); - if ( options.isAutoManager() ) { - MogoMarkersHandler.getInstance().add( tag, mogoMarker ); - } - return mogoMarker; - } - - @Override - public ArrayList< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter ) { - if ( !checkAMap() ) { - return null; - } - - if ( options == null || options.isEmpty() ) { - return null; - } - - // 地图导航时,忽略参数 - if ( InterceptorHandler.getInstance().ignoreAddMarkersMoveToCenterParameters( getContext() ) ) { - moveToCenter = false; - } - - ArrayList< Marker > markers = null; - ArrayList< MarkerOptions > markerOptions = new ArrayList<>(); - ArrayList< IMogoMarker > mogoMarkers = new ArrayList<>(); - - for ( MogoMarkerOptions option : options ) { - if ( option == null ) { - continue; - } - MarkerOptions mo = ObjectUtils.fromMogo( option ); - if ( mo == null ) { - continue; - } - markerOptions.add( mo ); - } - if ( markerOptions.isEmpty() ) { - return null; - } - markers = mAMap.addMarkers( markerOptions, moveToCenter ); - if ( markers == null || markers.isEmpty() ) { - return null; - } - for ( int i = 0; i < markers.size(); i++ ) { - Marker marker = markers.get( i ); - if ( marker == null ) { - continue; - } - mogoMarkers.add( new AMapMarkerWrapper( marker, options.get( i ) ) ); - } - MogoMarkersHandler.getInstance().add( tag, mogoMarkers ); - return mogoMarkers; - } - - @Override - public void clear() { - if ( checkAMap() ) { - mAMap.clear(); - } - } - - @Override - public void clear( boolean isKeepMyLocationOverlay ) { - if ( checkAMap() ) { - mAMap.clear( isKeepMyLocationOverlay ); - } - } - - @Override - public void setPointToCenter( int x, int y ) { - if ( checkAMap() ) { - mAMap.setPointToCenter( x, y ); - } - } - - @Override - public void setTouchPoiEnable( boolean touchPoiEnable ) { - if ( checkAMap() ) { - mAMap.setTouchPoiEnable( touchPoiEnable ); - } - } - - @Override - public void setTrafficEnable( boolean enable ) { - if ( checkAMap() ) { - mAMap.setTrafficEnabled( enable ); - } - } - - @Override - public void showBuildings( boolean enabled ) { - if ( checkAMap() ) { - mAMap.showBuildings( enabled ); - } - } - - @Override - public void showIndoorMap( boolean enable ) { - if ( checkAMap() ) { - mAMap.showIndoorMap( enable ); - } - } - - @Override - public void showMapText( boolean enable ) { - if ( checkAMap() ) { - mAMap.showMapText( enable ); - } - } - - @Override - public void stopAnimation() { - if ( checkAMap() ) { - mAMap.stopAnimation(); - } - } - - @Override - public float getScalePerPixel() { - if ( checkAMap() ) { - return mAMap.getScalePerPixel(); - } - return 0; - } - - @Override - public void changeZoom( float zoom ) { - if ( checkAMap() ) { - mAMap.moveCamera( CameraUpdateFactory.zoomTo( zoom ) ); - } - } - - @Override - public float getZoomLevel() { - if ( checkAMap() ) { - try { - return mAMap.getCameraPosition().zoom; - } catch ( Exception e ) { - - } - } - return 0; - } - - @Override - public IMogoPolyline addPolyline( MogoPolylineOptions options ) { - if ( checkAMap() ) { - PolylineOptions polylineOptions = ObjectUtils.fromMogo( options ); - if ( polylineOptions == null ) { - return null; - } - Polyline polyline = mAMap.addPolyline( polylineOptions ); - return new AMapPolylineWrapper( polyline, options ); - } - return null; - } - - @Override - public String getMapVersion() { - return null; - } - - private boolean checkAMap() { - if ( mAMap == null ) { - Logger.e( TAG, "高德map实例为空,请检查" ); - return false; - } - return true; - } - - @Override - public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) { - return 0; - } - - private Context getContext() { - return mContext; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/IInterceptor.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/IInterceptor.java deleted file mode 100644 index a52ef55c39..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/IInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; - -/** - * @author congtaowang - * @since 2019-12-27 - *

- * 操作拦截器 - */ -public interface IInterceptor { - - /** - * 是否忽略添加多个marker时聚拢参数 - *

- * 导航时:不需要聚拢 - * - * @return true - 忽略 false - 不忽略 - */ - boolean ignoreAddMarkersMoveToCenterParameters( Context context ); - - /** - * 导航时,是否响应 poi 点击 - * - * @param context - * @return - */ - boolean ignorePoiClicked( Context context ); - - /** - * 导航时,是否响应地图点击 - * - * @param context - * @return - */ - boolean ignoreMapClicked( Context context ); - - /** - * 请求绘制路线 - * - * @param context - * @return - */ - boolean ignoreDrawRouteOverlay( Context context ); -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/InterceptorHandler.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/InterceptorHandler.java deleted file mode 100644 index 7ed3e125aa..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/InterceptorHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.mogo.map.impl.amap; - -import android.content.Context; - -import com.mogo.map.impl.amap.navi.NaviClient; - -/** - * @author congtaowang - * @since 2019-12-27 - *

- * 操作拦截器 - */ -public class InterceptorHandler implements IInterceptor { - - private static volatile InterceptorHandler sInstance; - - private Context mContext; - - private InterceptorHandler() { - } - - public static InterceptorHandler getInstance() { - if ( sInstance == null ) { - synchronized ( InterceptorHandler.class ) { - if ( sInstance == null ) { - sInstance = new InterceptorHandler(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - public void init( Context context ) { - mContext = context; - } - - @Override - public boolean ignoreAddMarkersMoveToCenterParameters( Context context ) { - return NaviClient.getInstance( context ).isNaviing(); - } - - @Override - public boolean ignorePoiClicked( Context context ) { - return NaviClient.getInstance( context ).isNaviing(); - } - - @Override - public boolean ignoreMapClicked( Context context ) { - return NaviClient.getInstance( context ).isNaviing(); - } - - @Override - public boolean ignoreDrawRouteOverlay( Context context ) { - return NaviClient.getInstance( context ).isNaviing(); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java deleted file mode 100644 index 82e014560a..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/hook/BnHooker.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.mogo.map.impl.amap.hook; - -import com.amap.api.maps.AMap; -import com.autonavi.amap.mapcore.interfaces.IAMap; -import com.autonavi.base.ae.gmap.GLMapEngine; -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; -import java.util.List; - -/** - * @author congtaowang - * @since 2020-03-12 - *

- * 描述 - */ -public class BnHooker implements InvocationHandler { - - private static final String TAG = "BnHooker"; - - private Object host; - private Method getGLMapEngineMethod; - private GLMapEngine glMapEngineObject; - - 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, - IAMap.class - }, - this - ); - field.set( map, object ); - - } - - public void clearAllMessages() throws Exception { - if ( glMapEngineObject == null ) { - if ( getGLMapEngineMethod == null ) { - getGLMapEngineMethod = host.getClass().getDeclaredMethod( "getGLMapEngine" ); - getGLMapEngineMethod.setAccessible( true ); - } - glMapEngineObject = ( GLMapEngine ) getGLMapEngineMethod.invoke( host ); - } - if ( glMapEngineObject != null ) { - clearMessageList( "mStateMessageList", glMapEngineObject ); - clearMessageList( "mAnimateStateMessageList", glMapEngineObject ); - } - } - - private void clearMessageList( String filedName, Object obj ) throws Exception { - Field stateMessageListField = obj.getClass().getDeclaredField( filedName ); - stateMessageListField.setAccessible( true ); - List valList = ( List ) stateMessageListField.get( obj ); - valList.clear(); - } - - @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 ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/location/ALocationClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/location/ALocationClient.java deleted file mode 100644 index 2a907e54d5..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/location/ALocationClient.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.mogo.map.impl.amap.location; - -import android.content.Context; -import android.os.Trace; - -import com.amap.api.location.AMapLocation; -import com.amap.api.location.AMapLocationClient; -import com.amap.api.location.AMapLocationClientOption; -import com.amap.api.location.AMapLocationListener; -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; -import java.util.Iterator; -import java.util.Set; - -/** - * @author congtaowang - * @since 2019-12-19 - *

- * 高德定位 - */ -public class ALocationClient implements IMogoLocationClient { - - private static final String TAG = "LocationClient"; - private final Context mContext; - - private MogoLocation mLastLocation; - private AMapLocationListener mListener = new InternalLocationListener(); - - private boolean mIsDestroyed = false; - - public ALocationClient( Context context ) { - mContext = context; - } - - private AMapLocationClient mClient; - - @Override - public void start() { - start( 2_000L ); - } - - @Override - public void start( long interval ) { - if ( mClient == null ) { - mClient = new AMapLocationClient( mContext ); - mClient.setLocationListener( mListener ); - mLastLocation = ObjectUtils.fromAMap( mClient.getLastKnownLocation() ); - } - if ( !mClient.isStarted() ) { - AMapLocationClientOption option = new AMapLocationClientOption(); - option.setLocationMode( AMapLocationClientOption.AMapLocationMode.Hight_Accuracy ); - option.setNeedAddress( true ); - option.setGpsFirst( true ); - option.setInterval( interval ); - mClient.setLocationOption( option ); - mClient.startLocation(); - } - } - - @Override - public void stop() { - if ( mIsDestroyed ) { - destroyWarming(); - return; - } - if ( mClient != null && mClient.isStarted() ) { - mClient.stopLocation(); - } - } - - @Override - public void addLocationListener( IMogoLocationListener listener ) { - // do not impl. - } - - @Override - public void removeLocationListener( IMogoLocationListener listener ) { - // do not impl. - } - - @Override - public MogoLocation getLastKnowLocation() { - if ( mIsDestroyed ) { - destroyWarming(); - return null; - } - if ( mLastLocation == null ) { - mLastLocation = new MogoLocation(); - } - return mLastLocation; - } - - @Override - public synchronized void destroy() { - mIsDestroyed = true; - if ( mClient != null ) { - mClient.unRegisterLocationListener( mListener ); - mClient.stopLocation(); - mClient.onDestroy(); - } - mClient = null; - mLastLocation = null; - } - - private class InternalLocationListener implements AMapLocationListener { - @Override - public void onLocationChanged( AMapLocation aMapLocation ) { - if ( mIsDestroyed ) { - destroyWarming(); - return; - } - if ( aMapLocation == null || - aMapLocation.getLatitude() == 0.0D || - aMapLocation.getLongitude() == 0.0D ) { - return; - } - Trace.beginSection( "timer.onLocationChanged" ); - mLastLocation = ObjectUtils.fromAMap( aMapLocation ); - Set listeners = MogoLocationListenerRegister.getInstance().getListeners(); - synchronized ( listeners ) { - Iterator< IMogoLocationListener > listenerIterator = listeners.iterator(); - while ( listenerIterator.hasNext() ) { - listenerIterator.next().onLocationChanged( mLastLocation ); - } - } - Trace.endSection(); - } - } - - private void destroyWarming() { - Logger.w( TAG, "location client has destroyed." ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapInfoWindowAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapInfoWindowAdapter.java deleted file mode 100644 index fa7a13eae3..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapInfoWindowAdapter.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.mogo.map.impl.amap.marker; - -import android.view.View; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.model.Marker; -import com.mogo.map.marker.IMogoInfoWindowAdapter; -import com.mogo.map.marker.IMogoMarker; - -/** - * @author congtaowang - * @since 2019-12-24 - *

- * 自定义infowindow - */ -public final class AMapInfoWindowAdapter implements AMap.InfoWindowAdapter { - - @Override - public View getInfoWindow( Marker marker ) { - if ( marker.getObject() instanceof IMogoMarker ) { - IMogoMarker mogoMarker = ( ( IMogoMarker ) marker.getObject() ); - IMogoInfoWindowAdapter delegate = mogoMarker.getInfoWindowAdapter(); - if ( delegate != null ) { - return delegate.getInfoWindow( mogoMarker ); - } - } - - return null; - } - - @Override - public View getInfoContents( Marker marker ) { - return null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java deleted file mode 100644 index 9b63643fba..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/AMapMarkerWrapper.java +++ /dev/null @@ -1,552 +0,0 @@ -package com.mogo.map.impl.amap.marker; - -import android.graphics.Bitmap; -import android.graphics.Point; -import android.view.View; -import android.view.animation.Interpolator; - -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.animation.AlphaAnimation; -import com.amap.api.maps.model.animation.Animation; -import com.amap.api.maps.model.animation.AnimationSet; -import com.amap.api.maps.model.animation.ScaleAnimation; -import com.amap.api.maps.model.animation.TranslateAnimation; -import com.amap.api.maps.utils.overlay.MovingPointOverlay; -import com.autonavi.amap.mapcore.IPoint; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.AMapWrapper; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.marker.IMogoInfoWindowAdapter; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.map.marker.IMogoMarkerIconViewCreator; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.map.marker.anim.OnMarkerAnimationListener; -import com.mogo.utils.WindowUtils; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; -import java.util.List; -import java.util.Observable; -import java.util.Observer; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 高德marker - */ -public class AMapMarkerWrapper implements IMogoMarker, Observer { - - private final String TAG = AMapMarkerWrapper.class.getName(); - - private Marker mMarker; - private Object mObject; - private IMogoMarkerClickListener mMogoMarkerClickListener; - private IMogoInfoWindowAdapter mMogoInfoWindowAdapter; - - private boolean mIsDestroy = false; - - private MogoMarkerOptions mMogoMarkerOptions; - private String mOwner; - - private MovingPointOverlay mMovingPointOverlay; - - public AMapMarkerWrapper( Marker marker, MogoMarkerOptions mogoMarkerOptions ) { - this.mMarker = marker; - if ( marker != null ) { - // 设置高德 marker 的object对象为 IMogoMarker 实例。!!!! - marker.setObject( this ); - } - setObject( mogoMarkerOptions.getObject() ); - this.mMogoMarkerOptions = mogoMarkerOptions; - mMogoMarkerOptions.addObserver( this ); - } - - @Override - public void update( Observable o, Object arg ) { - if ( isDestroyed() ) { - return; - } - setMarkerOptions( mMogoMarkerOptions ); - } - - @Override - public void destroy() { - if ( mMogoMarkerOptions != null ) { - mMogoMarkerOptions.deleteObservers(); - mMogoMarkerOptions = null; - } - if ( mMarker != null ) { - mMarker.setObject( null ); - mMarker.remove(); - mMarker = null; - } - if ( mMovingPointOverlay != null ) { - try { - mMovingPointOverlay.stopMove(); - mMovingPointOverlay.destroy(); - } catch ( Exception e ) { - e.printStackTrace(); - } - mMovingPointOverlay = null; - } - mMogoInfoWindowAdapter = null; - mMogoMarkerClickListener = null; - mObject = null; - mIsDestroy = true; - } - - @Override - public void remove() { - destroy(); - } - - @Override - public void hideInfoWindow() { - if ( mMarker != null ) { - mMarker.hideInfoWindow(); - } - } - - @Override - public void setAlpha( float alpha ) { - if ( mMarker != null ) { - mMarker.setAlpha( alpha ); - } - } - - @Override - public void setAnchor( float anchorU, float anchorV ) { - if ( mMarker != null ) { - mMarker.setAnchor( anchorU, anchorV ); - } - } - - @Override - public void setDraggable( boolean paramBoolean ) { - if ( mMarker != null ) { - mMarker.setDraggable( paramBoolean ); - } - } - - @Override - public void setIcon( Bitmap icon ) { - if ( icon == null || icon.isRecycled() ) { - return; - } - if ( mMarker != null ) { - mMarker.setIcon( BitmapDescriptorFactory.fromBitmap( icon ) ); - } - } - - @Override - public void setIcons( ArrayList< Bitmap > icons ) { - if ( icons == null || icons.isEmpty() ) { - return; - } - ArrayList< BitmapDescriptor > descriptors = new ArrayList<>(); - for ( Bitmap icon : icons ) { - if ( icon == null || icon.isRecycled() ) { - continue; - } - descriptors.add( BitmapDescriptorFactory.fromBitmap( icon ) ); - } - if ( descriptors.isEmpty() ) { - return; - } - if ( mMarker != null ) { - mMarker.setIcons( descriptors ); - } - } - - @Override - public void setInfoWindowEnable( boolean enabled ) { - if ( mMarker != null ) { - mMarker.setInfoWindowEnable( enabled ); - } - } - - @Override - public void setMarkerOptions( MogoMarkerOptions opt ) { - - final MarkerOptions options = ObjectUtils.fromMogo( opt ); - if ( options == null ) { - return; - } - if ( mMarker != null ) { - mMarker.setMarkerOptions( options ); - setObject( opt.getObject() ); - } - } - - @Override - public void setObject( Object object ) { - mObject = object; - } - - @Override - public Object getObject() { - return mObject; - } - - @Override - public void setPeriod( int period ) { - if ( mMarker != null ) { - mMarker.setPeriod( period ); - } - } - - @Override - public void setPosition( double lat, double lng ) { - if ( mMarker != null ) { - mMarker.setPosition( new LatLng( lat, lng ) ); - } - } - - @Override - public MogoLatLng getPosition() { - if ( mMarker != null ) { - final LatLng latLng = mMarker.getPosition(); - return ObjectUtils.fromAMap( latLng ); - } - return null; - } - - @Override - public void setRotateAngle( float rotate ) { - if ( mMarker != null ) { - mMarker.setRotateAngle( rotate ); - } - } - - @Override - public void setSnippet( String snippet ) { - if ( mMarker != null ) { - mMarker.setSnippet( snippet ); - } - } - - @Override - public void setTitle( String title ) { - if ( mMarker != null ) { - mMarker.setTitle( title ); - } - } - - @Override - public void setToTop() { - if ( mMarker != null ) { - mMarker.setToTop(); - } - } - - @Override - public void setVisible( boolean visible ) { - if ( mMarker != null ) { - mMarker.setVisible( visible ); - } - } - - @Override - public void setZIndex( int zIndex ) { - if ( mMarker != null ) { - mMarker.setZIndex( zIndex ); - } - } - - @Override - public void showInfoWindow() { - if ( mMarker != null ) { - mMarker.showInfoWindow(); - } - } - - @Override - public String getMarkerAssInfo() { - return null; - } - - @Override - public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) { - mMogoMarkerClickListener = listener; - } - - @Override - public IMogoMarkerClickListener getOnMarkerClickListener() { - return mMogoMarkerClickListener; - } - - @Override - public void setInfoWindowAdapter( IMogoInfoWindowAdapter adapter ) { - mMogoInfoWindowAdapter = adapter; - } - - @Override - public IMogoInfoWindowAdapter getInfoWindowAdapter() { - return mMogoInfoWindowAdapter; - } - - @Override - public void setMarkerIconView( IMogoMarkerIconViewCreator creator ) { - if ( creator != null ) { - View iconView = creator.createView( this ); - if ( iconView != null ) { - mMarker.setIcon( BitmapDescriptorFactory.fromView( iconView ) ); - } - } - } - - @Override - public boolean isDestroyed() { - return mIsDestroy; - } - - @Override - public void setOwner( String mOwner ) { - this.mOwner = mOwner; - } - - @Override - public String getOwner() { - if ( mOwner != null ) { - return mOwner; - } - if ( mMogoMarkerOptions != null ) { - return mMogoMarkerOptions.getOwner(); - } - return null; - } - - @Override - public void setPositionByPixels( Point position ) { - if ( mMarker != null ) { - mMarker.setPositionByPixels( position.x, position.y ); - } - } - - public Marker getMarker() { - return mMarker; - } - - @Override - public MogoMarkerOptions getMogoMarkerOptions() { - return mMogoMarkerOptions; - } - - @Override - public void startScaleAnimation( float fromX, float toX, float fromY, float toY, int duration, Interpolator interpolator ) { - if ( isDestroyed() ) { - return; - } - - ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY ); - animationScale.setDuration( duration ); - animationScale.setFillMode( Animation.FILL_MODE_FORWARDS ); - if ( interpolator != null ) { - animationScale.setInterpolator( interpolator ); - } - - mMarker.setAnimation( animationScale ); - try { - mMarker.startAnimation(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - @Override - public void startScaleAnimation( float fromX, float toX, float fromY, float toY, int duration, Interpolator interpolator, OnMarkerAnimationListener listener ) { - if ( isDestroyed() ) { - return; - } - - ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY ); - animationScale.setDuration( duration ); - animationScale.setFillMode( Animation.FILL_MODE_FORWARDS ); - if ( interpolator != null ) { - animationScale.setInterpolator( interpolator ); - } - animationScale.setAnimationListener( new Animation.AnimationListener() { - @Override - public void onAnimationStart() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimStart(); - } - } - - @Override - public void onAnimationEnd() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimEnd(); - } - } - } ); - - mMarker.setAnimation( animationScale ); - mMarker.startAnimation(); - } - - @Override - public void startScaleAnimationWithAlpha( float fromX, float toX, float fromY, float toY, float fromAlpha, float toAlpha, int duration, Interpolator interpolator, OnMarkerAnimationListener listener ) { - if ( isDestroyed() ) { - return; - } - - ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY ); - animationScale.setFillMode( Animation.FILL_MODE_FORWARDS ); - - AlphaAnimation alphaAnimation = new AlphaAnimation( fromAlpha, toAlpha ); - alphaAnimation.setFillMode( Animation.FILL_MODE_FORWARDS ); - - AnimationSet animationSet = new AnimationSet( true ); - animationSet.setDuration( duration ); - if ( interpolator != null ) { - animationSet.setInterpolator( interpolator ); - } - animationSet.setAnimationListener( new Animation.AnimationListener() { - @Override - public void onAnimationStart() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimStart(); - } - } - - @Override - public void onAnimationEnd() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimEnd(); - } - } - } ); - - mMarker.setAnimation( animationSet ); - try { - mMarker.startAnimation(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - @Override - public void startJumpAnimation( float high, long duration, Interpolator interpolator, OnMarkerAnimationListener listener ) { - if ( isDestroyed() || high <= 0.0f || interpolator == null || duration < 0 ) { - return; - } - try { - final LatLng latLng = ObjectUtils.fromMogo2( getPosition() ); - Point point = AMapWrapper.getAMap().getProjection().toScreenLocation( latLng ); - point.y -= WindowUtils.dip2px( AbsMogoApplication.getApp(), high ); - LatLng target = AMapWrapper.getAMap().getProjection().fromScreenLocation( point ); - //使用TranslateAnimation,填写一个需要移动的目标点 - Animation animation = new TranslateAnimation( target ); - animation.setInterpolator( interpolator ); - animation.setAnimationListener( new Animation.AnimationListener() { - @Override - public void onAnimationStart() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimStart(); - } - } - - @Override - public void onAnimationEnd() { - if ( isDestroyed() ) { - return; - } - if ( listener != null ) { - listener.onAnimEnd(); - } - } - } ); - //整个移动所需要的时间 - animation.setDuration( duration ); - //设置动画 - mMarker.setAnimation( animation ); - mMarker.startAnimation(); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - @Override - public void setClickable( boolean clickable ) { - if ( mMarker != null ) { - mMarker.setClickable( clickable ); - } - } - - @Override - public void startSmooth( List< MogoLatLng > points, int duration ) { - - if ( isDestroyed() ) { - return; - } - - if ( mMarker == null ) { - return; - } - - if ( points == null || points.isEmpty() ) { - return; - } - - List< LatLng > newPoints = new ArrayList<>(); - for ( int i = 0; i < points.size(); i++ ) { - LatLng point = ObjectUtils.fromMogo2( points.get( i ) ); - if ( point == null ) { - continue; - } - newPoints.add( point ); - } - if ( newPoints.isEmpty() ) { - return; - } - if ( mMovingPointOverlay == null ) { - mMovingPointOverlay = new MovingPointOverlay( AMapWrapper.getAMap(), mMarker ); - } - mMovingPointOverlay.setPoints( newPoints ); - mMovingPointOverlay.setTotalDuration( duration ); - mMovingPointOverlay.startSmoothMove(); - } - - @Override - public void startSmoothInMs( List< MogoLatLng > points, long duration ) { - startSmooth( points, ( ( int ) ( duration / 1000 ) ) ); - } - - @Override - public boolean isInfoWindowShowing() { - if ( mMarker == null ) { - return false; - } - return mMarker.isInfoWindowShown(); - } - - @Override - public void setGps( boolean isGps ) { - MarkerOptions options = mMarker.getOptions(); - options.setGps( isGps ); - mMarker.setMarkerOptions( options ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/CombineMovingPointOverlay.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/CombineMovingPointOverlay.java deleted file mode 100644 index 4d7d1fb929..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/marker/CombineMovingPointOverlay.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.mogo.map.impl.amap.marker; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.AMapUtils; -import com.amap.api.maps.model.BasePointOverlay; -import com.amap.api.maps.model.LatLng; -import com.autonavi.amap.mapcore.IPoint; -import com.autonavi.amap.mapcore.MapProjection; -import com.mogo.utils.logger.Logger; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * @author congtaowang - * @since 2020/6/15 - *

- */ -class CombineMovingPointOverlay { - - private static final String TAG = "CombineMovingPointOverlay"; - - private AMap mAMap; - private long mDuration = 1_000L; - private long mStepDuration = 20L; - private LinkedList< LatLng > mPoints = new LinkedList<>(); - private LinkedList< Double > mEachDistance = new LinkedList<>(); - - private double mTotalDistance = 0.0D; - private double mRemainDistance = 0.0D; - private ExecutorService mThreadPools; - private Object mLock = new Object(); - private BasePointOverlay mBaseOverlay = null; - private int mIndex = 0; - private boolean mUseDefaultDescriptor = false; - AtomicBoolean mExitFlag = new AtomicBoolean( false ); - private MoveListener mMoveListener; - private Status mStatus; - private long mPauseMillis; - private long mAnimationBeginTime; - - public CombineMovingPointOverlay( AMap amap, BasePointOverlay baseOverlay ) { - mStatus = Status.Status1; - mAnimationBeginTime = System.currentTimeMillis(); - if ( amap != null && baseOverlay != null ) { - this.mAMap = amap; - this.mBaseOverlay = baseOverlay; - mThreadPools = new ThreadPoolExecutor( 1, 2, 5L, TimeUnit.SECONDS, new SynchronousQueue(), new ThreadFactoryImpl() ); - } - } - - public void setMoveListener( MoveListener moveListener ) { - this.mMoveListener = moveListener; - } - - public void setPoints( List< LatLng > list ) { - synchronized ( mLock ) { - if ( list != null && list.size() >= 2 ) { - stopMove(); - if ( mPoints != null ) { - mPoints.clear(); - } - Iterator< LatLng > iterator = list.listIterator(); - while ( iterator.hasNext() ) { - LatLng latLng = iterator.next(); - if ( latLng != null ) { - mPoints.add( latLng ); - } - } - - mEachDistance.clear(); - mTotalDistance = 0.0D; - - for ( int i = 0; i < mPoints.size(); i++ ) { - double distance = AMapUtils.calculateLineDistance( mPoints.get( i ), mPoints.get( i + 1 ) ); - mEachDistance.add( distance ); - mTotalDistance += distance; - } - - mRemainDistance = mTotalDistance; - mBaseOverlay.setPosition( mPoints.get( 0 ) ); - reset(); - } - } - } - - - public int getIndex() { - return mIndex; - } - - public BasePointOverlay getBaseOverlay() { - return mBaseOverlay; - } - - public void destroy() { - try { - removeMarker(); - mThreadPools.shutdown(); - synchronized ( mLock ) { - mPoints.clear(); - mEachDistance.clear(); - ; - } - } catch ( Exception e ) { - - } - } - - public void removeMarker() { - try { - reset(); - if ( mBaseOverlay != null ) { - mBaseOverlay.remove(); - mBaseOverlay = null; - } - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - public void stopMove() { - if ( mStatus == Status.Status3 ) { - mStatus = Status.Status4; - mPauseMillis = System.currentTimeMillis(); - } - } - - private void reset() { - if ( mStatus == Status.Status3 || mStatus == Status.Status4 ) { - mExitFlag.set( true ); - try { - mThreadPools.awaitTermination( mStepDuration + 20L, TimeUnit.MICROSECONDS ); - mBaseOverlay.setAnimation( null ); - mStatus = Status.Status1; - } catch ( InterruptedException e ) { - Logger.e( TAG, e, "error." ); - } - } - } - - public void resetIndex() { - mIndex = 0; - } - - - public void setTotalDuration( int seconds ) { - mDuration = seconds * 1_000L; - } - - public void startSmoothMove() { - if ( mStatus == Status.Status4 ) { - mStatus = Status.Status3; - long interval = System.currentTimeMillis() - mPauseMillis; - mAnimationBeginTime += interval; - } else { - if ( mStatus == Status.Status1 || mStatus == Status.Status5 ) { - if ( mPoints.size() <= 0 ) { - return; - } - mIndex = 0; - mThreadPools.execute( new MarkerMovingRunnable() ); - } - } - } - - public void setVisible( boolean visible ) { - if ( mBaseOverlay != null ) { - try { - mBaseOverlay.setVisible( visible ); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - } - - private class MarkerMovingRunnable implements Runnable { - - @Override - public void run() { - mAnimationBeginTime = System.currentTimeMillis(); - mStatus = Status.Status2; - mExitFlag.set( false ); - - try { - for ( ; !mExitFlag.get() && mIndex <= mPoints.size() - 1; Thread.sleep( mStepDuration ) ) { - synchronized ( mLock ) { - if ( mExitFlag.get() ) { - return; - } - if ( mStatus == Status.Status4 ) { - long interval = System.currentTimeMillis() - mAnimationBeginTime; - IPoint point = getCurPosition( interval ); - mBaseOverlay.setGeoPoint( point ); - mStatus = Status.Status3; - } - } - } - mStatus = Status.Status5; - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - } - - private IPoint getCurPosition( long interval ) { - if ( interval > mDuration ) { - mExitFlag.set( true ); - IPoint point = new IPoint(); - mIndex = mPoints.size() - 1; - LatLng latLng = mPoints.get( mIndex ); - --mIndex; - mIndex = Math.max( mIndex, 0 ); - mRemainDistance = 0.0D; - MapProjection.lonlat2Geo( latLng.longitude, latLng.latitude, point ); - if ( mMoveListener != null ) { - mMoveListener.move( mRemainDistance ); - } - return point; - } else { - double step = interval * mTotalDistance / mDuration; - mRemainDistance = mTotalDistance - step; - int targetIndex = 0; - double val = 1.0D; - - for ( int i = 0; i < mEachDistance.size(); i++ ) { - double distance = mEachDistance.get( i ); - if ( step <= distance ) { - if ( distance > 0.0D ) { - val = step / distance; - } - targetIndex = i; - break; - } - step -= distance; - } - - if ( targetIndex != mIndex && mMoveListener != null ) { - mMoveListener.move( mRemainDistance ); - } - - mIndex = targetIndex; - LatLng latLng = mPoints.get( mIndex ); - LatLng latLng1 = mPoints.get( mIndex + 1 ); - IPoint point = new IPoint(); - MapProjection.lonlat2Geo( latLng.longitude, latLng.latitude, point ); - IPoint point1 = new IPoint(); - MapProjection.lonlat2Geo( latLng1.longitude, latLng1.latitude, point1 ); - - int xDelta = point1.x - point.x; - int yDelta = point1.y - point.y; - - if ( AMapUtils.calculateLineDistance( latLng, latLng1 ) > 1.0F ) { - float rotate = getRotate( point, point1 ); - setRotate( rotate ); - } - return new IPoint( ( ( int ) ( point.x + ( ( double ) xDelta ) * val ) ), ( ( int ) ( point.y + ( ( double ) yDelta ) * val ) ) ); - } - } - - private float getRotate( IPoint point, IPoint point1 ) { - if ( point != null && point1 != null ) { - double py1 = ( double ) point1.y; - double py = ( double ) point.y; - double px = ( double ) point.x; - return ( float ) ( Math.atan2( ( double ) point1.x - px, py - py1 ) / 3.141592653589793D * 180.0D ); - } else { - return 0.0F; - } - } - - public void setPoint( LatLng latLng ) { - if ( mBaseOverlay != null ) { - try { - mBaseOverlay.setPosition( latLng ); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - } - - public void setRotate( float rotate ) { - if ( mBaseOverlay == null ) { - return; - } - if ( mAMap == null ) { - return; - } - if ( mAMap.getCameraPosition() == null ) { - return; - } - mBaseOverlay.setRotateAngle( 360.0F - rotate + mAMap.getCameraPosition().bearing ); - } - - public LatLng getPosition() { - if ( mBaseOverlay != null ) { - return mBaseOverlay.getPosition(); - } - return null; - } - - private enum Status { - Status1, - Status2, - Status3, - Status4, - Status5 - } - - public interface MoveListener { - void move( double val ); - } - - private static class ThreadFactoryImpl implements ThreadFactory { - - private static int mCounter = 1; - - @Override - public Thread newThread( Runnable r ) { - return new Thread( r, "MoveSmoothThread - " + mCounter++ ); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageConsts.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageConsts.java deleted file mode 100644 index 37fb4c056f..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageConsts.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.mogo.map.impl.amap.message; - -import android.os.Handler; -import android.os.Looper; -import android.os.Message; - -import androidx.annotation.NonNull; - -/** - * @author congtaowang - * @since 2019-12-28 - *

- * 描述 - */ -public class AMapMessageConsts { - - /** - * 导航开始 - */ - public static final int MSG_NAVI_START = 1000; - /** - * 取消导航 - */ - public static final int MSG_NAVI_STOP = 1001; - /** - * 规划路线成功 - */ - public static final int MSG_CALCULATE_SUCCESS = 1002; - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageListener.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageListener.java deleted file mode 100644 index d183bd1124..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageListener.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.mogo.map.impl.amap.message; - -import com.amap.api.navi.model.NaviInfo; - -/** - * @author congtaowang - * @since 2019-12-28 - *

- * 消息回调 - */ -public interface AMapMessageListener { - - void onNaviStarted(); - - void onNaviStopped(); - - void onNaviInfoUpdat( NaviInfo naviInfo ); - - void onCalculateSuccess(); -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageManager.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageManager.java deleted file mode 100644 index caccdd97b0..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/message/AMapMessageManager.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.mogo.map.impl.amap.message; - -import android.os.Handler; -import android.os.Looper; -import android.os.Message; - -import androidx.annotation.NonNull; - -import com.amap.api.navi.model.NaviInfo; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-28 - *

- * 描述 - */ -public class AMapMessageManager { - - private static volatile AMapMessageManager sInstance; - - private List< AMapMessageListener > mListeners = new ArrayList<>(); - - private AMapMessageManager() { - } - - public static AMapMessageManager getInstance() { - if ( sInstance == null ) { - synchronized ( AMapMessageManager.class ) { - if ( sInstance == null ) { - sInstance = new AMapMessageManager(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - public synchronized void registerAMapMessageListener( AMapMessageListener listener ) { - if ( !mListeners.contains( listener ) ) { - mListeners.add( listener ); - } - } - - public synchronized void clear(){ - if ( mListeners != null ) { - mListeners.clear(); - } - } - - public synchronized void unregisterAMapMessageListener( AMapMessageListener listener ) { - mListeners.remove( listener ); - } - - private Handler mHandler = new Handler( Looper.getMainLooper() ) { - @Override - public void handleMessage( @NonNull Message msg ) { - super.handleMessage( msg ); - AMapMessageManager.this.handleMessage( msg ); - } - }; - - public void sendMessage( Message msg ) { - if ( msg != null ) { - mHandler.sendMessage( msg ); - } - } - - public void sendMessage( int what ) { - sendMessage( what, null ); - } - - public void sendMessage( int what, Object obj ) { - Message msg = Message.obtain(); - msg.what = what; - msg.obj = obj; - sendMessage( msg ); - } - - public void postNaviStarted() { - sendMessage( AMapMessageConsts.MSG_NAVI_START ); - } - - public void postNaviStopped() { - sendMessage( AMapMessageConsts.MSG_NAVI_STOP ); - } - - public void postCalculateSuccess() { - sendMessage( AMapMessageConsts.MSG_CALCULATE_SUCCESS ); - } - - private synchronized void handleMessage( Message msg ) { - if ( msg == null ) { - return; - } - switch ( msg.what ) { - case AMapMessageConsts.MSG_NAVI_START: - handleNaviStartedMsg(); - break; - case AMapMessageConsts.MSG_NAVI_STOP: - handleNaviStoppedMsg(); - break; - case AMapMessageConsts.MSG_CALCULATE_SUCCESS: - handleCalculateSuccessMsg(); - break; - } - } - - private void handleNaviStartedMsg() { - if ( mListeners == null ) { - return; - } - for ( AMapMessageListener listener : mListeners ) { - listener.onNaviStarted(); - } - } - - private void handleNaviStoppedMsg() { - if ( mListeners == null ) { - return; - } - for ( AMapMessageListener listener : mListeners ) { - listener.onNaviStopped(); - } - } - - private void handleCalculateSuccessMsg() { - if ( mListeners == null ) { - return; - } - for ( AMapMessageListener listener : mListeners ) { - listener.onCalculateSuccess(); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java deleted file mode 100644 index 7027991eaa..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AMapNaviListenerAdapter.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import com.amap.api.navi.AMapNaviListener; -import com.amap.api.navi.model.AMapCalcRouteResult; -import com.amap.api.navi.model.AMapLaneInfo; -import com.amap.api.navi.model.AMapModelCross; -import com.amap.api.navi.model.AMapNaviCameraInfo; -import com.amap.api.navi.model.AMapNaviCross; -import com.amap.api.navi.model.AMapNaviInfo; -import com.amap.api.navi.model.AMapNaviLocation; -import com.amap.api.navi.model.AMapNaviRouteNotifyData; -import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo; -import com.amap.api.navi.model.AMapServiceAreaInfo; -import com.amap.api.navi.model.AimLessModeCongestionInfo; -import com.amap.api.navi.model.AimLessModeStat; -import com.amap.api.navi.model.NaviInfo; -import com.autonavi.tbt.TrafficFacilityInfo; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.voice.AIAssist; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.utils.logger.Logger; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-25 - *

- * 高德导航事件:导航事件 - */ -public abstract class AMapNaviListenerAdapter implements AMapNaviListener { - - private static final String TAG = "AMapNaviListenerAdapter"; - protected String mLastSpeakWord; - - @Override - public void onInitNaviFailure() { - - } - - @Override - public void onInitNaviSuccess() { - - } - - @Override - public void onStartNavi( int i ) { - - } - - @Override - public void onTrafficStatusUpdate() { - - } - - @Override - public void onLocationChange( AMapNaviLocation aMapNaviLocation ) { - - } - - @Override - public void onGetNavigationText( int i, String s ) { - - } - - @Override - public void onGetNavigationText( String s ) { - mLastSpeakWord = s; - Logger.d( TAG, s ); -// TTSSpeaker.getInstance().speakTTS( s ); - } - - @Override - public void onEndEmulatorNavi() { - - } - - @Override - public void onArriveDestination() { - - } - - @Override - public void onCalculateRouteFailure( int i ) { - - } - - @Override - public void onReCalculateRouteForYaw() { - - } - - @Override - public void onReCalculateRouteForTrafficJam() { - - } - - @Override - public void onArrivedWayPoint( int i ) { - - } - - @Override - public void onGpsOpenStatus( boolean b ) { - - } - - @Override - public void onNaviInfoUpdate( NaviInfo naviInfo ) { - - } - - @Override - public void onNaviInfoUpdated( AMapNaviInfo aMapNaviInfo ) { - - } - - @Override - public void updateCameraInfo( AMapNaviCameraInfo[] aMapNaviCameraInfos ) { - - } - - @Override - public void updateIntervalCameraInfo( AMapNaviCameraInfo aMapNaviCameraInfo, AMapNaviCameraInfo aMapNaviCameraInfo1, int i ) { - if ( aMapNaviCameraInfo != null ) { - Logger.i( TAG, "current camera speed: %d, status = %d", aMapNaviCameraInfo.getCameraSpeed(), i ); - } - if ( aMapNaviCameraInfo1 != null ) { - Logger.i( TAG, "current camera speed: %d, status = %d", aMapNaviCameraInfo1.getCameraSpeed(), i ); - } - } - - - @Override - public void onServiceAreaUpdate( AMapServiceAreaInfo[] aMapServiceAreaInfos ) { - - } - - @Override - public void showCross( AMapNaviCross aMapNaviCross ) { - - } - - @Override - public void hideCross() { - - } - - @Override - public void showModeCross( AMapModelCross aMapModelCross ) { - - } - - @Override - public void hideModeCross() { - - } - - @Override - public void showLaneInfo( AMapLaneInfo[] aMapLaneInfos, byte[] bytes, byte[] bytes1 ) { - - } - - @Override - public void showLaneInfo( AMapLaneInfo aMapLaneInfo ) { - - } - - @Override - public void hideLaneInfo() { - - } - - @Override - public void onCalculateRouteSuccess( int[] ints ) { - - } - - @Override - public void notifyParallelRoad( int i ) { - - } - - @Override - public void OnUpdateTrafficFacility( AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) { - - } - - @Override - public void OnUpdateTrafficFacility( AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo ) { - - } - - @Override - public void OnUpdateTrafficFacility( TrafficFacilityInfo trafficFacilityInfo ) { - - } - - /** - * 巡航回调 - * 连续5个点速度大于15km/h后触发 updateAimlessModeStatistics 回调,通过 AimLessModeStat 对象可获取巡航的连续行驶距离和连续启用时间 - * - * @param aimLessModeStat - */ - @Override - public void updateAimlessModeStatistics( AimLessModeStat aimLessModeStat ) { - - } - - /** - * 巡航回调 - * 出现拥堵长度大于500米且拥堵时间大于5分钟时,会进到 updateAimlessModeCongestionInfo 回调中,通过 AimLessModeCongestionInfo 对象,可获取到道路拥堵信息(如:导致拥堵的事件类型、拥堵的状态等) - * - * @param aimLessModeCongestionInfo - */ - @Override - public void updateAimlessModeCongestionInfo( AimLessModeCongestionInfo aimLessModeCongestionInfo ) { - - } - - @Override - public void onPlayRing( int i ) { - - } - - @Override - public void onCalculateRouteSuccess( AMapCalcRouteResult aMapCalcRouteResult ) { - - } - - @Override - public void onCalculateRouteFailure( AMapCalcRouteResult aMapCalcRouteResult ) { - - } - - @Override - public void onNaviRouteNotify( AMapNaviRouteNotifyData aMapNaviRouteNotifyData ) { - - } - - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessClient.java deleted file mode 100644 index 2f26f68685..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessClient.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.content.Context; - -import com.amap.api.navi.AMapNavi; -import com.amap.api.navi.enums.AimLessMode; -import com.mogo.map.navi.IMogoAimless; -import com.mogo.utils.logger.Logger; -import com.mogo.utils.storage.SharedPrefsMgr; - -/** - * @author donghongyu - * @since 2020-11-05 - *

- * 高德巡航 - */ -public class AimlessClient implements IMogoAimless { - - /** - * 巡航状态控制 - */ - public static final String KEY_AIMLESS_STATUS = "KEY_AIMLESS_STATUS"; - - private static final String TAG = "AimlessClient"; - private final Context mContext; - - private AMapNavi mAMapNavi; - - private AimlessModeListenerAdapter mAimlessModeListener; - - private static volatile AimlessClient sInstance; - - /** - * 巡航模式配置状态 - */ - private boolean mAimlessModeStatus; - - /** - * 巡航状态 - */ - private boolean mAimlessStatus; - - private AimlessClient(Context context) { - mContext = context.getApplicationContext(); - // 按需初始化高德导航组件 - initAMapNavi(); - } - - /** - * 初始化导航组件 - */ - private void initAMapNavi() { - Logger.d(TAG, "initAMapNavi"); - if (mAMapNavi != null) { - return; - } - mAMapNavi = AMapNavi.getInstance(mContext); - mAMapNavi.setEmulatorNaviSpeed(120); - mAMapNavi.setUseInnerVoice(true, true); - mAMapNavi.stopSpeak(); - mAimlessModeListener = new AimlessModeListenerAdapter() { - }; - mAMapNavi.addAimlessModeListener(mAimlessModeListener); - mAimlessModeStatus = SharedPrefsMgr.getInstance(mContext).getBoolean(KEY_AIMLESS_STATUS, false); - } - - public static AimlessClient getInstance(Context context) { - if (sInstance == null) { - synchronized (AimlessClient.class) { - if (sInstance == null) { - sInstance = new AimlessClient(context); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - private boolean checkAMapNavi() { - if (mAMapNavi == null) { - Logger.e(TAG, "高德导航实例为空!!!"); - return false; - } - return true; - } - - @Override - public void startAimlessMode() { - if (!checkAMapNavi()) { - return; - } - if (mAimlessModeStatus) { - mAMapNavi.startAimlessMode(AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED); - mAimlessStatus = true; - Logger.d(TAG, "开启巡航成功"); - } else { - mAimlessStatus = false; - Logger.d(TAG, "开启巡航失败"); - } - } - - @Override - public void stopAimlessMode() { - if (!checkAMapNavi()) { - return; - } - mAMapNavi.stopAimlessMode(); - mAimlessStatus = false; - Logger.d(TAG, "关闭巡航成功"); - } - - @Override - public void setAimlessModeStatus(boolean open) { - this.mAimlessModeStatus = open; - SharedPrefsMgr.getInstance(mContext).putBoolean(KEY_AIMLESS_STATUS, open); - if (open) { - if (!mAimlessStatus) { - startAimlessMode(); - } - } else { - if (mAimlessStatus) { - stopAimlessMode(); - } - } - } - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessModeListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessModeListenerAdapter.java deleted file mode 100644 index 2abaa2728c..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/AimlessModeListenerAdapter.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import com.amap.api.navi.AimlessModeListener; -import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo; -import com.amap.api.navi.model.AimLessModeCongestionInfo; -import com.amap.api.navi.model.AimLessModeStat; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.navi.MogoCongestionInfo; -import com.mogo.map.navi.MogoNaviListenerHandler; -import com.mogo.map.navi.MogoTraffic; -import com.mogo.utils.logger.Logger; -import com.mogo.utils.network.utils.GsonUtil; - -/** - * @author congtaowang - * @since 2020-01-16 - *

- * 巡航监听 - */ -public class AimlessModeListenerAdapter implements AimlessModeListener { - public String TAG="AimlessModeListenerAdapter"; - - @Override - public void onUpdateTrafficFacility( AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) { - MogoTraffic traffic = ObjectUtils.fromAMap( aMapNaviTrafficFacilityInfos ); - if ( traffic != null ) { - MogoNaviListenerHandler.getInstance().onUpdateTraffic2( traffic ); - } - } - - @Override - public void onUpdateAimlessModeElecCameraInfo( AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) { - MogoTraffic traffic = ObjectUtils.fromAMap( aMapNaviTrafficFacilityInfos ); - if ( traffic != null ) { - MogoNaviListenerHandler.getInstance().onUpdateTraffic2( traffic ); - } - } - - @Override - public void updateAimlessModeStatistics( AimLessModeStat aimLessModeStat ) { - - } - - @Override - public void updateAimlessModeCongestionInfo( AimLessModeCongestionInfo aimLessModeCongestionInfo ) { - Logger.d( TAG, "updateAimlessModeCongestionInfo " + GsonUtil.jsonFromObject(aimLessModeCongestionInfo)); - MogoCongestionInfo congestionInfo = ObjectUtils.fromAMap( aimLessModeCongestionInfo ); - if ( congestionInfo != null ) { - MogoNaviListenerHandler.getInstance().onUpdateCongestion( congestionInfo ); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/CalculatePathItem.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/CalculatePathItem.java deleted file mode 100644 index d1dc20389f..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/CalculatePathItem.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.content.Context; -import android.text.TextUtils; - -import com.amap.api.maps.AMap; -import com.amap.api.navi.model.AMapNaviPath; -import com.amap.api.navi.model.AMapNaviStep; -import com.amap.api.navi.model.NaviLatLng; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.overlay.RouteOverLayWrapper; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-04 - *

- * 导航路径代理类 - */ -public class CalculatePathItem { - - private Context mContext; - private AMap mAMap; - private int mId; - private AMapNaviPath mPath; - - private RouteOverLayWrapper mOverLazWrapper; - private ArrayList< MogoLatLng > mPoints; - - public int getId() { - return mId; - } - - public AMapNaviPath getPath() { - return mPath; - } - - public RouteOverLayWrapper getOverLazWrapper( boolean createIfNull ) { - if ( mOverLazWrapper == null && createIfNull ) { - mOverLazWrapper = new RouteOverLayWrapper( mContext, mAMap, mPath ); - } - return mOverLazWrapper; - } - - public CalculatePathItem( Context context, AMap amap, int id, AMapNaviPath path ) { - mContext = context; - mAMap = amap; - this.mId = id; - this.mPath = path; - } - - public String getStrategyName() { - return mPath.getLabels(); - } - - public String getFormattedTime() { - if ( mTimeBuilder == null ) { - final int time = mPath.getAllTime(); - mTimeBuilder = new StringBuilder(); - fillFormatTime( time, mTimeBuilder ); - } - return mTimeBuilder.toString(); - } - - public int getTime(){ - return mPath.getAllTime(); - } - - public int getDistance(){ - return mPath.getAllLength(); - } - - private StringBuilder mTimeBuilder; - - private void fillFormatTime( int seconds, StringBuilder builder ) { - // int days = seconds / ( 24 * 60 * 60 ); - // if ( days > 0 ) { - // builder.append( days ).append( "天" ); - // } - // seconds -= days * 24 * 60 * 60; - int hours = seconds / ( 60 * 60 ); - if ( hours > 0 ) { - builder.append( hours ).append( "小时" ); - } - seconds -= hours * 60 * 60; - int min = seconds / 60; - builder.append( min > 1 ? min : 1 ).append( "分钟" ); - } - - private String mDistanceCacheStr = ""; - - public String getFormattedDistance() { - if ( TextUtils.isEmpty( mDistanceCacheStr ) ) { - int distance = mPath.getAllLength(); - if ( distance == -1 ) { - mDistanceCacheStr = "路程总程未获取"; - } - if ( distance >= 1000 ) { - mDistanceCacheStr = String.format( "%.1f公里", ( float ) distance / 1000 ); - } else { - mDistanceCacheStr = distance + "米"; - } - } - return mDistanceCacheStr; - } - - private StringBuilder mDescBuilder = null; - - public String getDesc() { - if ( mDescBuilder == null ) { - mDescBuilder = new StringBuilder(); - int lightsSize = getTrafficNumber(); - if ( lightsSize > 0 ) { - mDescBuilder.append( "红绿灯" ).append( lightsSize ).append( "个" ); - } - mDescBuilder.append( " " ); - mDescBuilder.append( "收费" ).append( mPath.getTollCost() ).append( "元" ); - } - - return mDescBuilder.toString(); - } - - public int getTrafficNumber() { - int trafficLightNumber = 0; - if ( mPath == null ) { - return trafficLightNumber; - } - List< AMapNaviStep > steps = mPath.getSteps(); - for ( AMapNaviStep step : steps ) { - trafficLightNumber += step.getTrafficLightNumber(); - } - return trafficLightNumber; - } - - public void release() { - mContext = null; - mAMap = null; - mPath = null; - if ( mOverLazWrapper != null ) { - mOverLazWrapper.destroy(); - } - mOverLazWrapper = null; - if ( mPoints != null ) { - mPoints.clear(); - } - mPoints = null; - } - - public List< MogoLatLng > getCoordList() { - if ( mPoints == null ) { - mPoints = new ArrayList<>(); - for ( NaviLatLng latlng : mPath.getCoordList() ) { - MogoLatLng mogoLatLng = new MogoLatLng( latlng.getLatitude(), latlng.getLongitude() ); - mPoints.add( mogoLatLng ); - } - } - return mPoints; - } - - public MogoLatLng getDriveStartPoint() { - if ( mPath != null && mPath.getCoordList() != null && mPath.getCoordList().size() > 0 ) { - NaviLatLng startPoint = mPath.getCoordList().get( 0 ); - if ( startPoint != null ) { - return new MogoLatLng( startPoint.getLatitude(), startPoint.getLongitude() ); - } - } - return null; - } - - public MogoLatLng getDriveEndPoint() { - if ( mPath != null && mPath.getCoordList() != null && mPath.getCoordList().size() > 0 ) { - NaviLatLng endPoint = mPath.getCoordList().get( mPath.getCoordList().size() - 1 ); - if ( endPoint != null ) { - return new MogoLatLng( endPoint.getLatitude(), endPoint.getLongitude() ); - } - } - return null; - } -} \ No newline at end of file diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java deleted file mode 100644 index dd2d019c1f..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviClient.java +++ /dev/null @@ -1,451 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.content.Context; -import android.graphics.Rect; -import android.location.Location; - -import com.amap.api.maps.LocationSource; -import com.amap.api.maps.model.Polyline; -import com.amap.api.navi.AMapNavi; -import com.amap.api.navi.enums.AimLessMode; -import com.amap.api.navi.enums.NaviType; -import com.amap.api.navi.model.AMapNaviPath; -import com.amap.api.navi.model.NaviLatLng; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.AMapWrapper; -import com.mogo.map.impl.amap.message.AMapMessageManager; -import com.mogo.map.impl.amap.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; -import com.mogo.utils.logger.Logger; -import com.mogo.utils.storage.SharedPrefsMgr; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * @author congtaowang - * @since 2019-12-25 - *

- * 高德导航 - */ -public class NaviClient implements IMogoNavi { - - /** - * 巡航状态控制 - */ - public static final String KEY_AIMLESS_STATUS = "KEY_AIMLESS_STATUS"; - - private static final String TAG = "NaviClient"; - private final Context mContext; - - private AMapNavi mAMapNavi; - private NaviListenerAdapter mAMapNaviListener; - - private AimlessModeListenerAdapter mAimlessModeListener; - - /** - * 导航策略配置 - */ - - private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig(); - - private static volatile NaviClient sInstance; - private boolean mIsRealNavi; - - private Location mCarLocation; - private LocationSource.OnLocationChangedListener mOnLocationChangedListener; - /** - * 巡航模式配置状态 - */ - private boolean mAimlessModeStatus; - - /** - * 巡航状态 - */ - private boolean mAimlessStatus; - - private NaviClient( Context context ) { - mContext = context.getApplicationContext(); - if ( DebugConfig.isUseCustomNavi() ) { - // 按需初始化导航组件 - initAMapNavi(); - } - } - - /** - * 初始化导航组件 - */ - private void initAMapNavi() { - if ( mAMapNavi != null ) { - return; - } - mAMapNavi = AMapNavi.getInstance( mContext ); - mAMapNavi.setEmulatorNaviSpeed( 120 ); - mAMapNavi.setUseInnerVoice( true, true ); - mAMapNavi.stopSpeak(); - mAMapNaviListener = new NaviListenerAdapter( mContext, this ); - mAimlessModeListener = new AimlessModeListenerAdapter() { - }; - mAMapNavi.addAMapNaviListener( mAMapNaviListener ); - mAMapNavi.addAimlessModeListener( mAimlessModeListener ); - mAimlessModeStatus = SharedPrefsMgr.getInstance( mContext ).getBoolean( KEY_AIMLESS_STATUS, false ); - } - - public static NaviClient getInstance( Context context ) { - if ( sInstance == null ) { - synchronized ( NaviClient.class ) { - if ( sInstance == null ) { - sInstance = new NaviClient( context ); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - @Override - public void naviTo( MogoLatLng endPoint ) { - naviTo( endPoint, mMogoNaviConfig ); - } - - @Override - public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) { - naviTo( endPoint, null, config ); - } - - @Override - public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) { - naviTo( endPoint, wayPoints, mMogoNaviConfig ); - } - - @Override - public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) { - if ( !checkAMapNavi() ) { - return; - } - Logger.i( TAG, "开始规划路径" ); - mMogoNaviConfig = config; - if ( mMogoNaviConfig == null ) { - mMogoNaviConfig = new MogoNaviConfig(); - } - int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() ); - List< NaviLatLng > naviWayPoints = null; - if ( wayPoints != null && !wayPoints.isEmpty() ) { - naviWayPoints = new ArrayList<>( wayPoints.size() ); - for ( MogoLatLng wayPoint : wayPoints ) { - naviWayPoints.add( ObjectUtils.fromMogoAsNavi( wayPoint ) ); - } - } else { - naviWayPoints = new ArrayList<>(); - } - mAMapNavi.calculateDriveRoute( - new ArrayList( Arrays.asList( ObjectUtils.fromMogoAsNavi( endPoint ) ) ), - naviWayPoints, - strategy - ); - } - - @Override - public void reCalculateRoute( MogoNaviConfig config ) { - if ( !checkAMapNavi() ) { - return; - } - mMogoNaviConfig = config; - if ( mMogoNaviConfig == null ) { - mMogoNaviConfig = new MogoNaviConfig(); - } - int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() ); - mAMapNavi.reCalculateRoute( strategy ); - } - - @Override - public void stopNavi() { - if ( mAMapNaviListener != null ) { - mAMapNaviListener.stopNavi(); - } - } - - public void stopAMapNavi() { - if ( mAMapNavi != null ) { - mAMapNavi.stopNavi(); - } - } - - public void selectAMapRouteId( int routeId ) { - if ( mAMapNavi != null ) { - mAMapNavi.selectRouteId( routeId ); - } - } - - public Map< Integer, AMapNaviPath > getAMapNaviPaths() { - if ( mAMapNavi != null ) { - return mAMapNavi.getNaviPaths(); - } - return null; - } - - @Override - public void startNavi( boolean isRealNavi ) { - if ( mAMapNaviListener != null && mAMapNaviListener.isStopped() ) { - return; - } - mIsRealNavi = isRealNavi; - stopAimlessMode(); - boolean isNaving = isNaviing(); - boolean result = mAMapNavi.startNavi( isRealNavi ? NaviType.GPS : NaviType.EMULATOR ); - if ( isNaving && !result ) { - // 如果正在导航,又重新规划路线,startNavi 不会成功,不会重新回调 #onStartNavi - MogoNaviListenerHandler.getInstance().onStartNavi(); - AMapMessageManager.getInstance().postNaviStarted(); - } - Logger.d( TAG, "start navi status: %s", result ); - } - - @Override - public boolean isNaviing() { - if ( mAMapNaviListener != null ) { - return mAMapNaviListener.isNaviing(); - } - return false; - } - - @Override - public List< MogoCalculatePath > getCalculatedStrategies() { - if ( mAMapNaviListener != null ) { - return mAMapNaviListener.getCalculateStrategies(); - } - return null; - } - - @Override - public List< MogoLatLng > getCalculatedPathPos() { - if ( mAMapNaviListener != null ) { - return mAMapNaviListener.getCalculatedPathPos(); - } - return null; - } - - @Override - public OnCalculatePathItemClickInteraction getItemClickInteraction() { - if ( mAMapNaviListener != null ) { - return mAMapNaviListener.getItemClickInteraction(); - } - return null; - } - - @Override - public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) { - // do not impl - } - - @Override - public void clearCalculatePaths() { - if ( mAMapNaviListener != null ) { - mAMapNaviListener.clearCalculatePaths(); - } - } - - @Override - public void setCalculatePathDisplayBounds( Rect bounds ) { - if ( mAMapNaviListener != null ) { - mAMapNaviListener.setCalculatePathDisplayBounds( bounds ); - } - } - - @Override - public MogoNaviConfig getNaviConfig() { - return mMogoNaviConfig; - } - - @Override - public boolean setBroadcastMode( int mode ) { - if ( !checkAMapNavi() ) { - return false; - } - return mAMapNavi.setBroadcastMode( mode ); - } - - @Override - public List< MogoLatLng > getNaviPathCoordinates() { - return null; - } - - @Override - public MogoLatLng getCarLocation() { - if ( mCarLocation != null ) { - synchronized ( mCarLocation ) { - return new MogoLatLng( mCarLocation.getLatitude(), mCarLocation.getLongitude() ); - } - } - return null; - } - - @Override - public Location getCarLocation2() { - return mCarLocation; - } - - @Override - public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) { - // do not impl. - } - - // -- end - - public void syncCarLocation( Location location ) { - mCarLocation = location; - mCarLocation = location; - if ( MogoCarLocationChangedListenerRegister.getInstance().getListener() != null ) { - MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2( location ); - } - } - - private boolean checkAMapNavi() { - if ( mAMapNavi == null ) { - Logger.e( TAG, "高德导航实例为空!!!" ); - return false; - } - return true; - } - - public boolean isRealNavi() { - return mIsRealNavi; - } - - public void handleClickedPolyline( Polyline polyline ) { - if ( mAMapNaviListener != null ) { - mAMapNaviListener.handleClickedPolyline( polyline ); - } - } - - @Override - public void startAimlessMode() { - if ( !checkAMapNavi() ) { - return; - } - if ( mAimlessModeStatus && !isNaviing() ) { - mAMapNavi.startSpeak(); - mAMapNavi.startAimlessMode( AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED ); - mAimlessStatus = true; - Logger.d( TAG, "开启巡航成功" ); - } else { - mAimlessStatus = false; - mAMapNavi.stopSpeak(); - Logger.d( TAG, "开启巡航失败" ); - } - } - - @Override - public void stopAimlessMode() { - if ( !checkAMapNavi() ) { - return; - } - mAMapNavi.stopAimlessMode(); - mAMapNavi.stopSpeak(); - mAimlessStatus = false; - Logger.d( TAG, "关闭巡航成功" ); - } - - @Override - public void setAimlessModeStatus( boolean open ) { - this.mAimlessModeStatus = open; - SharedPrefsMgr.getInstance( mContext ).putBoolean( KEY_AIMLESS_STATUS, open ); - if ( open ) { - if ( !mAimlessStatus ) { - startAimlessMode(); - } - } else { - if ( mAimlessStatus ) { - stopAimlessMode(); - } - } - } - - @Override - public void displayOverview( Rect bounds ) { - if ( mAMapNaviListener != null ) { - mAMapNaviListener.displayOverview( bounds ); - } - } - - @Override - public void setUseExtraGPSData( boolean use ) { - // 如果使用平台模拟位置变化,需要用到导航组件 - if ( use ) { - initAMapNavi(); - } else { - destroyAMapNavi(); - } - if ( checkAMapNavi() ) { - return; - } - Logger.d( TAG, "设置外部gps源状态 %s", use ); - mAMapNavi.setIsUseExtraGPSData( use ); - if ( AMapWrapper.getAMap() == null ) { - return; - } - if ( use ) { - AMapWrapper.getAMap().setLocationSource( new LocationSource() { - @Override - public void activate( OnLocationChangedListener onLocationChangedListener ) { - NaviClient.this.mOnLocationChangedListener = onLocationChangedListener; - } - - @Override - public void deactivate() { - } - } ); - } else { - AMapWrapper.getAMap().setLocationSource( new com.amap.api.col.n3.dd( AbsMogoApplication.getApp() ) ); - mOnLocationChangedListener = null; - } - AMapWrapper.getAMap().setMyLocationEnabled( true ); - } - - /** - * 销毁导航组件 - */ - private void destroyAMapNavi() { - if ( mAMapNavi != null ) { - mAMapNavi.removeAMapNaviListener( mAMapNaviListener ); - mAMapNavi.removeAimlessModeListener( mAimlessModeListener ); - mAMapNavi.destroy(); - } - } - - @Override - public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) { - if ( !checkAMapNavi() ) { - return; - } - if ( !mAMapNavi.getIsUseExtraGPSData() ) { - Logger.d( TAG, "拒绝外部GPS数据" ); - return; - } - Location location = new Location( "外部GPS源" ); - location.setLongitude( lon ); - location.setLatitude( lat ); - location.setSpeed( speed ); - location.setAccuracy( accuracy ); - location.setBearing( bearing ); - location.setTime( timestamp ); - //type字段传1时代表WGS84坐标 - mAMapNavi.setExtraGPSData( 2, location ); - if ( mOnLocationChangedListener != null ) { - mOnLocationChangedListener.onLocationChanged( location ); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java deleted file mode 100644 index f1294a4316..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviListenerAdapter.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.content.Context; -import android.graphics.Rect; -import android.os.Trace; -import android.text.TextUtils; - -import com.amap.api.maps.model.Polyline; -import com.amap.api.navi.enums.CameraType; -import com.amap.api.navi.enums.NaviType; -import com.amap.api.navi.model.AMapCalcRouteResult; -import com.amap.api.navi.model.AMapNaviCameraInfo; -import com.amap.api.navi.model.AMapNaviLocation; -import com.amap.api.navi.model.NaviInfo; -import com.mogo.commons.voice.AIAssist; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.AMapWrapper; -import com.mogo.map.impl.amap.message.AMapMessageManager; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.navi.MogoCalculatePath; -import com.mogo.map.navi.MogoNaviListenerHandler; -import com.mogo.map.navi.MogoTraffic; -import com.mogo.map.navi.OnCalculatePathItemClickInteraction; -import com.mogo.utils.UiThreadHandler; -import com.mogo.utils.logger.Logger; - -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-25 - *

- * 高德导航回调 - */ -public class NaviListenerAdapter extends AMapNaviListenerAdapter { - - private static final String TAG = "NaviListenerAdapter"; - - private Context mContext; - private NaviClient mClient; - /** - * 导航状态:true - 导航 onStartNavi(int) 被调用, false - 到达目的地、手动挺固执 - */ - private boolean mIsNaviing = false; - - /** - * 导航是否被停止:true - 手动停止或到达目的地、false - 规划路径成功、开启导航 - */ - private boolean mIsStopped = true; - - /** - * 路线规划 - */ - private NaviOverlayHelper mNaviOverlayHelper; - - public NaviListenerAdapter( Context mContext, NaviClient client ) { - this.mContext = mContext; - this.mClient = client; - mNaviOverlayHelper = new NaviOverlayHelper( AMapWrapper.getAMap(), mContext ); - } - - public void setNaviing( boolean mIsNaviing ) { - this.mIsNaviing = mIsNaviing; - } - - public boolean isNaviing() { - return mIsNaviing; - } - - public void setStopped( boolean isStopped ) { - this.mIsStopped = isStopped; - } - - public boolean isStopped() { - return mIsStopped; - } - - public Context getContext() { - return mContext; - } - - @Override - public void onInitNaviFailure() { - MogoNaviListenerHandler.getInstance().onInitNaviFailure(); - } - - @Override - public void onInitNaviSuccess() { - MogoNaviListenerHandler.getInstance().onInitNaviSuccess(); - NaviClient.getInstance( mContext ).startAimlessMode(); - } - - @Override - public void updateCameraInfo( AMapNaviCameraInfo[] aMapNaviCameraInfos ) { - super.updateCameraInfo( aMapNaviCameraInfos ); - if ( aMapNaviCameraInfos == null || aMapNaviCameraInfos.length == 0 ) { - return; - } - int limitSpeed = 0; - for ( AMapNaviCameraInfo aMapNaviCameraInfo : aMapNaviCameraInfos ) { - if ( aMapNaviCameraInfo == null ) { - continue; - } - limitSpeed = aMapNaviCameraInfo.getCameraSpeed(); - if ( limitSpeed > 0 && aMapNaviCameraInfo.getCameraType() == CameraType.SPEED ) { - MogoTraffic traffic = new MogoTraffic( MogoTraffic.TYPE_NAVI ); - traffic.setDistance( aMapNaviCameraInfo.getCameraDistance() ); - traffic.setSpeedLimit( aMapNaviCameraInfo.getCameraSpeed() ); - MogoNaviListenerHandler.getInstance().onUpdateTraffic2( traffic ); - } - -// switch ( aMapNaviCameraInfo.getCameraType() ) { -// case CameraType.SPEED: -// -// break; -// case CameraType.SURVEILLANCE: -// traffic.setDesc( "监控摄像" ); -// break; -// case CameraType.TRAFFICLIGHT: -// traffic.setDesc( "闯红灯拍照" ); -// break; -// case CameraType.BREAKRULE: -// traffic.setDesc( "违章拍照" ); -// break; -// case CameraType.BUSWAY: -// traffic.setDesc( "公交专用道摄像头" ); -// break; -// case CameraType.EMERGENCY: -// traffic.setDesc( "应急车道拍照" ); -// break; -// case CameraType.BICYCLE: -// traffic.setDesc( "非机动车道" ); -// break; -// case CameraType.INTERVALVELOCITYSTART: -// traffic.setDesc( "区间测速起始" ); -// break; -// case CameraType.INTERVALVELOCITYEND: -// traffic.setDesc( "区间测速解除" ); -// break; -// } - } - if ( limitSpeed <= 0 ) { - MogoTraffic traffic = new MogoTraffic( MogoTraffic.TYPE_NAVI ); - traffic.setDistance( 0 ); - traffic.setSpeedLimit( 0 ); - MogoNaviListenerHandler.getInstance().onUpdateTraffic2( traffic ); - } - } - - @Override - public void onStartNavi( int type ) { - - Logger.d( TAG, "onStartNavi type = %s", type ); - // 巡航 - if ( type != NaviType.CRUISE ) { - setStopped( false ); - setNaviing( true ); - MogoNaviListenerHandler.getInstance().onStartNavi(); - AMapMessageManager.getInstance().postNaviStarted(); - } - } - - @Override - public void onEndEmulatorNavi() { - stopNaviDelay( () -> { - MogoNaviListenerHandler.getInstance().onEndEmulatorNavi(); - } ); - } - - @Override - public void onArriveDestination() { - stopNaviDelay( () -> { - MogoNaviListenerHandler.getInstance().onArriveDestination(); - } ); - } - - /** - * 避免导航结束语音播报被立刻打断的情况 - * - * @param after 停止后的行为 - */ - private void stopNaviDelay( Runnable after ) { - UiThreadHandler.postDelayed( () -> { - if ( TextUtils.isEmpty( mLastSpeakWord ) || !mLastSpeakWord.contains( "结束" ) ) { - AIAssist.getInstance( mContext ).speakTTSVoice( "到达目的地附近,本次导航结束" ); - } - mLastSpeakWord = ""; - stopNavi(); - if ( after != null ) { - after.run(); - } - }, 5_000L ); - } - - @Override - public void onNaviInfoUpdate( NaviInfo naviInfo ) { - Trace.beginSection( "NaviListenerAdapter.onNaviInfoUpdate" ); - MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( ObjectUtils.fromAMap( mContext, naviInfo ) ); - mNaviOverlayHelper.handleNaviInfoUpdate( naviInfo ); - Trace.endSection(); - } - - @Override - public void onCalculateRouteFailure( AMapCalcRouteResult aMapCalcRouteResult ) { - if ( aMapCalcRouteResult != null ) { - Logger.i( TAG, PathPlanningErrorCodeConstants.getErrorMsg( aMapCalcRouteResult.getErrorCode() ) ); - } - MogoNaviListenerHandler.getInstance().onoCalculateFailed(); - } - - @Override - public void onCalculateRouteSuccess( AMapCalcRouteResult aMapCalcRouteResult ) { - super.onCalculateRouteSuccess( aMapCalcRouteResult ); - Logger.i( TAG, "导航规划成功" ); - setStopped( false ); - mNaviOverlayHelper.showCalculatedPaths( () -> { - AMapMessageManager.getInstance().postCalculateSuccess(); - MogoNaviListenerHandler.getInstance().onCalculateSuccess(); - } ); - } - - @Override - public void onLocationChange( AMapNaviLocation aMapNaviLocation ) { - Trace.beginSection( "NaviListenerAdapter.onLocationChange" ); - super.onLocationChange( aMapNaviLocation ); - mNaviOverlayHelper.handlePassedLocation( aMapNaviLocation ); - Trace.endSection(); - } - - public void stopNavi() { - TTSSpeaker.getInstance().shutUp(); - mNaviOverlayHelper.clearCalculatedOverlay(); - setStopped( true ); - setNaviing( false ); - mClient.stopAMapNavi(); - MogoNaviListenerHandler.getInstance().onStopNavi(); - AMapMessageManager.getInstance().postNaviStopped(); - } - - public void handleClickedPolyline( Polyline polyline ) { - if ( mNaviOverlayHelper != null ) { - mNaviOverlayHelper.handleClickedPolyline( polyline, isNaviing() ); - mClient.selectAMapRouteId( mNaviOverlayHelper.getSelectedPathId() ); - mNaviOverlayHelper.showBoundsWithSettingBounds(); - } - } - - public List< MogoCalculatePath > getCalculateStrategies() { - if ( mNaviOverlayHelper != null ) { - return mNaviOverlayHelper.getCalculateStrategies(); - } - return null; - } - - public List< MogoLatLng > getCalculatedPathPos() { - if ( mNaviOverlayHelper != null ) { - return mNaviOverlayHelper.getCalculatedPathPos(); - } - return null; - } - - - public OnCalculatePathItemClickInteraction getItemClickInteraction() { - if ( mNaviOverlayHelper != null ) { - return mNaviOverlayHelper.getItemClickInteraction(); - } - return null; - } - - public void clearCalculatePaths() { - if ( mNaviOverlayHelper != null ) { - mNaviOverlayHelper.clearCalculatedOverlay(); - } - } - - public void setCalculatePathDisplayBounds( Rect bounds ) { - if ( mNaviOverlayHelper != null ) { - mNaviOverlayHelper.setCalculatePathDisplayBounds( bounds ); - } - } - - public void displayOverview( Rect bounds ) { - if ( mNaviOverlayHelper != null ) { - mNaviOverlayHelper.displayOverview( bounds ); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviOverlayHelper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviOverlayHelper.java deleted file mode 100644 index 20f37b9efc..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/NaviOverlayHelper.java +++ /dev/null @@ -1,455 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Rect; -import android.text.TextUtils; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.CameraUpdateFactory; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.Polyline; -import com.amap.api.navi.model.AMapNaviLocation; -import com.amap.api.navi.model.AMapNaviPath; -import com.amap.api.navi.model.NaviInfo; -import com.amap.api.navi.model.NaviLatLng; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.AMapWrapper; -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; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** - * @author congtaowang - * @since 2019-12-27 - *

- * 导航路径管理 - */ -public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction { - - private static final String TAG = "NaviOverlayHelper"; - - /** - * 选中的路径透明度 - */ - public static final float AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED = 1f; - - /** - * 未选中的路径透明度 - */ - public static final float AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED = 0.3f; - - private AMap mAMap; - private Context mContext; - // 规划的路线显示边距 - private Rect mBoundRect = null; - - private List< CalculatePathItem > mCalculatePathItems; - private List< MogoCalculatePath > mPaths = new ArrayList<>(); - - private int mSelectedPathId; - private CalculatePathItem mSelectedCalculatePathItem; - - /** - * 起点终点marker - */ - private List< Marker > mMarkers = new ArrayList<>(); - - public NaviOverlayHelper( AMap mAMap, Context mContext ) { - this.mAMap = mAMap; - this.mContext = mContext; - calculateBoundArea(); - } - - /** - * 显示规划的路径 - */ - public void showCalculatedPaths( Runnable after ) { - clearCalculatedOverlay(); - mCalculatePathItems = getSortedPaths(); - if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) { - return; - } - showPathsBound( getBounds(), () -> { - addEndPoints(); - renderPathOverlay( mCalculatePathItems ); - if ( after != null ) { - after.run(); - } - }, mBoundRect ); - } - - private LatLngBounds getBounds() { - if ( mCalculatePathItems == null ) { - return null; - } - LatLngBounds.Builder builder = new LatLngBounds.Builder(); - for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) { - if ( calculatePathItem == null ) { - continue; - } - try { - LatLngBounds bounds = calculatePathItem.getPath().getBoundsForPath(); - builder.include( bounds.northeast ); - builder.include( bounds.southwest ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - return builder.build(); - } - - /** - * 按pathId升序排序 - * - * @return 排序好的路径规划列表 - */ - private List< CalculatePathItem > getSortedPaths() { - checkAMapInstance(); - final Map< Integer, AMapNaviPath > pathMap = NaviClient.getInstance( mContext ).getAMapNaviPaths(); - if ( pathMap == null || pathMap.isEmpty() ) { - return null; - } - TreeMap< Integer, AMapNaviPath > sortedMap = - new TreeMap< Integer, AMapNaviPath >( new Comparator< Integer >() { - @Override - public int compare( Integer obj1, Integer obj2 ) { - if ( obj1 != null ) { - return obj1.compareTo( obj2 ); - } - if ( obj2 != null ) { - return obj2.compareTo( obj1 ); - } - return 0; - } - } ); - sortedMap.putAll( pathMap ); - - final List< CalculatePathItem > items = new ArrayList<>(); - for ( Map.Entry< Integer, AMapNaviPath > entry : sortedMap.entrySet() ) { - if ( entry == null || entry.getKey() == null || entry.getValue() == null ) { - continue; - } - items.add( new CalculatePathItem( mContext, mAMap, entry.getKey(), entry.getValue() ) ); - } - return items; - } - - private void calculateBoundArea() { - if ( mBoundRect == null ) { - mBoundRect = new Rect(); - final int padding = WindowUtils.dip2px( mContext, 80 ); - mBoundRect.left = padding; - mBoundRect.right = padding; - mBoundRect.top = padding; - mBoundRect.bottom = padding; - } - } - - public void showBoundsWithSettingBounds() { - showBounds( mBoundRect ); - } - - public void showBounds( Rect bounds ) { - Logger.d( TAG, "showBounds" ); - showPathsBound( getBounds(), null, bounds ); - } - - /** - * 将规划好的路径显示在视野内 - */ - private void showPathsBound( LatLngBounds bounds, Runnable after, Rect rect ) { - if ( bounds == null ) { - return; - } - if ( rect == null ) { - rect = new Rect(); - } - checkAMapInstance(); - mAMap.moveCamera( CameraUpdateFactory.newLatLngBoundsRect( - bounds, - rect.left, - rect.right, - rect.top, - rect.bottom ) ); - if ( after != null ) { - after.run(); - } - } - - private void checkAMapInstance() { - if ( mAMap == null ) { - mAMap = AMapWrapper.getAMap(); - } - } - - public void renderPathOverlay( List< CalculatePathItem > paths ) { - if ( paths == null || paths.size() == 0 ) { - return; - } - for ( int i = 0; i < paths.size(); i++ ) { - final CalculatePathItem item = paths.get( i ); - if ( item == null || item.getPath() == null ) { - continue; - } - RouteOverLayWrapper wrapper = item.getOverLazWrapper( true ); - wrapper.setTrafficLightsVisible( false ); - // 默认选中第一个 - if ( i == 0 ) { - mSelectedPathId = item.getId(); - mSelectedCalculatePathItem = item; - //wrapper.setStartBitmap( R.drawable.ic_navi_start ) - // .setEndBitmap( R.drawable.ic_navi_target ); - NaviClient.getInstance( mContext ).selectAMapRouteId( item.getId() ); - Logger.d( TAG, "renderPathOverlay set default path" ); - } - wrapper.addToMap(); - wrapper.setTransparency( i == 0 ? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED : AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED ); - } - } - - public void addEndPoints() { - if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) { - return; - } - - Bitmap bitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_endpoint ); - Bitmap startBitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_navi_start ); - Bitmap endBitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_navi_target ); - MarkerOptions options = new MarkerOptions().icon( BitmapDescriptorFactory.fromBitmap( bitmap ) ).zIndex( 0 ).anchor( 0.5f, 0.5f ); - MarkerOptions startOptions = new MarkerOptions().icon( BitmapDescriptorFactory.fromBitmap( startBitmap ) ).zIndex( 0 ).anchor( 0.5f, 1 ); - MarkerOptions endOptions = new MarkerOptions().icon( BitmapDescriptorFactory.fromBitmap( endBitmap ) ).zIndex( 0 ).anchor( 0.5f, 1 ); - for ( CalculatePathItem path : mCalculatePathItems ) { - List< MogoLatLng > points = path.getCoordList(); - if ( points == null || points.isEmpty() ) { - continue; - } - MogoLatLng startPoint = path.getDriveStartPoint(); - MogoLatLng endPoint = path.getDriveEndPoint(); - if ( startPoint == null || endPoint == null ) { - continue; - } - mMarkers.add( mAMap.addMarker( options.position( new LatLng( startPoint.lat, startPoint.lng ) ) ) ); - mMarkers.add( mAMap.addMarker( options.position( new LatLng( endPoint.lat, endPoint.lng ) ) ) ); - mMarkers.add( mAMap.addMarker( startOptions.position( new LatLng( startPoint.lat, startPoint.lng ) ) ) ); - mMarkers.add( mAMap.addMarker( endOptions.position( new LatLng( endPoint.lat, endPoint.lng ) ) ) ); - - break; - } - } - - public void clearCalculatedOverlay() { - if ( mCalculatePathItems != null && !mCalculatePathItems.isEmpty() ) { - for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) { - if ( calculatePathItem == null ) { - continue; - } - RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( false ); - if ( wrapper != null ) { - wrapper.destroy(); - } - calculatePathItem.release(); - } - mCalculatePathItems.clear(); - } - if ( mPaths != null ) { - mPaths.clear(); - } - if ( !mMarkers.isEmpty() ) { - for ( Marker mMarker : mMarkers ) { - if ( mMarker == null ) { - continue; - } - try { - mMarker.remove(); - mMarker.destroy(); - } catch ( Exception e ) { - - } - } - } - MogoMarkersHandler.getInstance().remove( TAG ); - } - - /** - * 是否切换成功 - * - * @param polyline 选中的线 - */ - public boolean handleClickedPolyline( Polyline polyline, boolean isNaviing ) { - if ( polyline == null ) { - return false; - } - if ( mPaths != null && !mPaths.isEmpty() ) { - for ( MogoCalculatePath path : mPaths ) { - if ( TextUtils.equals( path.getTagId(), polyline.getId() ) ) { - if ( MogoOperationListenerRegister.getInstance().getItemClickInteraction() != null ) { - MogoOperationListenerRegister.getInstance().getItemClickInteraction().onItemClicked( path.getTagId() ); - break; - } - } - } - } - return handleClickedPolyline( polyline.getId() ); - } - - private boolean handleClickedPolyline( String id ) { - if ( id == null ) { - return false; - } - Logger.i( TAG, "polyline id = " + id ); - mSelectedCalculatePathItem = isCalculatePolyline( id ); - if ( mSelectedCalculatePathItem == null ) { - return false; - } - mSelectedPathId = mSelectedCalculatePathItem.getId(); - if ( mCalculatePathItems != null ) { - for ( CalculatePathItem item : mCalculatePathItems ) { - final RouteOverLayWrapper wrapper = item.getOverLazWrapper( false ); - if ( wrapper == null ) { - continue; - } - wrapper.setTransparency( - item == mSelectedCalculatePathItem - ? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED - : AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED - ); - } - } - return true; - } - - private CalculatePathItem isCalculatePolyline( String id ) { - CalculatePathItem result = null; - if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) { - return result; - } - for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) { - if ( calculatePathItem == null ) { - continue; - } - final RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( false ); - if ( wrapper == null ) { - continue; - } - if ( wrapper.getTrafficColorfulPolyline() == null ) { - continue; - } - if ( TextUtils.equals( wrapper.getTrafficColorfulPolyline().getId(), id ) ) { - result = calculatePathItem; - } - } - return result; - } - - public int getSelectedPathId() { - return mSelectedPathId; - } - - /** - * 车辆拐弯时绘制转向箭头 - */ - public void handleNaviInfoUpdate( NaviInfo naviInfo ) { - if ( mSelectedCalculatePathItem != null ) { - RouteOverLayWrapper wrapper = mSelectedCalculatePathItem.getOverLazWrapper( false ); - if ( wrapper != null ) { - wrapper.drawArrow( naviInfo ); - } - } - } - - public void handlePassedLocation( AMapNaviLocation location ) { - if ( mSelectedCalculatePathItem != null ) { - RouteOverLayWrapper wrapper = mSelectedCalculatePathItem.getOverLazWrapper( false ); - if ( wrapper != null ) { - wrapper.updatePolyline( location ); - } - } - } - - public List< MogoCalculatePath > getCalculateStrategies() { - if ( mCalculatePathItems != null && !mCalculatePathItems.isEmpty() ) { - for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) { - MogoCalculatePath path = new MogoCalculatePath(); - path.setFormattedDistance( calculatePathItem.getFormattedDistance() ); - path.setPathId( calculatePathItem.getId() ); - path.setStrategyName( calculatePathItem.getStrategyName() ); - path.setFormattedTime( calculatePathItem.getFormattedTime() ); - path.setTime( calculatePathItem.getTime() ); - path.setDistance( calculatePathItem.getDistance() ); - List< NaviLatLng > coordList = calculatePathItem.getPath().getCoordList(); - ArrayList< MogoLatLng > mogoLatLngs = new ArrayList<>(); - for ( NaviLatLng latlng : coordList - ) { - MogoLatLng mogoLatLng = - new MogoLatLng( latlng.getLatitude(), latlng.getLongitude() ); - mogoLatLngs.add( mogoLatLng ); - } - path.setCoordList( mogoLatLngs ); - path.setTrafficLights( calculatePathItem.getTrafficNumber() ); - mPaths.add( path ); - final RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( true ); - if ( wrapper == null ) { - continue; - } - if ( wrapper.getTrafficColorfulPolyline() == null ) { - continue; - } - path.setTagId( wrapper.getTrafficColorfulPolyline().getId() ); - } - } - - return mPaths; - } - - public List< MogoLatLng > getCalculatedPathPos() { - - if ( mSelectedCalculatePathItem != null ) { - return mSelectedCalculatePathItem.getCoordList(); - } - //if (mPaths != null && !mPaths.isEmpty()) { - // return mPaths.get(0).getCoordList(); - //} - return null; - } - - @Override - public void onItemClicked( String tagId ) { - handleClickedPolyline( tagId ); - NaviClient.getInstance( mContext ).selectAMapRouteId( getSelectedPathId() ); - showBounds( mBoundRect ); - } - - public OnCalculatePathItemClickInteraction getItemClickInteraction() { - return this; - } - - public void setCalculatePathDisplayBounds( Rect bounds ) { - if ( bounds != null ) { - mBoundRect = bounds; - } - } - - /** - * 展示全程 - */ - public void displayOverview( Rect bounds ) { - showBounds( bounds ); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/PathPlanningErrorCodeConstants.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/PathPlanningErrorCodeConstants.java deleted file mode 100644 index 7404d6049d..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/PathPlanningErrorCodeConstants.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import com.amap.api.navi.enums.PathPlanningErrCode; - -/** - * @author congtaowang - * @since 2019-10-18 - *

- * 描述 - */ -public enum PathPlanningErrorCodeConstants { - - NONE( -1, "路线规划错误,请重试" ), - - ACCESS_TOO_FREQUENT( PathPlanningErrCode.ACCESS_TOO_FREQUENT, "访问过于频繁,请稍后再试" ), - - DISABLE_RESTRICT( PathPlanningErrCode.DISABLE_RESTRICT, "无法躲避限行区域,请重新规划" ), - - ERROR_BUF( PathPlanningErrCode.ERROR_BUF, "Buf数据格式错误" ), - - ERROR_CONNECTION( PathPlanningErrCode.ERROR_CONNECTION, "网络超时或网络失败。" ), - - ERROR_DISTANCE( PathPlanningErrCode.ERROR_DISTANCE, "起点/终点/途经点的距离太长(步行距离>100km,骑行距离>1200km)" ), - - ERROR_ENCODER( PathPlanningErrCode.ERROR_ENCODER, "算路服务端编码失败" ), - - ERROR_ENDPOINT( PathPlanningErrCode.ERROR_ENDPOINT, "终点错误" ), - - ERROR_NAVI_PARAMS( PathPlanningErrCode.ERROR_NAVI_PARAMS, "调用直接导航 没有算路 参数错误,缺失有效的导航路径,无法开始导航" ), - - ERROR_NOROADFORENDPOINT( PathPlanningErrCode.ERROR_NOROADFORENDPOINT, "终点没有找到道路" ), - - ERROR_NOROADFORSTARTPOINT( PathPlanningErrCode.ERROR_NOROADFORSTARTPOINT, "起点没有找到道路。" ), - - ERROR_NOROADFORWAYPOINT( PathPlanningErrCode.ERROR_NOROADFORWAYPOINT, "途径点没有找到道路" ), - - ERROR_PREVIEW( PathPlanningErrCode.ERROR_PREVIEW, "路径数据缺乏预览数据" ), - - ERROR_PROTOCOL( PathPlanningErrCode.ERROR_PROTOCOL, "请求协议非法。" ), - - ERROR_STARTPOINT( PathPlanningErrCode.ERROR_STARTPOINT, "起点错误" ), - - ERROR_WAYPOINT( PathPlanningErrCode.ERROR_WAYPOINT, "途经点错误" ), - - INSUFFICIENT_PRIVILEGES( PathPlanningErrCode.INSUFFICIENT_PRIVILEGES, "无权限访问此服务。" ), - - INVALID_PARAMS( PathPlanningErrCode.INVALID_PARAMS, "请求参数非法。" ), - - INVALID_USER_KEY( PathPlanningErrCode.INVALID_USER_KEY, "用户key非法或过期(请检查key是否正确)" ), - - INVALID_USER_SCODE( PathPlanningErrCode.INVALID_USER_SCODE, "MD5安全码未通过验证,需要开发者判定key绑定的SHA1,package是否与sdk包里的一致." ), - - OUT_OF_SERVICE( PathPlanningErrCode.OUT_OF_SERVICE, "使用路径规划服务接口时可能出现该问题,规划点(包括起点、终点、途经点)不在中国陆地范围内" ), - - OVER_DIRECTION_RANGE( PathPlanningErrCode.OVER_DIRECTION_RANGE, "使用路径规划服务接口时可能出现该问题,路线计算失败,通常是由于道路起点和终点距离过长导致" ), - - OVER_QUOTA( PathPlanningErrCode.OVER_QUOTA, "请求超出配额。" ), - - SERVICE_NOT_EXIST( PathPlanningErrCode.SERVICE_NOT_EXIST, "请求服务不存在。" ), - - SERVICE_RESPONSE_ERROR( PathPlanningErrCode.SERVICE_RESPONSE_ERROR, "请求服务响应错误。" ), - - UNKNOWN_ERROR( PathPlanningErrCode.UNKNOWN_ERROR, "未知错误(可能是由于连接的网络无法访问外网)" ), - - USERKEY_PLAT_NOMATCH( PathPlanningErrCode.USERKEY_PLAT_NOMATCH, "请求中使用的key与绑定平台不符,例如:开发者申请的是js api的key,却用来调web服务接口" ); - - private int code; - private String errorMsg; - - PathPlanningErrorCodeConstants( int code, String errorMsg ) { - this.code = code; - this.errorMsg = errorMsg; - } - - public int getCode() { - return code; - } - - public String getErrorMsg() { - return errorMsg; - } - - public static String getErrorMsg( int code ) { - for ( PathPlanningErrorCodeConstants value : PathPlanningErrorCodeConstants.values() ) { - if ( value.getCode() == code ) { - return value.getErrorMsg(); - } - } - return NONE.getErrorMsg(); - } - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/TTSSpeaker.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/TTSSpeaker.java deleted file mode 100644 index dffc2067f2..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/navi/TTSSpeaker.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.mogo.map.impl.amap.navi; - -import android.text.TextUtils; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.voice.AIAssist; - -import java.util.LinkedList; - -/** - * @author congtaowang - * @since 2020-04-21 - *

- * 播报导航TTS - *

- * 策略:队列缓存预播报的 tts,然后上一句播完后 - */ -public class TTSSpeaker { - - private static volatile TTSSpeaker sInstance; - - private TTSSpeaker() { - } - - public static TTSSpeaker getInstance() { - if ( sInstance == null ) { - synchronized ( TTSSpeaker.class ) { - if ( sInstance == null ) { - sInstance = new TTSSpeaker(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - private LinkedList< String > mWaiting = new LinkedList<>(); - - private String mLastTts = null; - private String mLastTtsId = null; - - public synchronized void speakTTS( String tts ) { - if ( TextUtils.isEmpty( tts ) ) { - return; - } - mWaiting.add( tts ); - } - - public synchronized void shutUp() { - if ( mLastTtsId != null ) { - AIAssist.getInstance( AbsMogoApplication.getApp() ).shutUp( mLastTtsId, mLastTts ); - mWaiting.clear(); - mLastTtsId = null; - mLastTts = null; - } - } - - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapPolylineWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapPolylineWrapper.java deleted file mode 100644 index 88e4b21346..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapPolylineWrapper.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.PolylineOptions; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2020-03-10 - *

- * 描述 - */ -public class AMapPolylineWrapper implements IMogoPolyline { - - private Polyline mPolyline; - private MogoPolylineOptions mOptions; - private boolean mIsDestroyed = false; - - public AMapPolylineWrapper( Polyline mPolyline, - MogoPolylineOptions mOptions ) { - this.mPolyline = mPolyline; - this.mOptions = mOptions; - } - - @Override - public void destroy() { - remove(); - } - - @Override - public void remove() { - if ( mPolyline != null ) { - mPolyline.remove(); - } - mIsDestroyed = true; - } - - @Override - public String getId() { - if ( mPolyline != null ) { - return mPolyline.getId(); - } - return null; - } - - @Override - public void setPoints( List< MogoLatLng > lonLats ) { - if ( lonLats == null || lonLats.isEmpty() ) { - mPolyline.setPoints( new ArrayList< LatLng >() ); - return; - } - ArrayList< LatLng > points = new ArrayList<>(); - for ( MogoLatLng lonLat : lonLats ) { - LatLng latLng = ObjectUtils.fromMogo2( lonLat ); - if ( latLng == null ) { - continue; - } - points.add( latLng ); - } - mPolyline.setPoints( points ); - } - - @Override - public List< MogoLatLng > getPoints() { - if ( mPolyline == null ) { - return null; - } - ArrayList< MogoLatLng > lonLats = new ArrayList<>(); - List< LatLng > points = mPolyline.getPoints(); - if ( points != null ) { - for ( LatLng latLng : points ) { - MogoLatLng lonLat = ObjectUtils.fromAMap( latLng ); - if ( lonLat == null ) { - continue; - } - lonLats.add( lonLat ); - } - } - return lonLats; - } - - @Override - public void setGeodesic( boolean draw ) { - if ( mPolyline != null ) { - mPolyline.setGeodesic( draw ); - } - } - - @Override - public boolean isGeodesic() { - return mPolyline == null ? false : mPolyline.isGeodesic(); - } - - @Override - public void setDottedLine( boolean dottedLine ) { - if ( mPolyline != null ) { - mPolyline.setDottedLine( dottedLine ); - } - } - - @Override - public boolean isDottedLine() { - return mPolyline == null ? false : mPolyline.isDottedLine(); - } - - @Override - public void setWidth( float width ) { - if ( mPolyline != null ) { - mPolyline.setWidth( width ); - } - } - - @Override - public float getWidth() { - if ( mPolyline != null ) { - return mPolyline.getWidth(); - } - return 0; - } - - @Override - public void setColor( int color ) { - if ( mPolyline != null ) { - mPolyline.setColor( color ); - } - } - - @Override - public int getColor() { - if ( mPolyline != null ) { - return mPolyline.getColor(); - } - return 0; - } - - @Override - public void setZIndex( float zIndex ) { - if ( mPolyline != null ) { - mPolyline.setZIndex( zIndex ); - } - } - - @Override - public float getZIndex() { - if ( mPolyline != null ) { - return mPolyline.getZIndex(); - } - return 0; - } - - @Override - public void setVisible( boolean visible ) { - if ( mPolyline != null ) { - mPolyline.setVisible( visible ); - } - } - - @Override - public boolean isVisible() { - if ( mPolyline != null ) { - return mPolyline.isVisible(); - } - return false; - } - - @Override - public void setTransparency( float transparency ) { - if ( mPolyline != null ) { - mPolyline.setTransparency( transparency ); - } - } - - @Override - public void setOption( MogoPolylineOptions option ) { - PolylineOptions target = ObjectUtils.fromMogo( option ); - if ( target == null ) { - return; - } - mOptions = option; - if ( mPolyline != null ) { - mPolyline.setOptions( target ); - } - } - - @Override - public boolean isDestroyed() { - return false; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java deleted file mode 100755 index a7a6f8eabd..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java +++ /dev/null @@ -1,268 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import android.text.Html; -import android.text.Spanned; -import android.widget.EditText; - -import com.amap.api.maps.model.LatLng; -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.BusPath; -import com.amap.api.services.route.BusStep; -import com.amap.api.services.route.RouteBusLineItem; -import com.amap.api.services.route.RouteRailwayItem; -import com.mogo.map.impl.amap.R; - -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AMapUtil { - /** - * 判断edittext是否null - */ - public static String checkEditText(EditText editText) { - if (editText != null && editText.getText() != null - && !(editText.getText().toString().trim().equals(""))) { - return editText.getText().toString().trim(); - } else { - return ""; - } - } - - public static Spanned stringToSpan(String src) { - return src == null ? null : Html.fromHtml(src.replace("\n", "
")); - } - - public static String colorFont(String src, String color) { - StringBuffer strBuf = new StringBuffer(); - - strBuf.append("").append(src) - .append(""); - return strBuf.toString(); - } - - public static String makeHtmlNewLine() { - return "
"; - } - - public static String makeHtmlSpace(int number) { - final String space = " "; - StringBuilder result = new StringBuilder(); - for (int i = 0; i < number; i++) { - result.append(space); - } - return result.toString(); - } - - public static String getFriendlyLength(int lenMeter) { - if (lenMeter > 10000) // 10 km - { - int dis = lenMeter / 1000; - return dis + ChString.Kilometer; - } - - if (lenMeter > 1000) { - float dis = (float) lenMeter / 1000; - DecimalFormat fnum = new DecimalFormat("##0.0"); - String dstr = fnum.format(dis); - return dstr + ChString.Kilometer; - } - - if (lenMeter > 100) { - int dis = lenMeter / 50 * 50; - return dis + ChString.Meter; - } - - int dis = lenMeter / 10 * 10; - if (dis == 0) { - dis = 10; - } - - return dis + ChString.Meter; - } - - public static boolean IsEmptyOrNullString(String s) { - return (s == null) || (s.trim().length() == 0); - } - - /** - * 把LatLng对象转化为LatLonPoint对象 - */ - public static LatLonPoint convertToLatLonPoint(LatLng latlon) { - return new LatLonPoint(latlon.latitude, latlon.longitude); - } - - /** - * 把LatLonPoint对象转化为LatLon对象 - */ - public static LatLng convertToLatLng(LatLonPoint latLonPoint) { - return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()); - } - - /** - * 把集合体的LatLonPoint转化为集合体的LatLng - */ - public static ArrayList convertArrList(List shapes) { - ArrayList lineShapes = new ArrayList(); - for (LatLonPoint point : shapes) { - LatLng latLngTemp = AMapUtil.convertToLatLng(point); - lineShapes.add(latLngTemp); - } - return lineShapes; - } - - /** - * long类型时间格式化 - */ - public static String convertToTime(long time) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(time); - return df.format(date); - } - - public static final String HtmlBlack = "#000000"; - public static final String HtmlGray = "#808080"; - - public static String getFriendlyTime(int second) { - if (second > 3600) { - int hour = second / 3600; - int miniate = (second % 3600) / 60; - return hour + "小时" + miniate + "分钟"; - } - if (second >= 60) { - int miniate = second / 60; - return miniate + "分钟"; - } - return second + "秒"; - } - - //路径规划方向指示和图片对应 - public static int getDriveActionID(String actionName) { - if (actionName == null || actionName.equals("")) { - return R.drawable.dir3; - } - if ("左转".equals(actionName)) { - return R.drawable.dir2; - } - if ("右转".equals(actionName)) { - return R.drawable.dir1; - } - if ("向左前方行驶".equals(actionName) || "靠左".equals(actionName)) { - return R.drawable.dir6; - } - if ("向右前方行驶".equals(actionName) || "靠右".equals(actionName)) { - return R.drawable.dir5; - } - if ("向左后方行驶".equals(actionName) || "左转调头".equals(actionName)) { - return R.drawable.dir7; - } - if ("向右后方行驶".equals(actionName)) { - return R.drawable.dir8; - } - if ("直行".equals(actionName)) { - return R.drawable.dir3; - } - if ("减速行驶".equals(actionName)) { - return R.drawable.dir4; - } - return R.drawable.dir3; - } - - public static int getWalkActionID(String actionName) { - if (actionName == null || actionName.equals("")) { - return R.drawable.dir13; - } - if ("左转".equals(actionName)) { - return R.drawable.dir2; - } - if ("右转".equals(actionName)) { - return R.drawable.dir1; - } - if ("向左前方".equals(actionName) || "靠左".equals(actionName) || actionName.contains("向左前方")) { - return R.drawable.dir6; - } - if ("向右前方".equals(actionName) || "靠右".equals(actionName) || actionName.contains("向右前方")) { - return R.drawable.dir5; - } - if ("向左后方".equals(actionName) || actionName.contains("向左后方")) { - return R.drawable.dir7; - } - if ("向右后方".equals(actionName) || actionName.contains("向右后方")) { - return R.drawable.dir8; - } - if ("直行".equals(actionName)) { - return R.drawable.dir3; - } - if ("通过人行横道".equals(actionName)) { - return R.drawable.dir9; - } - if ("通过过街天桥".equals(actionName)) { - return R.drawable.dir11; - } - if ("通过地下通道".equals(actionName)) { - return R.drawable.dir10; - } - - return R.drawable.dir13; - } - - public static String getBusPathTitle(BusPath busPath) { - if (busPath == null) { - return String.valueOf(""); - } - List busSetps = busPath.getSteps(); - if (busSetps == null) { - return String.valueOf(""); - } - StringBuffer sb = new StringBuffer(); - for (BusStep busStep : busSetps) { - StringBuffer title = new StringBuffer(); - if (busStep.getBusLines().size() > 0) { - for (RouteBusLineItem busline : busStep.getBusLines()) { - if (busline == null) { - continue; - } - - String buslineName = getSimpleBusLineName(busline.getBusLineName()); - title.append(buslineName); - title.append(" / "); - } -// RouteBusLineItem busline = busStep.getBusLines().get(0); - - sb.append(title.substring(0, title.length() - 3)); - sb.append(" > "); - } - if (busStep.getRailway() != null) { - RouteRailwayItem railway = busStep.getRailway(); - sb.append(railway.getTrip() + "(" + railway.getDeparturestop().getName() - + " - " + railway.getArrivalstop().getName() + ")"); - sb.append(" > "); - } - } - return sb.substring(0, sb.length() - 3); - } - - public static String getBusPathDes(BusPath busPath) { - if (busPath == null) { - return String.valueOf(""); - } - long second = busPath.getDuration(); - String time = getFriendlyTime((int) second); - float subDistance = busPath.getDistance(); - String subDis = getFriendlyLength((int) subDistance); - float walkDistance = busPath.getWalkDistance(); - String walkDis = getFriendlyLength((int) walkDistance); - return String.valueOf(time + " | " + subDis + " | 步行" + walkDis); - } - - public static String getSimpleBusLineName(String busLineName) { - if (busLineName == null) { - return String.valueOf(""); - } - return busLineName.replaceAll("\\(.*?\\)", ""); - } - - -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/ChString.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/ChString.java deleted file mode 100755 index 2368d553ca..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/ChString.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -public class ChString { - public static final String Kilometer = "\u516c\u91cc";// "公里"; - public static final String Meter = "\u7c73";// "米"; - public static final String ByFoot = "\u6b65\u884c";// "步行"; - public static final String To = "\u53bb\u5f80";// "去往"; - public static final String Station = "\u8f66\u7ad9";// "车站"; - public static final String TargetPlace = "\u76ee\u7684\u5730";// "目的地"; - public static final String StartPlace = "\u51fa\u53d1\u5730";// "出发地"; - public static final String About = "\u5927\u7ea6";// "大约"; - public static final String Direction = "\u65b9\u5411";// "方向"; - - public static final String GetOn = "\u4e0a\u8f66";// "上车"; - public static final String GetOff = "\u4e0b\u8f66";// "下车"; - public static final String Zhan = "\u7ad9";// "站"; - - public static final String cross = "\u4ea4\u53c9\u8def\u53e3"; // 交叉路口 - public static final String type = "\u7c7b\u522b"; // 类别 - public static final String address = "\u5730\u5740"; // 地址 - public static final String PrevStep = "\u4e0a\u4e00\u6b65"; - public static final String NextStep = "\u4e0b\u4e00\u6b65"; - public static final String Gong = "\u516c\u4ea4"; - public static final String ByBus = "\u4e58\u8f66"; - public static final String Arrive = "\u5230\u8FBE";// 到达 -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/DrivingRouteOverlay.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/DrivingRouteOverlay.java deleted file mode 100755 index 619962b46a..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/DrivingRouteOverlay.java +++ /dev/null @@ -1,388 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import android.content.Context; -import android.graphics.Color; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.PolylineOptions; -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.DrivePath; -import com.amap.api.services.route.DriveStep; -import com.amap.api.services.route.TMC; -import com.mogo.map.impl.amap.R; - -import java.util.ArrayList; -import java.util.List; - - -/** - * 导航路线图层类 - */ -public class DrivingRouteOverlay extends RouteOverlay { - private DrivePath drivePath; - private List throughPointList; - private List throughPointMarkerList = new ArrayList(); - private boolean throughPointMarkerVisible = true; - private List tmcs; - private PolylineOptions mPolylineOptions; - private PolylineOptions mPolylineOptionscolor; - private Context mContext; - private boolean isColorfulline = true; - private float mWidth = 4; - private List mLatLngsOfPath; - - public void setIsColorfulline(boolean iscolorfulline) { - this.isColorfulline = iscolorfulline; - } - - /** - * 根据给定的参数,构造一个导航路线图层类对象。 - * - * @param amap 地图对象。 - * @param path 导航路线规划方案。 - * @param context 当前的activity对象。 - */ - public DrivingRouteOverlay(Context context, - AMap amap, - DrivePath path, - LatLonPoint start, - LatLonPoint end, - List throughPointList) { - super(context); - mContext = context; - mAMap = amap; - this.drivePath = path; - startPoint = AMapUtil.convertToLatLng(start); - endPoint = AMapUtil.convertToLatLng(end); - this.throughPointList = throughPointList; - - initBitmapDescriptor(); - } - - public float getRouteWidth() { - return mWidth; - } - - /** - * 设置路线宽度 - * - * @param mWidth 路线宽度,取值范围:大于0 - */ - public void setRouteWidth(float mWidth) { - this.mWidth = mWidth; - } - - /** - * 添加驾车路线添加到地图上显示。 - */ - public void addToMap() { - initPolylineOptions(); - try { - if (mAMap == null) { - return; - } - - if (mWidth == 0 || drivePath == null) { - return; - } - mLatLngsOfPath = new ArrayList(); - tmcs = new ArrayList(); - List drivePaths = drivePath.getSteps(); - mPolylineOptions.add(startPoint); - for (int i = 0; i < drivePaths.size(); i++) { - DriveStep step = drivePaths.get(i); - List latlonPoints = step.getPolyline(); - List tmclist = step.getTMCs(); - tmcs.addAll(tmclist); - addDrivingStationMarkers(step, convertToLatLng(latlonPoints.get(0))); - for (LatLonPoint latlonpoint : latlonPoints) { - mPolylineOptions.add(convertToLatLng(latlonpoint)); - mLatLngsOfPath.add(convertToLatLng(latlonpoint)); - } - } - mPolylineOptions.add(endPoint); - if (startMarker != null) { - startMarker.remove(); - startMarker = null; - } - - if (endMarker != null) { - endMarker.remove(); - endMarker = null; - } -// addStartAndEndMarker(); -// addThroughPointMarker(); - if (isColorfulline && tmcs.size() > 0) { - colorWayUpdate(tmcs); - showcolorPolyline(); - } else { - showPolyline(); - } - - } catch (Throwable e) { - e.printStackTrace(); - } - } - - /** - * 初始化线段属性 - */ - private void initPolylineOptions() { - mPolylineOptions = null; - mPolylineOptions = new PolylineOptions(); - mPolylineOptions.color(getDriveColor()).width(getRouteWidth()); - } - - private void showPolyline() { - addPolyLine(mPolylineOptions); - } - - private void showcolorPolyline() { - addPolyLine(mPolylineOptionscolor); - } - - /** - * 根据不同的路段拥堵情况展示不同的颜色 - * - * @param tmcSection - */ - private void colorWayUpdate(List tmcSection) { - if (mAMap == null) { - return; - } - if (tmcSection == null || tmcSection.size() <= 0) { - return; - } - TMC segmentTrafficStatus; - mPolylineOptionscolor = null; - mPolylineOptionscolor = new PolylineOptions(); - mPolylineOptionscolor.width(getRouteWidth()); - List colorList = new ArrayList(); - List bitmapDescriptors = new ArrayList(); - List points = new ArrayList<>(); - List texIndexList = new ArrayList(); -// mPolylineOptionscolor.add(startPoint); -// mPolylineOptionscolor.add(AMapUtil.convertToLatLng(tmcSection.get(0).getPolyline().get(0))); - - points.add(startPoint); - points.add(AMapUtil.convertToLatLng(tmcSection.get(0).getPolyline().get(0))); - colorList.add(getDriveColor()); - bitmapDescriptors.add(defaultRoute); - - BitmapDescriptor bitmapDescriptor = null; - int textIndex = 0; - texIndexList.add(textIndex); - texIndexList.add(++textIndex); - for (int i = 0; i < tmcSection.size(); i++) { - segmentTrafficStatus = tmcSection.get(i); - int color = getcolor(segmentTrafficStatus.getStatus()); - bitmapDescriptor = getTrafficBitmapDescriptor(segmentTrafficStatus.getStatus()); - List mployline = segmentTrafficStatus.getPolyline(); - for (int j = 0; j < mployline.size(); j++) { -// mPolylineOptionscolor.add(AMapUtil.convertToLatLng(mployline.get(j))); - points.add(AMapUtil.convertToLatLng(mployline.get(j))); - colorList.add(color); - - texIndexList.add(++textIndex); - bitmapDescriptors.add(bitmapDescriptor); - } - } - - points.add(endPoint); - colorList.add(getDriveColor()); - bitmapDescriptors.add(defaultRoute); - texIndexList.add(++textIndex); - mPolylineOptionscolor.addAll(points); - mPolylineOptionscolor.colorValues(colorList); - -// mPolylineOptionscolor.setCustomTextureIndex(texIndexList); -// mPolylineOptionscolor.setCustomTextureList(bitmapDescriptors); - } - - private BitmapDescriptor defaultRoute = null; - private BitmapDescriptor unknownTraffic = null; - private BitmapDescriptor smoothTraffic = null; - private BitmapDescriptor slowTraffic = null; - private BitmapDescriptor jamTraffic = null; - private BitmapDescriptor veryJamTraffic = null; - - private void initBitmapDescriptor() { - defaultRoute = BitmapDescriptorFactory.fromResource( R.drawable.amap_route_color_texture_6_arrow); - smoothTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_4_arrow); - unknownTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_0_arrow); - slowTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_3_arrow); - jamTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_2_arrow); - veryJamTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_9_arrow); - } - - private BitmapDescriptor getTrafficBitmapDescriptor(String status) { - if (status.equals("畅通")) { - return smoothTraffic; - } else if (status.equals("缓行")) { - return slowTraffic; - } else if (status.equals("拥堵")) { - return jamTraffic; - } else if (status.equals("严重拥堵")) { - return veryJamTraffic; - } else { - return defaultRoute; - } - } - - - private int getcolor(String status) { - if (status.equals("畅通")) { - return Color.GREEN; - } else if (status.equals("缓行")) { - return Color.YELLOW; - } else if (status.equals("拥堵")) { - return Color.RED; - } else if (status.equals("严重拥堵")) { - return Color.parseColor("#990033"); - } else { - return Color.GREEN; - } - } - - public LatLng convertToLatLng(LatLonPoint point) { - return new LatLng(point.getLatitude(), point.getLongitude()); - } - - /** - * @param driveStep - * @param latLng - */ - private void addDrivingStationMarkers(DriveStep driveStep, LatLng latLng) { - addStationMarker(new MarkerOptions() - .position(latLng) - .title("\u65B9\u5411:" + driveStep.getAction() - + "\n\u9053\u8DEF:" + driveStep.getRoad()) - .snippet(driveStep.getInstruction()).visible(nodeIconVisible) - .anchor(0.5f, 0.5f).icon(getDriveBitmapDescriptor())); - } - - @Override - protected LatLngBounds getLatLngBounds() { - LatLngBounds.Builder b = LatLngBounds.builder(); - b.include(new LatLng(startPoint.latitude, startPoint.longitude)); - b.include(new LatLng(endPoint.latitude, endPoint.longitude)); - if (this.throughPointList != null && this.throughPointList.size() > 0) { - for (int i = 0; i < this.throughPointList.size(); i++) { - b.include(new LatLng( - this.throughPointList.get(i).getLatitude(), - this.throughPointList.get(i).getLongitude())); - } - } - return b.build(); - } - - public void setThroughPointIconVisibility(boolean visible) { - try { - throughPointMarkerVisible = visible; - if (this.throughPointMarkerList != null - && this.throughPointMarkerList.size() > 0) { - for (int i = 0; i < this.throughPointMarkerList.size(); i++) { - this.throughPointMarkerList.get(i).setVisible(visible); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - private void addThroughPointMarker() { - if (this.throughPointList != null && this.throughPointList.size() > 0) { - LatLonPoint latLonPoint = null; - for (int i = 0; i < this.throughPointList.size(); i++) { - latLonPoint = this.throughPointList.get(i); - if (latLonPoint != null) { - throughPointMarkerList.add(mAMap - .addMarker((new MarkerOptions()) - .position( - new LatLng(latLonPoint - .getLatitude(), latLonPoint - .getLongitude())) - .visible(throughPointMarkerVisible) - .icon(getThroughPointBitDes()) - .title("\u9014\u7ECF\u70B9"))); - } - } - } - } - - private BitmapDescriptor getThroughPointBitDes() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_through); - - } - - /** - * 获取两点间距离 - * - * @param start - * @param end - * @return - */ - public static int calculateDistance(LatLng start, LatLng end) { - double x1 = start.longitude; - double y1 = start.latitude; - double x2 = end.longitude; - double y2 = end.latitude; - return calculateDistance(x1, y1, x2, y2); - } - - public static int calculateDistance(double x1, double y1, double x2, double y2) { - final double NF_pi = 0.01745329251994329; // 弧度 PI/180 - x1 *= NF_pi; - y1 *= NF_pi; - x2 *= NF_pi; - y2 *= NF_pi; - double sinx1 = Math.sin(x1); - double siny1 = Math.sin(y1); - double cosx1 = Math.cos(x1); - double cosy1 = Math.cos(y1); - double sinx2 = Math.sin(x2); - double siny2 = Math.sin(y2); - double cosx2 = Math.cos(x2); - double cosy2 = Math.cos(y2); - double[] v1 = new double[3]; - v1[0] = cosy1 * cosx1 - cosy2 * cosx2; - v1[1] = cosy1 * sinx1 - cosy2 * sinx2; - v1[2] = siny1 - siny2; - double dist = Math.sqrt(v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2]); - - return (int) (Math.asin(dist / 2) * 12742001.5798544); - } - - - //获取指定两点之间固定距离点 - public static LatLng getPointForDis(LatLng sPt, LatLng ePt, double dis) { - double lSegLength = calculateDistance(sPt, ePt); - double preResult = dis / lSegLength; - return new LatLng((ePt.latitude - sPt.latitude) * preResult + sPt.latitude, (ePt.longitude - sPt.longitude) * preResult + sPt.longitude); - } - - /** - * 去掉DriveLineOverlay上的线段和标记。 - */ - @Override - public void removeFromMap() { - try { - super.removeFromMap(); - if (this.throughPointMarkerList != null - && this.throughPointMarkerList.size() > 0) { - for (int i = 0; i < this.throughPointMarkerList.size(); i++) { - this.throughPointMarkerList.get(i).remove(); - } - this.throughPointMarkerList.clear(); - } - } catch (Throwable e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/OnRouteSearchListenerAdapter.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/OnRouteSearchListenerAdapter.java deleted file mode 100644 index c5189413a8..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/OnRouteSearchListenerAdapter.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import com.amap.api.services.route.BusRouteResult; -import com.amap.api.services.route.DriveRouteResult; -import com.amap.api.services.route.RideRouteResult; -import com.amap.api.services.route.RouteSearch; -import com.amap.api.services.route.WalkRouteResult; - -/** - * @author congtaowang - * @since 2020-01-08 - *

- * 描述 - */ -public abstract class OnRouteSearchListenerAdapter implements RouteSearch.OnRouteSearchListener { - - @Override - public void onBusRouteSearched( BusRouteResult busRouteResult, int i ) { - - } - - @Override - public void onDriveRouteSearched( DriveRouteResult driveRouteResult, int i ) { - - } - - @Override - public void onWalkRouteSearched( WalkRouteResult walkRouteResult, int i ) { - - } - - @Override - public void onRideRouteSearched( RideRouteResult rideRouteResult, int i ) { - - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverLayWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverLayWrapper.java deleted file mode 100644 index 6d645e1b53..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverLayWrapper.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import android.content.Context; -import android.graphics.BitmapFactory; -import android.graphics.Color; -import android.util.Log; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.model.NavigateArrowOptions; -import com.amap.api.maps.model.Polyline; -import com.amap.api.navi.model.AMapNaviLocation; -import com.amap.api.navi.model.AMapNaviPath; -import com.amap.api.navi.model.NaviInfo; -import com.amap.api.navi.model.RouteOverlayOptions; -import com.amap.api.navi.view.RouteOverLay; -import com.mogo.map.impl.amap.utils.MapStyleUtils; -import com.mogo.utils.logger.Logger; - -import java.lang.ref.WeakReference; -import java.lang.reflect.Field; - -/** - * @author congtaowang - * @since 2019-10-04 - *

- * 路径覆盖物 - */ -public class RouteOverLayWrapper { - - private static final String TAG = "RouteOverLayWrapper"; - - private final WeakReference< Context > mContextRef; - private final AMap mAMap; - private final AMapNaviPath mPath; - - private RouteOverLay mRouteOverLay; - private boolean mIsRemoved = true; - - private boolean mIsTrafficLightsVisible = true; - private int mStartBitmapResId = 0; - private int mEndBitmapResId = 0; - private int mZIndex = 1; - - private static RouteOverlayOptions sOptions; - - public RouteOverLayWrapper( Context context, - AMap mAMap, - AMapNaviPath mPath ) { - this.mContextRef = new WeakReference<>( context ); - this.mAMap = mAMap; - this.mPath = mPath; - } - - public void addToMap() { - if ( mContextRef == null || mContextRef.get() == null ) { - return; - } - mRouteOverLay = new RouteOverLay( mAMap, mPath, mContextRef.get() ); - if ( sOptions == null ) { - sOptions = MapStyleUtils.getRouteOverlayOptions(); - } - mRouteOverLay.setRouteOverlayOptions( sOptions ); - mRouteOverLay.setTrafficLine( true ); - mRouteOverLay.setRouteOverlayVisible( true ); - mRouteOverLay.setTrafficLightsVisible( true ); - mRouteOverLay.setArrowOnRoute( true ); - mRouteOverLay.setZindex( mZIndex ); - mRouteOverLay.setNaviArrowVisible( true ); - mRouteOverLay.setLightsVisible( true ); - mRouteOverLay.setTrafficLightsVisible( mIsTrafficLightsVisible ); - hookRouteArrow(); - - if ( mStartBitmapResId != 0 ) { - try { - mRouteOverLay.setStartPointBitmap( BitmapFactory.decodeResource( mContextRef.get().getResources(), mStartBitmapResId ) ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } else { - mRouteOverLay.setStartPointBitmap( null ); - } - - if ( mEndBitmapResId != 0 ) { - try { - mRouteOverLay.setEndPointBitmap( BitmapFactory.decodeResource( mContextRef.get().getResources(), mEndBitmapResId ) ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } else { - mRouteOverLay.setEndPointBitmap( null ); - } - - mRouteOverLay.addToMap(); - mIsRemoved = false; - } - - public void remove() { - Log.d( TAG, "remove" ); - if ( mRouteOverLay != null ) { - try { - mRouteOverLay.removeFromMap(); - mIsRemoved = true; - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } - - /** - * 设置透明度 - * - * @param alpha - */ - public void setTransparency( float alpha ) { - if ( mRouteOverLay != null ) { - mRouteOverLay.setTransparency( alpha ); - } - } - - public RouteOverLayWrapper setTrafficLightsVisible( boolean visible ) { - mIsTrafficLightsVisible = visible; - return this; - } - - public RouteOverLayWrapper setStartBitmap( int startBitmapResId ) { - mStartBitmapResId = startBitmapResId; - return this; - } - - public RouteOverLayWrapper setEndBitmap( int endBitmapResId ) { - mEndBitmapResId = endBitmapResId; - return this; - } - - public RouteOverLayWrapper setZIndex( int zIndex ) { - mZIndex = zIndex; - return this; - } - - public int getZIndex() { - return mZIndex; - } - - @Override - protected void finalize() throws Throwable { - super.finalize(); - mIsRemoved = true; - } - - public synchronized boolean isRemoved() { - return mIsRemoved; - } - - public void updatePolyline( AMapNaviLocation aMapNaviLocation ) { - if ( mIsRemoved ) { - return; - } - if ( mRouteOverLay != null ) { - mRouteOverLay.updatePolyline( aMapNaviLocation ); - } - } - - public void drawArrow( NaviInfo naviInfo ) { - Log.d( TAG, "drawArrow" ); - if ( mIsRemoved ) { - return; - } - if ( naviInfo == null ) { - return; - } - if ( mRouteOverLay != null ) { - try { - mRouteOverLay.drawArrow( mRouteOverLay.getArrowPoints( naviInfo.getCurStep() ) ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } - - private void hookRouteArrow() { - if ( mRouteOverLay != null && sOptions != null ) { - try { - Field field = mRouteOverLay.getClass().getDeclaredField( "naviArrow" ); - field.setAccessible( true ); - field.set( mRouteOverLay, mAMap.addNavigateArrow( new NavigateArrowOptions().topColor( sOptions.getArrowColor() ).width( sOptions.getLineWidth() ).sideColor( sOptions.getArrowSideColor() ) ) ); - Logger.d( TAG, "hook 成功。" ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } - - public Polyline getTrafficColorfulPolyline() { - if ( mRouteOverLay != null ) { - return mRouteOverLay.mTrafficColorfulPolyline; - } - return null; - } - - public void destroy() { - Log.d( TAG, "destroy" ); - if ( mRouteOverLay != null ) { - try { - mRouteOverLay.destroy(); - mIsRemoved = true; - } catch ( Exception e ) { - e.printStackTrace(); - } - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java deleted file mode 100755 index 3dcae30d10..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.Color; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.CameraUpdateFactory; -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.PolylineOptions; -import com.mogo.map.impl.amap.R; - -import java.util.ArrayList; -import java.util.List; - - -public class RouteOverlay { - protected List stationMarkers = new ArrayList(); - protected List allPolyLines = new ArrayList(); - protected Marker startMarker; - protected Marker endMarker; - protected LatLng startPoint; - protected LatLng endPoint; - protected AMap mAMap; - private Context mContext; - private Bitmap startBit, endBit, busBit, walkBit, driveBit; - protected boolean nodeIconVisible = true; - - public RouteOverlay(Context context) { - mContext = context; - } - - /** - * 去掉BusRouteOverlay上所有的Marker。 - * - * @since V2.1.0 - */ - public void removeFromMap() { - if (startMarker != null) { - startMarker.remove(); - - } - if (endMarker != null) { - endMarker.remove(); - } - for (Marker marker : stationMarkers) { - marker.remove(); - } - for (Polyline line : allPolyLines) { - line.remove(); - } - destroyBit(); - } - - private void destroyBit() { - if (startBit != null) { - startBit.recycle(); - startBit = null; - } - if (endBit != null) { - endBit.recycle(); - endBit = null; - } - if (busBit != null) { - busBit.recycle(); - busBit = null; - } - if (walkBit != null) { - walkBit.recycle(); - walkBit = null; - } - if (driveBit != null) { - driveBit.recycle(); - driveBit = null; - } - } - - /** - * 给起点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getStartBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource( R.drawable.amap_start); - } - - /** - * 给终点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getEndBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_end); - } - - /** - * 给公交Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getBusBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_bus); - } - - /** - * 给步行Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getWalkBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_man); - } - - protected BitmapDescriptor getDriveBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_car); - } - - protected void addStartAndEndMarker() { - startMarker = mAMap.addMarker((new MarkerOptions()) - .position(startPoint).icon(getStartBitmapDescriptor()) - .title("\u8D77\u70B9")); - // startMarker.showInfoWindow(); - - endMarker = mAMap.addMarker((new MarkerOptions()).position(endPoint) - .icon(getEndBitmapDescriptor()).title("\u7EC8\u70B9")); - // mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(startPoint, - // getShowRouteZoom())); - } - - /** - * 移动镜头到当前的视角。 - * - * @since V2.1.0 - */ - public void zoomToSpan() { - if (startPoint != null) { - if (mAMap == null) - return; - try { - LatLngBounds bounds = getLatLngBounds(); - mAMap.animateCamera(CameraUpdateFactory - .newLatLngBounds(bounds, 50)); - } catch (Throwable e) { - e.printStackTrace(); - } - } - } - - protected LatLngBounds getLatLngBounds() { - LatLngBounds.Builder b = LatLngBounds.builder(); - b.include(new LatLng(startPoint.latitude, startPoint.longitude)); - b.include(new LatLng(endPoint.latitude, endPoint.longitude)); - for (Polyline polyline : allPolyLines) { - for (LatLng point : polyline.getPoints()) { - b.include(point); - } - } - return b.build(); - } - - /** - * 路段节点图标控制显示接口。 - * - * @param visible true为显示节点图标,false为不显示。 - * @since V2.3.1 - */ - public void setNodeIconVisibility(boolean visible) { - try { - nodeIconVisible = visible; - if (this.stationMarkers != null && this.stationMarkers.size() > 0) { - for (int i = 0; i < this.stationMarkers.size(); i++) { - this.stationMarkers.get(i).setVisible(visible); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - protected void addStationMarker(MarkerOptions options) { - if (options == null) { - return; - } - Marker marker = mAMap.addMarker(options); - if (marker != null) { - stationMarkers.add(marker); - } - - } - - protected void addPolyLine(PolylineOptions options) { - if (options == null) { - return; - } - Polyline polyline = mAMap.addPolyline(options); - if (polyline != null) { - allPolyLines.add(polyline); - } - } - - protected float getRouteWidth() { - return 18f; - } - - protected int getWalkColor() { - return Color.parseColor("#6db74d"); - } - - /** - * 自定义路线颜色。 - * return 自定义路线颜色。 - * - * @since V2.2.1 - */ - protected int getBusColor() { - return Color.parseColor("#537edc"); - } - - protected int getDriveColor() { - return Color.parseColor("#537edc"); - } - - // protected int getShowRouteZoom() { - // return 15; - // } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlayHelper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlayHelper.java deleted file mode 100644 index 62a86be0dc..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlayHelper.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.mogo.map.impl.amap.overlay; - -import android.content.Context; - -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.DriveRouteResult; -import com.amap.api.services.route.RouteSearch; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.AMapWrapper; -import com.mogo.map.impl.amap.InterceptorHandler; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2020-01-08 - *

- * 给定起点、途经点,规划路径 - */ -public class RouteOverlayHelper { - - private static final String TAG = "RouteOverlayHelper"; - - private static volatile RouteOverlayHelper sInstance; - - private DrivingRouteOverlay mDrivingRouteOverlay; - - private RouteOverlayHelper() { - } - - public static RouteOverlayHelper getInstance() { - if ( sInstance == null ) { - synchronized ( RouteOverlayHelper.class ) { - if ( sInstance == null ) { - sInstance = new RouteOverlayHelper(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - public void addRouteWay( final Context context, MogoLatLng start, MogoLatLng end, List< MogoLatLng > wayPoints ) { - if ( wayPoints == null || wayPoints.isEmpty() ) { - return; - } - if ( InterceptorHandler.getInstance().ignoreDrawRouteOverlay( context ) ) { - Logger.w( TAG, "naviing." ); - return; - } - - if ( mDrivingRouteOverlay != null ) { - mDrivingRouteOverlay.removeFromMap(); - } - - RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo( new LatLonPoint( start.lat, start.lng ), - new LatLonPoint( end.lat, end.lng ) ); - final List< LatLonPoint > ways = new ArrayList<>(); - for ( MogoLatLng wayPoint : wayPoints ) { - ways.add( new LatLonPoint( wayPoint.lat, wayPoint.lng ) ); - } - RouteSearch.DriveRouteQuery query = new RouteSearch.DriveRouteQuery( fromAndTo, 0, ways, null, "" ); - RouteSearch routeSearch = new RouteSearch( context ); - routeSearch.calculateDriveRouteAsyn( query ); - routeSearch.setRouteSearchListener( new OnRouteSearchListenerAdapter() { - @Override - public void onDriveRouteSearched( DriveRouteResult driveRouteResult, int i ) { - super.onDriveRouteSearched( driveRouteResult, i ); - if ( i != 1000 ) { - Logger.e( TAG, "算路失败. code = %d", i ); - return; - } - mDrivingRouteOverlay = new DrivingRouteOverlay( context, AMapWrapper.getAMap(), - driveRouteResult.getPaths().get( 0 ), - driveRouteResult.getStartPos(), - driveRouteResult.getTargetPos(), - null ); - mDrivingRouteOverlay.setNodeIconVisibility( false ); - mDrivingRouteOverlay.setIsColorfulline( false ); - mDrivingRouteOverlay.addToMap(); - mDrivingRouteOverlay.zoomToSpan(); - } - } ); - } - - public void removeAll() { - if ( mDrivingRouteOverlay != null ) { - mDrivingRouteOverlay.removeFromMap(); - } - mDrivingRouteOverlay = null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/GeocodeSearchClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/GeocodeSearchClient.java deleted file mode 100644 index 3e6a25132f..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/GeocodeSearchClient.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.mogo.map.impl.amap.search; - -import android.content.Context; - -import com.amap.api.services.core.AMapException; -import com.amap.api.services.geocoder.GeocodeAddress; -import com.amap.api.services.geocoder.GeocodeQuery; -import com.amap.api.services.geocoder.GeocodeResult; -import com.amap.api.services.geocoder.GeocodeSearch; -import com.amap.api.services.geocoder.RegeocodeAddress; -import com.amap.api.services.geocoder.RegeocodeQuery; -import com.amap.api.services.geocoder.RegeocodeResult; -import com.mogo.map.exception.MogoMapException; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.search.geo.IMogoGeoSearch; -import com.mogo.map.search.geo.IMogoGeoSearchListener; -import com.mogo.map.search.geo.MogoGeocodeAddress; -import com.mogo.map.search.geo.MogoRegeocodeAddress; -import com.mogo.map.search.geo.query.MogoGeocodeQuery; -import com.mogo.map.search.geo.query.MogoRegeocodeQuery; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-19 - *

- * 地理编码/逆地理编码高德实现 - */ -public class GeocodeSearchClient implements IMogoGeoSearch, GeocodeSearch.OnGeocodeSearchListener { - - private static final String TAG = "GeocodeSearchClient"; - - private GeocodeSearch mClient; - private IMogoGeoSearchListener mListener; - - public GeocodeSearchClient( Context context ) { - mClient = new GeocodeSearch( context ); - mClient.setOnGeocodeSearchListener( this ); - } - - @Override - public void setGeoSearchListener( IMogoGeoSearchListener listener ) { - mListener = listener; - } - - @Override - public MogoRegeocodeAddress getFromLocation( MogoRegeocodeQuery query ) throws MogoMapException { - try { - RegeocodeAddress regeocodeAddress = mClient.getFromLocation( ObjectUtils.fromMogo( query ) ); - return ObjectUtils.fromAMap( regeocodeAddress ); - } catch ( AMapException e ) { - throw new MogoMapException( e ); - } - } - - @Override - public List< MogoGeocodeAddress > getFromLocationName( MogoGeocodeQuery query ) throws MogoMapException { - try { - List< GeocodeAddress > geocodeAddress = mClient.getFromLocationName( ObjectUtils.fromMogo( query ) ); - if ( geocodeAddress != null ) { - List< MogoGeocodeAddress > mogoGeocodeAddresses = new ArrayList<>(); - for ( GeocodeAddress address : geocodeAddress ) { - MogoGeocodeAddress mogoGeocodeAddress = ObjectUtils.fromAMap( address ); - if ( mogoGeocodeAddress != null ) { - mogoGeocodeAddresses.add( mogoGeocodeAddress ); - } - } - return mogoGeocodeAddresses; - } - return new ArrayList<>(); - } catch ( AMapException e ) { - throw new MogoMapException( e ); - } - } - - @Override - public void getFromLocationAsyn( MogoRegeocodeQuery query ) { - if ( mClient != null ) { - if ( query == null ) { - Logger.e( TAG, "query parameter is null." ); - return; - } - RegeocodeQuery origin = ObjectUtils.fromMogo( query ); - if ( origin == null || !query.check() ) { - Logger.e( TAG, "query parameter is null or no point parameter." ); - return; - } - mClient.getFromLocationAsyn( origin ); - } - } - - @Override - public void getFromLocationNameAsyn( MogoGeocodeQuery query ) { - if ( mClient != null ) { - if ( query == null ) { - Logger.e( TAG, "query parameter is null." ); - return; - } - GeocodeQuery origin = ObjectUtils.fromMogo( query ); - if ( origin == null || !query.check() ) { - Logger.e( TAG, "query parameter is null or locationName is empty." ); - return; - } - mClient.getFromLocationNameAsyn( origin ); - } - } - - @Override - public void onRegeocodeSearched( RegeocodeResult regeocodeResult, int i ) { - if ( mListener != null ) { - mListener.onRegeocodeSearched( ObjectUtils.fromAMap( regeocodeResult ) ); - } - } - - @Override - public void onGeocodeSearched( GeocodeResult geocodeResult, int i ) { - if ( mListener != null ) { - mListener.onGeocodeSearched( ObjectUtils.fromAMap( geocodeResult ) ); - } - } - - @Override - public void destroy() { - mClient = null; - mListener = null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/InputtipsSearch.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/InputtipsSearch.java deleted file mode 100644 index 7ce2a7013f..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/InputtipsSearch.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.mogo.map.impl.amap.search; - -import android.content.Context; - -import com.amap.api.services.core.AMapException; -import com.amap.api.services.help.Inputtips; -import com.amap.api.services.help.InputtipsQuery; -import com.amap.api.services.help.Tip; -import com.mogo.map.exception.MogoMapException; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.search.inputtips.IMogoInputtipsListener; -import com.mogo.map.search.inputtips.IMogoInputtipsSearch; -import com.mogo.map.search.inputtips.MogoTip; -import com.mogo.map.search.inputtips.query.MogoInputtipsQuery; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-20 - *

- * 高德地图 inputtips搜索实现 - */ -public class InputtipsSearch implements IMogoInputtipsSearch, Inputtips.InputtipsListener { - - private static final String TAG = "InputtipsSearch"; - - private Inputtips mClient; - private InputtipsQuery mQuery; - private IMogoInputtipsListener mListener; - - public InputtipsSearch(Context context, MogoInputtipsQuery query) { - mQuery = ObjectUtils.fromMogo(query); - mClient = new Inputtips(context, mQuery); - mClient.setInputtipsListener(this); - } - - @Override - public void setQuery(MogoInputtipsQuery query) { - this.mQuery = ObjectUtils.fromMogo(query); - } - - @Override - public void setInputtipsListener(IMogoInputtipsListener listener) { - this.mListener = listener; - } - - @Override - public void requestInputtipsAsyn() { - if (mClient != null) { - mClient.requestInputtipsAsyn(); - } - } - - @Override - public void onGetInputtips(List list, int i) { - if (i == 1000) { - if (mListener != null) { - mListener.onGetInputtips(getResult(list)); - } - } else { - Logger.e(TAG, "errorcode = " + i); - } - } - - private List getResult(List tips) { - List mogoTips = new ArrayList<>(); - if (tips != null) { - //只添加有坐标的结果 - for (Tip tip : tips) { - MogoTip mogoTip = ObjectUtils.fromAMap(tip); - if (mogoTip != null && mogoTip.getPoint() != null) { - mogoTips.add(mogoTip); - } - } - } - return mogoTips; - } - - @Override - public void destroy() { - mClient = null; - mListener = null; - mQuery = null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/PoiSearchClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/PoiSearchClient.java deleted file mode 100644 index ccefac7867..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/PoiSearchClient.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.mogo.map.impl.amap.search; - -import android.content.Context; - -import com.amap.api.services.core.AMapException; -import com.amap.api.services.core.PoiItem; -import com.amap.api.services.poisearch.PoiResult; -import com.amap.api.services.poisearch.PoiSearch; -import com.mogo.map.exception.MogoMapException; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.search.geo.MogoPoiItem; -import com.mogo.map.search.poisearch.IMogoPoiSearch; -import com.mogo.map.search.poisearch.IMogoPoiSearchListener; -import com.mogo.map.search.poisearch.MogoPoiResult; -import com.mogo.map.search.poisearch.MogoSearchBound; -import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery; -import com.mogo.utils.logger.Logger; - -/** - * @author congtaowang - * @since 2019-12-24 - *

- * poi搜索高德实现 - *

- * 错误码对照表:https://lbs.amap.com/api/android-sdk/guide/map-tools/error-code - */ -public class PoiSearchClient implements IMogoPoiSearch, PoiSearch.OnPoiSearchListener { - - private static final String TAG = "PoiSearchClient"; - - private MogoPoiSearchQuery mQuery; - private PoiSearch mClient; - private IMogoPoiSearchListener mListener; - private MogoSearchBound mBound; - - public PoiSearchClient( Context context, MogoPoiSearchQuery query ) { - mQuery = query; - mClient = new PoiSearch( context, ObjectUtils.fromMogo( mQuery ) ); - mClient.setOnPoiSearchListener( this ); - } - - @Override - public void setPoiSearchListener( IMogoPoiSearchListener listener ) { - mListener = listener; - } - - @Override - public void searchPOIAsyn() { - if ( mClient != null ) { - mClient.searchPOIAsyn(); - } - } - - @Override - public MogoPoiResult searchPOI() throws MogoMapException { - if ( mClient != null ) { - try { - PoiResult search = mClient.searchPOI(); - return ObjectUtils.fromAMap( search ); - } catch ( AMapException e ) { - throw new MogoMapException( e ); - } - } - return null; - } - - @Override - public void setQuery( MogoPoiSearchQuery query ) { - mQuery = query; - if ( mClient != null ) { - mClient.setQuery( ObjectUtils.fromMogo( mQuery ) ); - } - } - - @Override - public MogoPoiItem searchPOIId( String poiId ) throws MogoMapException { - if ( mClient != null ) { - try { - PoiItem poiItem = mClient.searchPOIId( poiId ); - return ObjectUtils.fromAMap( poiItem ); - } catch ( AMapException e ) { - throw new MogoMapException( e ); - } - } - return null; - } - - @Override - public void searchPOIIdAsyn( String poiId ) { - if ( mClient != null ) { - mClient.searchPOIIdAsyn( poiId ); - } - } - - @Override - public void setBound( MogoSearchBound bound ) { - mBound = bound; - if ( mClient != null ) { - mClient.setBound( ObjectUtils.fromMogo( mBound ) ); - } - } - - @Override - public void onPoiSearched( PoiResult poiResult, int errorCode ) { - if ( errorCode != 1000 ) { - Logger.e( TAG, "errorcode is %d", errorCode ); - } - if ( mListener != null ) { - mListener.onPoiSearched( ObjectUtils.fromAMap( poiResult ), errorCode ); - } - } - - @Override - public void onPoiItemSearched( PoiItem poiItem, int errorCode ) { - if ( errorCode != 1000 ) { - Logger.e( TAG, "errorcode is %d", errorCode ); - } - if ( mListener != null ) { - mListener.onPoiItemSearched( ObjectUtils.fromAMap( poiItem ), errorCode ); - } - } - - @Override - public void destroy() { - mQuery = null; - mClient = null; - mListener = null; - mBound = null; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/RoadSearchClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/RoadSearchClient.java deleted file mode 100644 index 73f4b45b5a..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/RoadSearchClient.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.mogo.map.impl.amap.search; - -import android.content.Context; - -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.BusRouteResult; -import com.amap.api.services.route.DrivePath; -import com.amap.api.services.route.DriveRouteResult; -import com.amap.api.services.route.DriveStep; -import com.amap.api.services.route.RideRouteResult; -import com.amap.api.services.route.RouteSearch; -import com.amap.api.services.route.WalkRouteResult; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.impl.amap.utils.ObjectUtils; -import com.mogo.map.search.drive.IMogoRoadSearch; -import com.mogo.map.search.drive.IMogoRoadSearchListener; -import com.mogo.map.search.drive.MogoRoadSearchQuery; -import com.mogo.utils.logger.Logger; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author congtaowang - * @since 2020/6/1 - *

- * 描述 - */ -public class RoadSearchClient implements IMogoRoadSearch, RouteSearch.OnRouteSearchListener { - - private static final String TAG = "DriveSearchClient"; - - private RouteSearch mRouteSearch; - private IMogoRoadSearchListener mListener; - - @Override - public void searchRoadPath( Context context, - MogoRoadSearchQuery query ) { - - if ( query == null ) { - return; - } - - if ( !checkPoint( query.mStart, "起点坐标" ) ) { - return; - } - - if ( !checkPoint( query.mTarget, "终点坐标" ) ) { - return; - } - - RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo( ObjectUtils.fromMogo( query.mStart ), ObjectUtils.fromMogo( query.mTarget ) ); - final List< LatLonPoint > latLonPointWays = new ArrayList<>(); - if ( query.mWays != null ) { - for ( MogoLatLng wayPoint : query.mWays ) { - if ( checkPoint( wayPoint, "途经点" ) ) { - latLonPointWays.add( ObjectUtils.fromMogo( wayPoint ) ); - } - } - } - - RouteSearch.DriveRouteQuery searchQuery = new RouteSearch.DriveRouteQuery( fromAndTo, RouteSearch.DRIVING_MULTI_CHOICE_AVOID_CONGESTION, latLonPointWays, null, "" ); - if ( mRouteSearch == null ) { - mRouteSearch = new RouteSearch( context ); - mRouteSearch.setRouteSearchListener(this); - } - mRouteSearch.calculateDriveRouteAsyn( searchQuery ); - } - - private boolean checkPoint( MogoLatLng latLng, String msg ) { - if ( latLng == null ) { - Logger.e( TAG, msg + " is null" ); - return false; - } - if ( latLng.lat <= 0d || latLng.lon <= 0d ) { - Logger.e( TAG, msg + " is not a valid " ); - return false; - } - return true; - } - - @Override - public void setRoadPathSearchListener( IMogoRoadSearchListener listener ) { - mListener = listener; - } - - @Override - public void onBusRouteSearched( BusRouteResult busRouteResult, int i ) { - - } - - @Override - public void onDriveRouteSearched( DriveRouteResult driveRouteResult, int i ) { - if ( mListener == null ) { - return; - } - List< MogoLatLng > points = new ArrayList<>(); - Logger.d(TAG,"onDriveRouteSearched i : " + i); - if ( driveRouteResult == null - || driveRouteResult.getPaths() == null - || driveRouteResult.getPaths().isEmpty() ) { - Logger.d(TAG,"onDriveRouteSearched result is null"); - mListener.onDrivePathSearched( null ); - return; - } - DrivePath drivePath = driveRouteResult.getPaths().get( 0 ); - int size = driveRouteResult.getPaths().size(); - Logger.d(TAG,"onDriveRouteSearched driveRouteResult size : " + size); - - List< DriveStep > steps = drivePath.getSteps(); - if ( steps == null || steps.isEmpty() ) { - mListener.onDrivePathSearched( null ); - return; - } - for ( DriveStep step : steps ) { - List< LatLonPoint > polylineList = step.getPolyline(); - if ( polylineList == null || polylineList.isEmpty() ) { - continue; - } - for ( LatLonPoint latLonPoint : polylineList ) { - MogoLatLng latLng = ObjectUtils.fromAMap( latLonPoint ); - if ( latLng == null ) { - continue; - } - points.add( latLng ); - } - } - mListener.onDrivePathSearched( points ); - } - - @Override - public void onWalkRouteSearched( WalkRouteResult walkRouteResult, int i ) { - - } - - @Override - public void onRideRouteSearched( RideRouteResult rideRouteResult, int i ) { - - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/TrafficSearchClient.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/TrafficSearchClient.java deleted file mode 100644 index fa772f2c7b..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/search/TrafficSearchClient.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.mogo.map.impl.amap.search; - -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.traffic.CircleTrafficQuery; -import com.amap.api.services.traffic.RoadTrafficQuery; -import com.amap.api.services.traffic.TrafficSearch; -import com.amap.api.services.traffic.TrafficStatusEvaluation; -import com.amap.api.services.traffic.TrafficStatusInfo; -import com.amap.api.services.traffic.TrafficStatusResult; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.search.traffic.IMogoTrafficSearch; -import com.mogo.map.search.traffic.IMogoTrafficSearchListener; -import com.mogo.map.search.traffic.MogoTrafficResult; -import com.mogo.map.search.traffic.MogoTrafficStatusEvaluation; -import com.mogo.map.search.traffic.MogoTrafficStatusInfo; -import com.mogo.utils.Dispatch; -import com.mogo.utils.logger.Logger; -import com.mogo.utils.network.utils.GsonUtil; - -import java.util.ArrayList; -import java.util.List; - -public class TrafficSearchClient implements IMogoTrafficSearch, TrafficSearch.OnTrafficSearchListener { - - private static final String TAG = "TrafficSearchClient"; - private static final int DEFAULT_SEARCH_RADIUS = 500; - - private IMogoTrafficSearchListener mListener; - private TrafficSearch trafficSearch; - - public TrafficSearchClient() { - if (trafficSearch == null) { - trafficSearch = new TrafficSearch(AbsMogoApplication.getApp().getApplicationContext()); - trafficSearch.setTrafficSearchListener(this); - } - } - - @Override - public void searchTrafficByRoad(String adCode, String roadName) { - if (adCode == null || roadName == null) { - if (mListener != null) { - mListener.onTrafficSearchError("adCode or roadName can not be null"); - } - return; - } - String formatRoadName = roadName.replace("/", "").replace(",", ""); - Logger.d(TAG, "searchTrafficByRoad formatRoad : " + formatRoadName); - RoadTrafficQuery roadTrafficQuery = new RoadTrafficQuery(formatRoadName, adCode, TrafficSearch.ROAD_LEVEL_NONAME_WAY); - try { - trafficSearch.loadTrafficByRoadAsyn(roadTrafficQuery); - } catch (Exception e) { - e.printStackTrace(); - if (mListener != null) { - mListener.onTrafficSearchError(e.getMessage()); - } - } - } - - @Override - public void searchTrafficByCircleArea(MogoLatLng mogoLatLng, int radius) { - if (mogoLatLng == null) { - if (mListener != null) { - mListener.onTrafficSearchError("adCode or roadName can not be null"); - } - return; - } - if (radius <= 0) { - radius = DEFAULT_SEARCH_RADIUS; - } - CircleTrafficQuery circleTrafficQuery = new CircleTrafficQuery(new LatLonPoint(mogoLatLng.getLat(), mogoLatLng.lon), radius, TrafficSearch.ROAD_LEVEL_NONAME_WAY); - Logger.d(TAG, "loadTrafficByCircle circleTrafficQuery : " + circleTrafficQuery.toString()); - try { - trafficSearch.loadTrafficByCircleAsyn(circleTrafficQuery); - } catch (Exception e) { - e.printStackTrace(); - if (mListener != null) { - mListener.onTrafficSearchError(e.getMessage()); - } - } - } - - @Override - public void registerTrafficSearchListener(IMogoTrafficSearchListener listener) { - mListener = listener; - } - - @Override - public void onRoadTrafficSearched(TrafficStatusResult trafficStatusResult, int i) { - if (mListener == null) { - return; - } - if (trafficStatusResult != null && i == 1000) { - Logger.d(TAG, "onRoadTrafficSearched result : " + GsonUtil.jsonFromObject(trafficStatusResult)); - long startTime = System.currentTimeMillis(); - - List trafficStatusInfoList = new ArrayList<>(); - List statusInfo = trafficStatusResult.getRoads(); - Dispatch.stream(statusInfo).forEach(info -> { - MogoTrafficStatusInfo mogoTrafficStatusInfo = new MogoTrafficStatusInfo(); - mogoTrafficStatusInfo.setAngle(info.getAngle()); - mogoTrafficStatusInfo.setDirection(info.getDirection()); - mogoTrafficStatusInfo.setName(info.getName()); - mogoTrafficStatusInfo.setStatus(info.getStatus()); - List mogoLatLngs = new ArrayList<>(); - Dispatch.stream(info.getCoordinates()).forEach(latLonPoint -> mogoLatLngs.add(new MogoLatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()))); - mogoTrafficStatusInfo.setMogoLatLngs(mogoLatLngs); - trafficStatusInfoList.add(mogoTrafficStatusInfo); - }); - MogoTrafficResult mogoTrafficResult = new MogoTrafficResult(); - mogoTrafficResult.setDescription(trafficStatusResult.getDescription()); - mogoTrafficResult.setTrafficStatusInfos(trafficStatusInfoList); - long endTime = System.currentTimeMillis(); - Logger.d(TAG, "onRoadTrafficSearched MogoTrafficResult : " + GsonUtil.jsonFromObject(mogoTrafficResult)); - Logger.d(TAG, "onRoadTrafficSearched countTime : " + (endTime - startTime)); - mListener.onTrafficSearchInfo(mogoTrafficResult); - } else { - mListener.onTrafficSearchError("交通态势查询返回 errorCode : " + i + " trafficStatusResult : " + trafficStatusResult); - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java deleted file mode 100644 index 0bb8ebc73b..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.mogo.map.impl.amap.uicontroller; - -import android.graphics.Point; -import android.graphics.Rect; -import android.location.Location; -import android.view.View; -import android.view.animation.Interpolator; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.uicontroller.CarCursorOption; -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.map.uicontroller.VisualAngleMode; -import com.mogo.utils.logger.Logger; - -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-26 - *

- * 描述 - */ -public class AMapUIController implements IMogoMapUIController { - - private static final String TAG = "AMapUIController"; - - private static volatile AMapUIController sInstance; - - private IMogoMapUIController mClient; - - private AMapUIController() { - } - - public static AMapUIController getInstance() { - if (sInstance == null) { - synchronized (AMapUIController.class) { - if (sInstance == null) { - sInstance = new AMapUIController(); - } - } - } - return sInstance; - } - - public void initClient(IMogoMapUIController client) { - Logger.d("whatthefuck-AMapUIController", "init %s", this); - this.mClient = client; - } - - public synchronized void destroy() { - mClient = null; - } - - public static synchronized void release() { - sInstance.destroy(); - sInstance = null; - } - - @Override - public void setTrafficEnabled(boolean visible) { - if (mClient != null) { - mClient.setTrafficEnabled(visible); - } - } - - @Override - public MapControlResult changeZoom(boolean zoom) { - if (mClient != null) { - return mClient.changeZoom(zoom); - } - return MapControlResult.ERROR; - } - - @Override - public MapControlResult changeZoom(float zoom) { - if (mClient != null) { - return mClient.changeZoom(zoom); - } - return MapControlResult.ERROR; - } - - @Override - public void changeMapMode(EnumMapUI mode) { - Logger.d("whatthefuck-AMapUIController", "%s", this); - if (mClient != null) { - mClient.changeMapMode(mode); - } - } - - @Override - public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) { - - } - - @Override - public VisualAngleMode getCurrentMapVisualAngle() { - return null; - } - - @Override - public void moveToCenter(MogoLatLng latLng, boolean animate) { - if (mClient != null) { - mClient.moveToCenter(latLng, animate); - } - } - - @Override - public void showMyLocation(boolean visible) { - if (mClient != null) { - mClient.showMyLocation(visible); - } - } - - @Override - public void emphasizeMyLocation() { - if (mClient != null) { - mClient.emphasizeMyLocation(); - } - } - - @Override - public void showMyLocation(View view) { - if (mClient != null) { - mClient.showMyLocation(view); - } - } - - @Override - public void recoverLockMode() { - if (mClient != null) { - mClient.recoverLockMode(); - } - } - - @Override - public void loseLockMode() { - if (mClient != null) { - mClient.loseLockMode(); - } - } - - @Override - public void setLockZoom(int var1) { - if (mClient != null) { - mClient.setLockZoom(var1); - } - } - - @Override - public void displayOverview(Rect bounds) { - if (mClient != null) { - mClient.displayOverview(bounds); - } - } - - @Override - public float getScalePerPixel() { - if (mClient != null) { - return mClient.getScalePerPixel(); - } - return 0; - } - - @Override - public float getZoomLevel() { - if (mClient != null) { - return mClient.getZoomLevel(); - } - return 0; - } - - @Override - public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) { - if (mClient != null) { - return mClient.getRoadWidth(lon, lat, angle, isGpsLocation, isRTK); - } - return 0; - } - - @Override - public MogoLatLng getCameraNorthEastPosition() { - if (mClient != null) { - return mClient.getCameraNorthEastPosition(); - } - return null; - } - - @Override - public MogoLatLng getCameraSouthWestPosition() { - if (mClient != null) { - return mClient.getCameraSouthWestPosition(); - } - return null; - } - - @Override - public MogoLatLng getWindowCenterLocation() { - if (mClient != null) { - return mClient.getWindowCenterLocation(); - } - return null; - } - - @Override - public void setPointToCenter(double mapCenterX, double mapCenterY) { - if (mClient != null) { - mClient.setPointToCenter(mapCenterX, mapCenterY); - } - } - - @Override - public Point getLocationPointInScreen(MogoLatLng latLng) { - if (mClient != null) { - return mClient.getLocationPointInScreen(latLng); - } - return null; - } - - @Override - public MogoLatLng getLocationMogoLatLngInScreen(Point point) { - if (mClient != null) { - return mClient.getLocationMogoLatLngInScreen(point); - } - return null; - } - - @Override - public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator, - long duration) { - if (mClient != null) { - mClient.startJumpAnimation(marker, high, interpolator, duration); - } - } - - @Override - public void setRenderFps(int fps) { - if (mClient != null) { - mClient.setRenderFps(fps); - } - } - - @Override - public void showBounds(String tag, MogoLatLng carPosition, List lonLats, Rect bound, boolean lockCarPosition) { - if (mClient != null) { - mClient.showBounds(tag, carPosition, lonLats, bound, lockCarPosition); - } - } - - @Override - public void forceRender() { - if (mClient != null) { - mClient.forceRender(); - } - } - - @Override - public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception { - if (mClient != null) { - return mClient.calculateLineDistance(p1, p2); - } - return 0; - } - - @Override - public EnumMapUI getCurrentUiMode() { - if (mClient != null) { - return mClient.getCurrentUiMode(); - } - return null; - } - - @Override - public void changeMyLocation(Location location) { - if (mClient != null) { - mClient.changeMyLocation(location); - } - } - - @Override - public boolean isCarLocked() { - if (mClient != null) { - return mClient.isCarLocked(); - } - return false; - } - - @Override - public void setCarCursorOption(CarCursorOption option) { - if (mClient != null) { - mClient.setCarCursorOption(option); - } - } - - @Override - public MapCameraPosition getMapCameraPosition() { - if (mClient != null) { - return mClient.getMapCameraPosition(); - } - return null; - } - - @Override - public void changeBearing(float bearing) { - if (mClient != null) { - mClient.changeBearing(bearing); - } - } - - @Override - public void setAdasRecognizedResult(int drawLevel) { - if ( mClient != null ) { - mClient.setAdasRecognizedResult(drawLevel); - } - } - - @Override - public long getTileId(double lon, double lat) { - return 0; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/CoordinateConvertUtils.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/CoordinateConvertUtils.java deleted file mode 100644 index f4542d2fa6..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/CoordinateConvertUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.mogo.map.impl.amap.utils; - -import android.content.Context; - -import com.amap.api.maps.CoordinateConverter; -import com.amap.api.maps.model.LatLng; -import com.mogo.eagle.core.data.map.MogoLatLng; - -import java.util.ArrayList; -import java.util.List; - -public class CoordinateConvertUtils { - - public static MogoLatLng CoordinateConverterFrom84(Context mContext, MogoLatLng mogoLatLng){ - CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext); - mCoordinateConverter.from(CoordinateConverter.CoordType.GPS); - mCoordinateConverter.coord(new LatLng(mogoLatLng.lat,mogoLatLng.lon)); - LatLng latLng = mCoordinateConverter.convert(); - return new MogoLatLng(latLng.latitude,latLng.longitude); - } - - public static List CoordinateConverterFrom84ForList(Context mContext, List mogoLatLngList){ - - List list = new ArrayList<>(); - for (MogoLatLng m:mogoLatLngList) { - MogoLatLng mogoLatLng = CoordinateConverterFrom84(mContext,m); - list.add(mogoLatLng); - } - return list; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/IconTypeUtils.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/IconTypeUtils.java deleted file mode 100644 index 46657869d0..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/IconTypeUtils.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.mogo.map.impl.amap.utils; - -import android.content.Context; -import android.util.SparseArray; - -import com.amap.api.navi.enums.IconType; - -/** - * @author congtaowang - * @since 2019-09-29 - *

- * 描述 - */ -public class IconTypeUtils { - - private static SparseArray< String > sIconName = new SparseArray<>(); - - static { - sIconName.put( IconType.ARRIVED_DESTINATION, "到达目的地" ); - sIconName.put( IconType.ARRIVED_SERVICE_AREA, "到达服务区" ); - sIconName.put( IconType.ARRIVED_TOLLGATE, "到达收费站" ); - sIconName.put( IconType.ARRIVED_TUNNEL, "到达隧道" ); - sIconName.put( IconType.ARRIVED_WAYPOINT, "到达途经点" ); - sIconName.put( IconType.BRIDGE, "通过桥" ); - sIconName.put( IconType.BY_ELEVATOR, "电梯换层" ); - sIconName.put( IconType.BY_ESCALATOR, "扶梯换层" ); - sIconName.put( IconType.BY_STAIR, "楼梯换层" ); - sIconName.put( IconType.CABLEWAY, "通过索道" ); - sIconName.put( IconType.CHANNEL, "通过通道" ); - sIconName.put( IconType.CROSSWALK, "通过人行横道" ); - sIconName.put( IconType.CRUISE_ROUTE, "通过游船路线" ); - sIconName.put( IconType.DEFAULT, "自车" ); - sIconName.put( IconType.ENTER_BUILDING, "进入建筑物" ); - sIconName.put( IconType.ENTER_ROUNDABOUT, "进入环岛" ); - sIconName.put( IconType.ENTRY_LEFT_RING, "进入环岛" ); - sIconName.put( IconType.ENTRY_LEFT_RING_CONTINUE, "绕环岛直行" ); - sIconName.put( IconType.ENTRY_LEFT_RING_LEFT, "绕环岛左转" ); - sIconName.put( IconType.ENTRY_LEFT_RING_RIGHT, "绕环岛右转" ); - sIconName.put( IconType.ENTRY_LEFTRINGU_TURN, "绕环岛调头" ); - sIconName.put( IconType.ENTRY_RING_CONTINUE, "绕环岛直行" ); - sIconName.put( IconType.ENTRY_RING_LEFT, "绕环岛左转" ); - sIconName.put( IconType.ENTRY_RING_RIGHT, "绕环岛右转" ); - sIconName.put( IconType.ENTRY_RING_UTURN, "绕环岛调头" ); - sIconName.put( IconType.FERRY, "通过轮渡" ); - sIconName.put( IconType.LADDER, "通过阶梯" ); - sIconName.put( IconType.LEAVE_BUILDING, "离开建筑物" ); - sIconName.put( IconType.LEAVE_LEFT_RING, "驶出环岛" ); - sIconName.put( IconType.LEFT, "左转" ); - sIconName.put( IconType.LEFT_BACK, "左后" ); - sIconName.put( IconType.LEFT_FRONT, "左前方" ); - sIconName.put( IconType.LEFT_TURN_AROUND, "左转掉头" ); - sIconName.put( IconType.LIFT, "通过直梯" ); - sIconName.put( IconType.LOW_CROSS, "通过普通路口" ); - sIconName.put( IconType.LOW_TRAFFIC_CROSS, "红绿灯路口" ); - sIconName.put( IconType.NONE, "无定义" ); - sIconName.put( IconType.OUT_ROUNDABOUT, "驶出环岛" ); - sIconName.put( IconType.OVERPASS, "通过过街天桥" ); - sIconName.put( IconType.PARK, "通过公园" ); - sIconName.put( IconType.RIGHT, "右转" ); - sIconName.put( IconType.RIGHT_BACK, "右后方" ); - sIconName.put( IconType.RIGHT_FRONT, "右前方" ); - sIconName.put( IconType.SIGHTSEEING_BUSLINE, "通过观光车路线" ); - sIconName.put( IconType.SKY_CHANNEL, "通过空中通道" ); - sIconName.put( IconType.SLIDEWAY, "通过滑道" ); - sIconName.put( IconType.SLOPE, "通过斜坡" ); - sIconName.put( IconType.SPECIAL_CONTINUE, "顺行" ); - sIconName.put( IconType.SQUARE, "通过广场" ); - sIconName.put( IconType.STAIRCASE, "通过扶梯" ); - sIconName.put( IconType.STRAIGHT, "直行" ); - sIconName.put( IconType.SUBWAY, "通过地铁通道" ); - sIconName.put( IconType.U_TURN_RIGHT, "右转掉头" ); - sIconName.put( IconType.UNDERPASS, "通过地下通道" ); - sIconName.put( IconType.WALK_ROAD, "通过行人道路" ); - } - - private static int lastIconType = 0; - private static int lastIconResId = 0; - - public static String getNameByIconType( int iconType ) { - return sIconName.get( iconType ); - } - - public static int getResIdByIconType( Context context, int iconType ) { - try { - if ( iconType == lastIconType ) { - return lastIconResId; - } - int target = context.getResources().getIdentifier( "ic_" + iconType, "drawable", context.getPackageName() ); - lastIconType = iconType; - lastIconResId = target; - return target; - } catch ( Exception e ) { - return -1; - } - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MapStyleUtils.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MapStyleUtils.java deleted file mode 100644 index f60caf9da8..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MapStyleUtils.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.mogo.map.impl.amap.utils; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.Color; - -import com.amap.api.navi.model.RouteOverlayOptions; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.map.impl.amap.R; -import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper; -import com.mogo.utils.WindowUtils; - -/** - * @author congtaowang - * @since 2019-10-04 - *

- * 描述 - */ -public class MapStyleUtils { - - enum ColorEnum { - route_overlay_line_normal( Color.parseColor( "#00C96D" ) ), - route_overlay_line_unknown( Color.parseColor( "#3CD26E" ) ), - route_overlay_line_slow( Color.parseColor( "#ECC71F" ) ), - route_overlay_line_very_traffic( Color.parseColor( "#E16262" ) ), - route_overlay_line_traffic( Color.parseColor( "#E88181" ) ), - transparent( Color.parseColor( "#00000000" ) ), - light_gray( Color.parseColor( "#334BD089" ) ); - - private int color; - - ColorEnum( int color ) { - this.color = color; - } - - public int getColor() { - return color; - } - } - - public static RouteOverlayOptions getRouteOverlayOptions() { - RouteOverlayOptions options = new RouteOverlayOptions(); - // 设置导航线路的宽度 - options.setLineWidth( AbsMogoApplication.getApp().getResources().getDimension(R.dimen.path_width) ); -// // 设置交通状况情况良好下的纹理位图 -// options.setSmoothTraffic( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) ); -// // 设置路线的图标 -// options.setNormalRoute( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) ); -// // 设置交通状况未知下的纹理位图 -// options.setUnknownTraffic( colorToBitmap( ColorEnum.route_overlay_line_unknown.getColor() ) ); -// // 设置交通状况迟缓下的纹理位图 -// options.setSlowTraffic( colorToBitmap( ColorEnum.route_overlay_line_slow.getColor() ) ); -// // 设置交通状况非常拥堵下的纹理位图 -// options.setVeryJamTraffic( colorToBitmap( ColorEnum.route_overlay_line_very_traffic.getColor() ) ); -// // 设置交通状况拥堵下的纹理位图 -// options.setJamTraffic( colorToBitmap( ColorEnum.route_overlay_line_traffic.getColor() ) ); -// // 设置浮于道路上的『小箭头』图标的纹理位图 -// options.setArrowOnTrafficRoute( colorToBitmap( ColorEnum.transparent.getColor() ) ); - // 自定义走过路线纹理,默认走过路线置灰功能为关,需要在AMapNaviViewOptions.setAfterRouteAutoGray(boolean)打开,该方法才生效 - options.setPassRoute( colorToBitmap( ColorEnum.light_gray.getColor() ) ); -// // 设置路线虚线纹理 -// options.setFairWayRes( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) ); - options.setArrowColor( Color.parseColor( "#92C9FF" ) ); // 高德地图内部配置颜色 - options.setArrowSideColor( Color.parseColor( "#4F9BF2" ) ); // 高德地图内部配置颜色 - return options; - } - - public static Bitmap colorToBitmap( int color ) { - Bitmap.Config config = Bitmap.Config.ARGB_8888; - Bitmap bitmap = Bitmap.createBitmap( 1, 1, config ); - bitmap.eraseColor( color ); - return bitmap; - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MogoMapUtils.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MogoMapUtils.java deleted file mode 100644 index 91a51fc994..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/MogoMapUtils.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.mogo.map.impl.amap.utils; - -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.exception.MogoMapException; -import com.mogo.utils.logger.Logger; - -import java.util.List; - -/** - * @author congtaowang - * @since 2020-03-04 - *

- * 地图工具类 - */ -public class MogoMapUtils { - - private static final String TAG = "MogoMapUtils"; - - public static LatLngBounds getLatLngBounds( MogoLatLng carPosition, List< MogoLatLng > lonLats, boolean lockCarPosition ) throws Exception { - - if ( lonLats == null || lonLats.isEmpty() ) { - throw new MogoMapException( "经纬度不能为null或空集合" ); - } - LatLngBounds.Builder builder = new LatLngBounds.Builder(); - for ( MogoLatLng lonLat : lonLats ) { - builder.include( ObjectUtils.fromMogo2( lonLat ) ); - } - if ( carPosition != null && !lockCarPosition ) { - builder.include( ObjectUtils.fromMogo2( carPosition ) ); - } - LatLngBounds latLngBounds = builder.build(); - if ( !lockCarPosition ) { - return latLngBounds; - } - - if ( carPosition == null ) { - throw new MogoMapException( "自车位置经纬度信息不能为空" ); - } - - if ( latLngBounds.northeast == null && latLngBounds.southwest == null ) { - return null; - } - - double south = 0.0; - double west = 0.0; - - double east = 0.0; - double north = 0.0; - - double dLat = 0.0; - double dLon = 0.0; - - if ( latLngBounds.northeast == null ) { - dLat = Math.abs( carPosition.lat - latLngBounds.southwest.latitude ); - dLon = Math.abs( carPosition.lng - latLngBounds.southwest.longitude ); - } else if ( latLngBounds.southwest == null ) { - dLat = Math.abs( carPosition.lat - latLngBounds.northeast.latitude ); - dLon = Math.abs( carPosition.lng - latLngBounds.northeast.longitude ); - } else { - final double dLat1 = Math.abs( carPosition.lat - latLngBounds.southwest.latitude ); - final double dLon1 = Math.abs( carPosition.lng - latLngBounds.southwest.longitude ); - final double dLat2 = Math.abs( carPosition.lat - latLngBounds.northeast.latitude ); - final double dLon2 = Math.abs( carPosition.lng - latLngBounds.northeast.longitude ); - dLat = dLat1 > dLat2 ? dLat1 : dLat2; - dLon = dLon1 > dLon2 ? dLon1 : dLon2; - } - - west = carPosition.lat - dLat; - south = carPosition.lng + dLon; - - east = carPosition.lat + dLat; - north = carPosition.lng - dLon; - - if ( south == 0.0 || west == 0.0 || east == 0.0 || north == 0.0 ) { - return null; - } - - if ( east < west ) { - double tmp = east; - east = west; - west = tmp; - } - - if( north < south ){ - double tmp = north; - north = south; - south = tmp; - } - - Logger.d( TAG, "west = %s, east = %s, north = %s, south = %s", west, east, north, south ); - - return new LatLngBounds.Builder().include( new LatLng( east, north ) ).include( new LatLng( west, south ) ).build(); - } -} diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/ObjectUtils.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/ObjectUtils.java deleted file mode 100644 index db7af8df93..0000000000 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/utils/ObjectUtils.java +++ /dev/null @@ -1,756 +0,0 @@ -package com.mogo.map.impl.amap.utils; - -import android.content.Context; -import android.graphics.Bitmap; -import android.view.View; - -import com.amap.api.location.AMapLocation; -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.CameraPosition; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.Poi; -import com.amap.api.maps.model.PolylineOptions; -import com.amap.api.navi.model.AMapCongestionLink; -import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo; -import com.amap.api.navi.model.AimLessModeCongestionInfo; -import com.amap.api.navi.model.NaviInfo; -import com.amap.api.navi.model.NaviLatLng; -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.core.PoiItem; -import com.amap.api.services.geocoder.AoiItem; -import com.amap.api.services.geocoder.BusinessArea; -import com.amap.api.services.geocoder.GeocodeAddress; -import com.amap.api.services.geocoder.GeocodeQuery; -import com.amap.api.services.geocoder.GeocodeResult; -import com.amap.api.services.geocoder.RegeocodeAddress; -import com.amap.api.services.geocoder.RegeocodeQuery; -import com.amap.api.services.geocoder.RegeocodeResult; -import com.amap.api.services.geocoder.RegeocodeRoad; -import com.amap.api.services.geocoder.StreetNumber; -import com.amap.api.services.help.InputtipsQuery; -import com.amap.api.services.help.Tip; -import com.amap.api.services.poisearch.IndoorData; -import com.amap.api.services.poisearch.Photo; -import com.amap.api.services.poisearch.PoiItemExtension; -import com.amap.api.services.poisearch.PoiResult; -import com.amap.api.services.poisearch.PoiSearch; -import com.amap.api.services.poisearch.SubPoiItem; -import com.amap.api.services.road.Crossroad; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.location.MogoLocation; -import com.mogo.map.marker.IMogoMarkerIconViewCreator; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.map.model.MogoPoi; -import com.mogo.map.navi.MogoCongestionInfo; -import com.mogo.map.navi.MogoCongestionLink; -import com.mogo.map.navi.MogoNaviInfo; -import com.mogo.map.navi.MogoNaviListenerHandler; -import com.mogo.map.navi.MogoTraffic; -import com.mogo.map.overlay.MogoPolylineOptions; -import com.mogo.map.search.geo.MogoAoiItem; -import com.mogo.map.search.geo.MogoBusinessArea; -import com.mogo.map.search.geo.MogoCrossroad; -import com.mogo.map.search.geo.MogoGeocodeAddress; -import com.mogo.map.search.geo.MogoGeocodeResult; -import com.mogo.map.search.geo.MogoIndoorData; -import com.mogo.map.search.geo.MogoPhoto; -import com.mogo.map.search.geo.MogoPoiItem; -import com.mogo.map.search.geo.MogoPoiItemExtension; -import com.mogo.map.search.geo.MogoRegeocodeAddress; -import com.mogo.map.search.geo.MogoRegeocodeResult; -import com.mogo.map.search.geo.MogoRegeocodeRoad; -import com.mogo.map.search.geo.MogoStreetNumber; -import com.mogo.map.search.geo.MogoSubPoiItem; -import com.mogo.map.search.geo.query.MogoGeocodeQuery; -import com.mogo.map.search.geo.query.MogoRegeocodeQuery; -import com.mogo.map.search.inputtips.MogoTip; -import com.mogo.map.search.inputtips.query.MogoInputtipsQuery; -import com.mogo.map.search.poisearch.MogoPoiResult; -import com.mogo.map.search.poisearch.MogoSearchBound; -import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery; -import com.mogo.map.uicontroller.MapCameraPosition; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * @author congtaowang - * @since 2019-12-18 - *

- * 业务对象和实际对象转换 - */ -public class ObjectUtils { - - public static MarkerOptions fromMogo( MogoMarkerOptions opt ) { - - if ( opt == null ) { - return null; - } - ArrayList< BitmapDescriptor > descriptors = new ArrayList<>(); - final ArrayList< Bitmap > icons = opt.getIcons(); - if ( icons != null && !icons.isEmpty() ) { - for ( Bitmap icon : icons ) { - if ( icon == null || icon.isRecycled() ) { - continue; - } - - descriptors.add( BitmapDescriptorFactory.fromBitmap( icon ) ); - } - } - - BitmapDescriptor descriptor = getBitmapDescriptorFromMogo( opt ); - - return new MarkerOptions() - .position( new LatLng( opt.getLatitude(), opt.getLongitude() ) ) - .title( opt.getTitle() ) - .snippet( opt.getSnippet() ) - .icon( descriptor ) - .anchor( opt.getU(), opt.getV() ) - .icons( descriptors ) - .period( opt.getPeriod() ) - .rotateAngle( opt.getRotate() ) - .setFlat( opt.isFlat() ) - .visible( opt.isVisible() ) - .infoWindowEnable( opt.isInifoWindowEnable() ) - .alpha( opt.getAlpha() ) - .setGps( opt.isGps() ) - .anchor( opt.getU(), opt.getV() ) - .draggable( opt.isDraggable() ) - .setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() ) - .zIndex( opt.getzIndex() ); - } - - private static BitmapDescriptor getBitmapDescriptorFromMogo( MogoMarkerOptions options ) { - if ( options == null ) { - return null; - } - Bitmap icon = options.getIcon(); - if ( icon != null ) { - return BitmapDescriptorFactory.fromBitmap( icon ); - } - View view = options.getIconView(); - if ( view != null ) { - return BitmapDescriptorFactory.fromView( view ); - } - return null; - } - - - public static MogoLocation fromAMap( AMapLocation aLocation ) { - if ( aLocation == null ) { - return null; - } - MogoLocation location = new MogoLocation(); - location.setLocType( aLocation.getLocationType() ); - location.setSpeed( aLocation.getSpeed() ); - location.setLatitude( aLocation.getLatitude() ); - location.setLongitude( aLocation.getLongitude() ); - location.setAltitude( aLocation.getAltitude() ); - location.setTime( aLocation.getTime() ); - location.setBearing( aLocation.getBearing() ); - location.setAccuracy( aLocation.getAccuracy() ); - location.setCityCode( aLocation.getCityCode() ); - location.setCityName( aLocation.getCity() ); - location.setProvider( aLocation.getProvider() ); - location.setAddress( aLocation.getAddress() ); - location.setDistrict( aLocation.getDistrict() ); - location.setProvince( aLocation.getProvince() ); - location.setAdCode( aLocation.getAdCode() ); - location.setLocationDetail( aLocation.getLocationDetail() ); - location.setPoiName( aLocation.getPoiName() ); - location.setAoiName( aLocation.getAoiName() ); - location.setErrCode( aLocation.getErrorCode() ); - location.setErrInfo( aLocation.getErrorInfo() ); - location.setStreet( aLocation.getStreet() ); - location.setStreetNum( aLocation.getStreetNum() ); - location.setDescription( aLocation.getDescription() ); - location.setBuildingId( aLocation.getBuildingId() ); - location.setFloor( aLocation.getFloor() ); - location.setGpsAccuracyStatus( aLocation.getGpsAccuracyStatus() ); - location.setSatellite( aLocation.getSatellites() ); - return location; - } - - public static LatLonPoint fromMogo( MogoLatLng latLng ) { - if ( latLng == null ) { - return null; - } - return new LatLonPoint( latLng.lat, latLng.lng ); - } - - public static NaviLatLng fromMogoAsNavi( MogoLatLng latLng ) { - if ( latLng == null ) { - return null; - } - return new NaviLatLng( latLng.lat, latLng.lng ); - } - - public static LatLng fromMogo2( MogoLatLng latLng ) { - if ( latLng == null ) { - return null; - } - return new LatLng( latLng.lat, latLng.lon ); - } - - public static MogoLatLng fromAMap( LatLonPoint point ) { - if ( point == null ) { - return null; - } - return new MogoLatLng( point.getLatitude(), point.getLongitude() ); - } - - public static MogoLatLng CameraPositionfromAMap( LatLng point ) { - if ( point == null ) { - return null; - } - return new MogoLatLng( point.latitude, point.longitude ); - } - - public static GeocodeQuery fromMogo( MogoGeocodeQuery query ) { - if ( query == null ) { - return null; - } - GeocodeQuery q = new GeocodeQuery( query.getLocationName(), query.getCity() ); - return q; - } - - public static RegeocodeQuery fromMogo( MogoRegeocodeQuery query ) { - if ( query == null ) { - return null; - } - RegeocodeQuery q = new RegeocodeQuery( fromMogo( query.getPoint() ), query.getRadius(), query.getLatlngType() ); - return q; - } - - public static MogoAoiItem fromAMap( AoiItem amapItem ) { - if ( amapItem == null ) { - return null; - } - MogoAoiItem mogoAoiItem = new MogoAoiItem(); - mogoAoiItem.setAdCode( amapItem.getAdCode() ); - mogoAoiItem.setAoiArea( amapItem.getAoiArea() ); - mogoAoiItem.setAoiCenterPoint( fromAMap( amapItem.getAoiCenterPoint() ) ); - mogoAoiItem.setAoiId( amapItem.getAoiId() ); - mogoAoiItem.setAoiName( amapItem.getAoiName() ); - return mogoAoiItem; - } - - public static MogoBusinessArea fromAMap( BusinessArea amapItem ) { - if ( amapItem == null ) { - return null; - } - MogoBusinessArea mogoBusinessArea = new MogoBusinessArea(); - mogoBusinessArea.setCenterPoint( fromAMap( amapItem.getCenterPoint() ) ); - mogoBusinessArea.setName( amapItem.getName() ); - return mogoBusinessArea; - } - - - public static MogoCrossroad fromAMap( Crossroad amapItem ) { - if ( amapItem == null ) { - return null; - } - MogoCrossroad mogoCrossroad = new MogoCrossroad(); - mogoCrossroad.setDirection( amapItem.getDirection() ); - mogoCrossroad.setDistance( amapItem.getDistance() ); - mogoCrossroad.setFirstRoadId( amapItem.getFirstRoadId() ); - mogoCrossroad.setFirstRoadName( amapItem.getFirstRoadName() ); - mogoCrossroad.setSecondRoadId( amapItem.getSecondRoadId() ); - mogoCrossroad.setSecondRoadName( amapItem.getSecondRoadName() ); - return mogoCrossroad; - } - - public static MogoGeocodeAddress fromAMap( GeocodeAddress address ) { - if ( address == null ) { - return null; - } - MogoGeocodeAddress mogoGeocodeAddress = new MogoGeocodeAddress(); - mogoGeocodeAddress.setAdcode( address.getAdcode() ); - mogoGeocodeAddress.setBuilding( address.getBuilding() ); - mogoGeocodeAddress.setCity( address.getCity() ); - mogoGeocodeAddress.setDistrict( address.getDistrict() ); - mogoGeocodeAddress.setFormatAddress( address.getFormatAddress() ); - mogoGeocodeAddress.setLatlng( fromAMap( address.getLatLonPoint() ) ); - mogoGeocodeAddress.setLevel( address.getLevel() ); - mogoGeocodeAddress.setNeighborhood( address.getNeighborhood() ); - mogoGeocodeAddress.setProvince( address.getProvince() ); - mogoGeocodeAddress.setTownship( address.getTownship() ); - return mogoGeocodeAddress; - } - - public static MogoGeocodeResult fromAMap( GeocodeResult result ) { - if ( result == null || result.getGeocodeAddressList() == null ) { - return null; - } - MogoGeocodeResult mogoGeocodeResult = new MogoGeocodeResult(); - final List< MogoGeocodeAddress > addresses = new ArrayList<>(); - for ( GeocodeAddress geocodeAddress : result.getGeocodeAddressList() ) { - final MogoGeocodeAddress mogoGeocodeAddress = fromAMap( geocodeAddress ); - if ( mogoGeocodeAddress != null ) { - addresses.add( mogoGeocodeAddress ); - } - } - - mogoGeocodeResult.setAddresses( addresses ); - return mogoGeocodeResult; - } - - public static MogoIndoorData fromAMap( IndoorData data ) { - if ( data == null ) { - return null; - } - MogoIndoorData mogoIndoorData = new MogoIndoorData(); - mogoIndoorData.setFloor( data.getFloor() ); - mogoIndoorData.setFloorName( data.getFloorName() ); - mogoIndoorData.setPoiId( data.getPoiId() ); - return mogoIndoorData; - } - - public static MogoPhoto fromAMap( Photo photo ) { - if ( photo == null ) { - return null; - } - MogoPhoto mogoPhoto = new MogoPhoto(); - mogoPhoto.setTitle( photo.getTitle() ); - mogoPhoto.setUrl( photo.getUrl() ); - return mogoPhoto; - } - - public static MogoPoiItemExtension fromAMap( PoiItemExtension poiItemExtension ) { - if ( poiItemExtension == null ) { - return null; - } - MogoPoiItemExtension mogoPoiItemExtension = new MogoPoiItemExtension(); - mogoPoiItemExtension.setOpentime( poiItemExtension.getOpentime() ); - mogoPoiItemExtension.setRating( poiItemExtension.getmRating() ); - return mogoPoiItemExtension; - } - - public static MogoRegeocodeRoad fromAMap( RegeocodeRoad regeocodeRoad ) { - if ( regeocodeRoad == null ) { - return null; - } - MogoRegeocodeRoad mogoRegeocodeRoad = new MogoRegeocodeRoad(); - mogoRegeocodeRoad.setDirection( regeocodeRoad.getDirection() ); - mogoRegeocodeRoad.setDistance( regeocodeRoad.getDistance() ); - mogoRegeocodeRoad.setId( regeocodeRoad.getId() ); - mogoRegeocodeRoad.setName( regeocodeRoad.getName() ); - mogoRegeocodeRoad.setPoint( fromAMap( regeocodeRoad.getLatLngPoint() ) ); - return mogoRegeocodeRoad; - } - - public static MogoStreetNumber fromAMap( StreetNumber streetNumber ) { - if ( streetNumber == null ) { - return null; - } - MogoStreetNumber mogoStreetNumber = new MogoStreetNumber(); - mogoStreetNumber.setDirection( streetNumber.getDirection() ); - mogoStreetNumber.setDistance( streetNumber.getDistance() ); - mogoStreetNumber.setLatLonPoint( fromAMap( streetNumber.getLatLonPoint() ) ); - mogoStreetNumber.setNumber( streetNumber.getNumber() ); - mogoStreetNumber.setStreet( streetNumber.getStreet() ); - return mogoStreetNumber; - } - - public static MogoSubPoiItem fromAMap( SubPoiItem subPoiItem ) { - if ( subPoiItem == null ) { - return null; - } - MogoSubPoiItem mogoSubPoiItem = new MogoSubPoiItem(); - mogoSubPoiItem.setDistance( subPoiItem.getDistance() ); - mogoSubPoiItem.setPoiId( subPoiItem.getPoiId() ); - mogoSubPoiItem.setPoint( fromAMap( subPoiItem.getLatLonPoint() ) ); - mogoSubPoiItem.setSnippet( subPoiItem.getSnippet() ); - mogoSubPoiItem.setSubName( mogoSubPoiItem.getSubName() ); - mogoSubPoiItem.setSubTypeDes( mogoSubPoiItem.getSubTypeDes() ); - mogoSubPoiItem.setTitle( mogoSubPoiItem.getTitle() ); - return mogoSubPoiItem; - } - - public static MogoPoiItem fromAMap( PoiItem poiItem ) { - if ( poiItem == null ) { - return null; - } - MogoPoiItem mogoPoiItem = new MogoPoiItem(); - mogoPoiItem.setAdCode( poiItem.getAdCode() ); - mogoPoiItem.setAdName( poiItem.getAdName() ); - mogoPoiItem.setBusinessArea( poiItem.getBusinessArea() ); - mogoPoiItem.setCityCode( poiItem.getCityCode() ); - mogoPoiItem.setCityName( poiItem.getCityName() ); - mogoPoiItem.setDirection( poiItem.getDirection() ); - mogoPoiItem.setDistance( poiItem.getDistance() ); - mogoPoiItem.setEmail( poiItem.getEmail() ); - mogoPoiItem.setEnter( fromAMap( poiItem.getEnter() ) ); - mogoPoiItem.setExit( fromAMap( poiItem.getExit() ) ); - mogoPoiItem.setIndoorData( fromAMap( poiItem.getIndoorData() ) ); - mogoPoiItem.setParkingType( poiItem.getParkingType() ); - mogoPoiItem.setIndoorMap( poiItem.isIndoorMap() ); - if ( poiItem.getPhotos() != null ) { - List< MogoPhoto > mogoPhotos = new ArrayList<>(); - for ( Photo photo : poiItem.getPhotos() ) { - MogoPhoto mogoPhoto = fromAMap( photo ); - if ( mogoPhoto != null ) { - mogoPhotos.add( mogoPhoto ); - } - } - mogoPoiItem.setPhotos( mogoPhotos ); - } - mogoPoiItem.setPoiExtension( fromAMap( poiItem.getPoiExtension() ) ); - mogoPoiItem.setPoiId( poiItem.getPoiId() ); - mogoPoiItem.setPoint( fromAMap( poiItem.getLatLonPoint() ) ); - mogoPoiItem.setPostcode( poiItem.getPostcode() ); - mogoPoiItem.setProvinceCode( poiItem.getProvinceCode() ); - mogoPoiItem.setProvinceName( poiItem.getProvinceName() ); - mogoPoiItem.setShopID( poiItem.getShopID() ); - mogoPoiItem.setSnippet( poiItem.getSnippet() ); - if ( poiItem.getSubPois() != null ) { - List< MogoSubPoiItem > mogoSubPoiItems = new ArrayList<>(); - for ( SubPoiItem subPois : poiItem.getSubPois() ) { - MogoSubPoiItem mogoSubPoiItem = fromAMap( subPois ); - if ( mogoPoiItem != null ) { - mogoSubPoiItems.add( mogoSubPoiItem ); - } - } - mogoPoiItem.setSubPois( mogoSubPoiItems ); - } - mogoPoiItem.setTel( poiItem.getTel() ); - mogoPoiItem.setTypeCode( poiItem.getTypeCode() ); - mogoPoiItem.setTitle( poiItem.getTitle() ); - mogoPoiItem.setTypeDes( poiItem.getTypeDes() ); - mogoPoiItem.setWebsite( poiItem.getWebsite() ); - return mogoPoiItem; - } - - public static MogoRegeocodeAddress fromAMap( RegeocodeAddress regeocodeAddress ) { - if ( regeocodeAddress == null ) { - return null; - } - MogoRegeocodeAddress mogoRegeocodeAddress = new MogoRegeocodeAddress(); - mogoRegeocodeAddress.setAdCode( regeocodeAddress.getAdCode() ); - if ( regeocodeAddress.getAois() != null ) { - List< MogoAoiItem > items = new ArrayList<>(); - for ( AoiItem aois : regeocodeAddress.getAois() ) { - final MogoAoiItem mogoAoiItem = fromAMap( aois ); - if ( mogoAoiItem != null ) { - items.add( mogoAoiItem ); - } - } - mogoRegeocodeAddress.setAois( items ); - } - - mogoRegeocodeAddress.setBuilding( regeocodeAddress.getBuilding() ); - if ( regeocodeAddress.getBusinessAreas() != null ) { - List< MogoBusinessArea > mogoBusinessAreas = new ArrayList<>(); - for ( BusinessArea businessArea : regeocodeAddress.getBusinessAreas() ) { - MogoBusinessArea mogoBusinessArea = fromAMap( businessArea ); - if ( mogoBusinessArea != null ) { - mogoBusinessAreas.add( mogoBusinessArea ); - } - } - mogoRegeocodeAddress.setBusinessAreas( mogoBusinessAreas ); - } - - mogoRegeocodeAddress.setCity( regeocodeAddress.getCity() ); - mogoRegeocodeAddress.setCityCode( regeocodeAddress.getCityCode() ); - mogoRegeocodeAddress.setCountry( regeocodeAddress.getCountry() ); - if ( regeocodeAddress.getCrossroads() != null ) { - List< MogoCrossroad > mogoCrossroads = new ArrayList<>(); - for ( Crossroad crossroad : regeocodeAddress.getCrossroads() ) { - - MogoCrossroad mogoCrossroad = fromAMap( crossroad ); - if ( mogoCrossroad != null ) { - mogoCrossroads.add( mogoCrossroad ); - } - } - mogoRegeocodeAddress.setCrossroads( mogoCrossroads ); - } - mogoRegeocodeAddress.setDistrict( regeocodeAddress.getDistrict() ); - mogoRegeocodeAddress.setFormatAddress( regeocodeAddress.getFormatAddress() ); - mogoRegeocodeAddress.setNeighborhood( regeocodeAddress.getNeighborhood() ); - if ( regeocodeAddress.getPois() != null ) { - List< MogoPoiItem > mogoPoiItems = new ArrayList<>(); - for ( PoiItem pois : regeocodeAddress.getPois() ) { - MogoPoiItem mogoPoiItem = fromAMap( pois ); - mogoPoiItems.add( mogoPoiItem ); - } - mogoRegeocodeAddress.setPois( mogoPoiItems ); - } - mogoRegeocodeAddress.setProvince( regeocodeAddress.getProvince() ); - if ( regeocodeAddress.getRoads() != null ) { - List< MogoRegeocodeRoad > mogoRegeocodeRoads = new ArrayList<>(); - for ( RegeocodeRoad road : regeocodeAddress.getRoads() ) { - MogoRegeocodeRoad mogoRegeocodeRoad = fromAMap( road ); - if ( mogoRegeocodeRoad != null ) { - mogoRegeocodeRoads.add( mogoRegeocodeRoad ); - } - } - mogoRegeocodeAddress.setRoads( mogoRegeocodeRoads ); - } - mogoRegeocodeAddress.setStreetNumber( fromAMap( regeocodeAddress.getStreetNumber() ) ); - mogoRegeocodeAddress.setTowncode( regeocodeAddress.getTowncode() ); - mogoRegeocodeAddress.setTownship( regeocodeAddress.getTownship() ); - return mogoRegeocodeAddress; - } - - public static MogoRegeocodeResult fromAMap( RegeocodeResult regeocodeResult ) { - if ( regeocodeResult == null ) { - return null; - } - MogoRegeocodeResult mogoRegeocodeResult = new MogoRegeocodeResult(); - mogoRegeocodeResult.setRegeocodeAddress( fromAMap( regeocodeResult.getRegeocodeAddress() ) ); - return mogoRegeocodeResult; - } - - public static InputtipsQuery fromMogo( MogoInputtipsQuery query ) { - if ( query == null ) { - return null; - } - InputtipsQuery inputtipsQuery = new InputtipsQuery( query.getKeyword(), query.getCity() ); - inputtipsQuery.setCityLimit( query.isCityLimit() ); - inputtipsQuery.setLocation( fromMogo( query.getLocation() ) ); - inputtipsQuery.setType( query.getType() ); - return inputtipsQuery; - } - - public static MogoTip fromAMap( Tip tip ) { - if ( tip == null ) { - return null; - } - MogoTip mogoTip = new MogoTip(); - mogoTip.setAdCode( tip.getAdcode() ); - mogoTip.setAddress( tip.getAddress() ); - mogoTip.setDistrict( tip.getDistrict() ); - mogoTip.setName( tip.getName() ); - mogoTip.setPoiID( tip.getPoiID() ); - mogoTip.setPoint( fromAMap( tip.getPoint() ) ); - mogoTip.setTypeCode( tip.getTypeCode() ); - return mogoTip; - } - - public static MogoPoi fromAMap( Poi poi ) { - if ( poi == null ) { - return null; - } - MogoPoi mogoPoi = new MogoPoi(); - mogoPoi.setCoordinate( fromAMap( poi.getCoordinate() ) ); - mogoPoi.setName( poi.getName() ); - mogoPoi.setPoiId( poi.getPoiId() ); - return mogoPoi; - } - - public static MogoPoiSearchQuery fromAMap( PoiSearch.Query query ) { - if ( query == null ) { - return null; - } - MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery( query.getQueryString(), query.getCategory(), query.getCity() ); - mogoPoiSearchQuery.setBuilding( query.getBuilding() ); - mogoPoiSearchQuery.setCityLimit( query.getCityLimit() ); - mogoPoiSearchQuery.setDistanceSort( query.isDistanceSort() ); - mogoPoiSearchQuery.setLocation( fromAMap( query.getLocation() ) ); - mogoPoiSearchQuery.setPageNum( query.getPageNum() ); - mogoPoiSearchQuery.setPageSize( query.getPageSize() ); - return mogoPoiSearchQuery; - } - - public static PoiSearch.Query fromMogo( MogoPoiSearchQuery query ) { - if ( query == null ) { - return null; - } - PoiSearch.Query psq = new PoiSearch.Query( query.getQuery(), query.getCategory(), query.getCity() ); - psq.setBuilding( query.getBuilding() ); - psq.setCityLimit( query.isCityLimit() ); - psq.setDistanceSort( query.isDistanceSort() ); - psq.setLocation( fromMogo( query.getLocation() ) ); - psq.setPageNum( query.getPageNum() ); - psq.setPageSize( query.getPageSize() ); - return psq; - } - - public static MogoSearchBound fromAMap( PoiSearch.SearchBound bound ) { - if ( bound == null ) { - return null; - } - if ( bound.getShape() == PoiSearch.SearchBound.BOUND_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getCenter() ), bound.getRange(), bound.isDistanceSort() ); - } else if ( bound.getShape() == PoiSearch.SearchBound.POLYGON_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getPolyGonList() ) ); - } else if ( bound.getShape() == PoiSearch.SearchBound.RECTANGLE_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getLowerLeft() ), fromAMap( bound.getUpperRight() ) ); - } - return null; - } - - public static List< MogoLatLng > fromAMap( List< LatLonPoint > latLngs ) { - if ( latLngs == null ) { - return null; - } - List< MogoLatLng > result = new ArrayList<>( latLngs.size() ); - for ( LatLonPoint latLng : latLngs ) { - result.add( fromAMap( latLng ) ); - } - return result; - } - - public static List< LatLonPoint > fromMogo( List< MogoLatLng > latLngs ) { - if ( latLngs == null ) { - return null; - } - List< LatLonPoint > result = new ArrayList<>( latLngs.size() ); - for ( MogoLatLng latLng : latLngs ) { - result.add( fromMogo( latLng ) ); - } - return result; - } - - - public static PoiSearch.SearchBound fromMogo( MogoSearchBound bound ) { - if ( bound == null ) { - return null; - } - if ( bound.getShape() == MogoSearchBound.SHAPE_BOUND ) { - return new PoiSearch.SearchBound( fromMogo( bound.getCenterPoint() ), bound.getRadiusInMeters(), bound.isDistanceSort() ); - } else if ( bound.getShape() == MogoSearchBound.SHAPE_POLYGON ) { - return new PoiSearch.SearchBound( fromMogo( bound.getPolyGonList() ) ); - } else if ( bound.getShape() == MogoSearchBound.SHAPE_RECTANGLE ) { - return new PoiSearch.SearchBound( fromMogo( bound.getLowerLeft() ), fromMogo( bound.getUpperRight() ) ); - } - return null; - } - - public static MogoPoiResult fromAMap( PoiResult result ) { - if ( result == null ) { - return null; - } - MogoPoiResult mogoPoiResult = new MogoPoiResult(); - if ( result.getPois() != null ) { - final List< PoiItem > poiItems = result.getPois(); - final ArrayList< MogoPoiItem > mogoPoiItems = new ArrayList<>( poiItems.size() ); - for ( PoiItem poiItem : poiItems ) { - mogoPoiItems.add( fromAMap( poiItem ) ); - } - mogoPoiResult.setPois( mogoPoiItems ); - } - return mogoPoiResult; - } - - public static MogoNaviInfo fromAMap( Context context, NaviInfo naviInfo ) { - if ( naviInfo == null ) { - return null; - } - MogoNaviInfo mogoNaviInfo = new MogoNaviInfo(); - mogoNaviInfo.setCurrentRoadName( naviInfo.getCurrentRoadName() ); - mogoNaviInfo.setCurrentSpeed( naviInfo.getCurrentSpeed() ); - mogoNaviInfo.setCurStepRetainDistance( naviInfo.getCurStepRetainDistance() ); - mogoNaviInfo.setCurStepRetainTime( naviInfo.getCurStepRetainTime() ); - mogoNaviInfo.setIconResId( IconTypeUtils.getResIdByIconType( context, naviInfo.getIconType() ) ); - mogoNaviInfo.setNextRoadName( naviInfo.getNextRoadName() ); - mogoNaviInfo.setPathRetainDistance( naviInfo.getPathRetainDistance() ); - mogoNaviInfo.setPathRetainTime( naviInfo.getPathRetainTime() ); - mogoNaviInfo.setCurrentSpeed( naviInfo.getLimitSpeed() ); - return mogoNaviInfo; - } - - public static MogoCongestionInfo fromAMap( AimLessModeCongestionInfo aimLessModeCongestionInfo ) { - if ( aimLessModeCongestionInfo == null ) { - return null; - } - MogoCongestionInfo congestionInfo = new MogoCongestionInfo(); - congestionInfo.setCongestionStatus( aimLessModeCongestionInfo.getCongestionStatus() ); - congestionInfo.setEventLat( aimLessModeCongestionInfo.getEventLat() ); - congestionInfo.setEventLon( aimLessModeCongestionInfo.getEventLon() ); - congestionInfo.setEventType( aimLessModeCongestionInfo.getEventType() ); - congestionInfo.setCongestionLinks( new ArrayList< MogoCongestionLink >() ); - congestionInfo.setLength( aimLessModeCongestionInfo.getLength() ); - congestionInfo.setRoadName( aimLessModeCongestionInfo.getRoadName() ); - congestionInfo.setTime( aimLessModeCongestionInfo.getTime() ); - if ( aimLessModeCongestionInfo.getAmapCongestionLinks() != null - && aimLessModeCongestionInfo.getAmapCongestionLinks().length != 0 ) { - for ( AMapCongestionLink amapCongestionLink : aimLessModeCongestionInfo.getAmapCongestionLinks() ) { - if ( amapCongestionLink == null ) { - continue; - } - MogoCongestionLink link = new MogoCongestionLink(); - link.setCongestionStatus( amapCongestionLink.getCongestionStatus() ); - if ( amapCongestionLink.getCoords() != null ) { - link.setCoords( new ArrayList< MogoLatLng >() ); - Iterator< NaviLatLng > iterator = amapCongestionLink.getCoords().iterator(); - while ( iterator.hasNext() ) { - NaviLatLng naviLatLng = iterator.next(); - if ( naviLatLng == null ) { - continue; - } - link.getCoords().add( new MogoLatLng( naviLatLng.getLatitude(), naviLatLng.getLongitude() ) ); - } - } - congestionInfo.getCongestionLinks().add( link ); - } - } - return congestionInfo; - } - - public static MogoTraffic fromAMap( AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) { - if ( aMapNaviTrafficFacilityInfos == null || aMapNaviTrafficFacilityInfos.length == 0 ) { - return null; - } - for ( AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo : aMapNaviTrafficFacilityInfos ) { - if ( aMapNaviTrafficFacilityInfo == null ) { - continue; - } - MogoTraffic traffic = new MogoTraffic( MogoTraffic.TYPE_AIM ); - traffic.setDistance( aMapNaviTrafficFacilityInfo.getDistance() ); - traffic.setSpeedLimit( aMapNaviTrafficFacilityInfo.getLimitSpeed() ); - traffic.setTrafficType( aMapNaviTrafficFacilityInfo.getBroadcastType() ); - traffic.setLat( aMapNaviTrafficFacilityInfo.latitude ); - traffic.setLon( aMapNaviTrafficFacilityInfo.longitude ); - return traffic; - } - return null; - } - - public static PolylineOptions fromMogo( MogoPolylineOptions options ) { - if ( options == null ) { - return null; - } - PolylineOptions target = new PolylineOptions(); - if ( options.getPoints() != null ) { - List< LatLng > points = new ArrayList<>(); - for ( MogoLatLng point : options.getPoints() ) { - points.add( fromMogo2( point ) ); - } - target.addAll( points ); - } - target.width( options.getWidth() ); - target.color( options.getColor() ); - target.zIndex( options.getWidth() ); - target.visible( options.isVisible() ); - target.geodesic( options.isGeodesic() ); - target.setDottedLine( options.isDottedLine() ); - target.useGradient( options.isGradient() ); - if ( options.getColorValues() != null ) { - target.colorValues( options.getColorValues() ); - } - target.transparency( options.getTransparency() ); - target.aboveMaskLayer( options.isAboveMaskLayer() ); - target.lineCapType( PolylineOptions.LineCapType.LineCapRound ); - target.lineJoinType( PolylineOptions.LineJoinType.LineJoinRound ); - target.setDottedLineType( PolylineOptions.DOTTEDLINE_TYPE_CIRCLE ); - return target; - } - - public static MogoLatLng fromAMap( LatLng latLng ) { - if ( latLng == null ) { - return null; - } - return new MogoLatLng( latLng.latitude, latLng.longitude ); - } - - public static MapCameraPosition fromAMap( CameraPosition position ) { - if ( position == null ) { - return null; - } - return new MapCameraPosition( fromAMap( position.target ), position.bearing, position.tilt, position.zoom ); - } -} diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_bus.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_bus.png deleted file mode 100644 index 66f73f4454..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_bus.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_car.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_car.png deleted file mode 100644 index b12b10c83f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_car.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_end.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_end.png deleted file mode 100644 index 5503dc5a28..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_end.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_man.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_man.png deleted file mode 100644 index 16842d5d12..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_man.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_ride.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_ride.png deleted file mode 100644 index 2fa5633c59..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_ride.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_0_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_0_arrow.png deleted file mode 100644 index 21793fea2b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_0_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_1_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_1_arrow.png deleted file mode 100644 index d7d832857f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_1_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_2_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_2_arrow.png deleted file mode 100644 index c1d019b4ae..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_2_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_3_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_3_arrow.png deleted file mode 100644 index b3318ad436..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_3_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_4_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_4_arrow.png deleted file mode 100644 index 038e63f485..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_4_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_5_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_5_arrow.png deleted file mode 100644 index e15ce84e87..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_5_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_6_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_6_arrow.png deleted file mode 100644 index 9f3540757a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_6_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_7_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_7_arrow.png deleted file mode 100644 index cef675f06f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_7_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_8_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_8_arrow.png deleted file mode 100644 index c4d67d38a4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_8_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_9_arrow.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_9_arrow.png deleted file mode 100644 index 3c92f82f0d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_route_color_texture_9_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_start.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_start.png deleted file mode 100644 index cd716c8840..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_start.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/amap_through.png b/libraries/map-amap/src/main/res/drawable-ldpi/amap_through.png deleted file mode 100644 index e636b446c1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/amap_through.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/app_icon.png b/libraries/map-amap/src/main/res/drawable-ldpi/app_icon.png deleted file mode 100644 index c97be4be12..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/app_icon.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/default_image.png b/libraries/map-amap/src/main/res/drawable-ldpi/default_image.png deleted file mode 100644 index fdc210cd25..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/default_image.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir1.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir1.png deleted file mode 100644 index fec3f4ec69..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir1.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir10.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir10.png deleted file mode 100644 index 34c2228f6c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir11.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir11.png deleted file mode 100644 index df9e8dc67c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir12.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir12.png deleted file mode 100644 index a4ba8c22cb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir13.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir13.png deleted file mode 100644 index 39ad870c5f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir14.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir14.png deleted file mode 100644 index a3c1632562..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir15.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir15.png deleted file mode 100644 index c99fb65b94..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir16.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir16.png deleted file mode 100644 index 86898c2144..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir2.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir2.png deleted file mode 100644 index 750b6fbb7e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir3.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir3.png deleted file mode 100644 index 8cbe886e81..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir3.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir4.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir4.png deleted file mode 100644 index cfe7d6c0fb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir4.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir5.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir5.png deleted file mode 100644 index e465d5eec2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir5.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir6.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir6.png deleted file mode 100644 index 0d2f3c0360..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir6.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir7.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir7.png deleted file mode 100644 index e53c9ff451..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir7.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir8.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir8.png deleted file mode 100644 index edfdbe1df0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir8.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir9.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir9.png deleted file mode 100644 index a762d0b74a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir9.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir_end.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir_end.png deleted file mode 100644 index f3cb78aed4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir_end.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir_start.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir_start.png deleted file mode 100644 index 4d2a797823..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir_start.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/dir_station.png b/libraries/map-amap/src/main/res/drawable-ldpi/dir_station.png deleted file mode 100644 index 2ed622283b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/dir_station.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_1.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_1.png deleted file mode 100644 index 0fa0edb0a4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_1.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_10.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_10.png deleted file mode 100644 index 797b106127..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_11.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_11.png deleted file mode 100644 index e54bbd6292..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_12.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_12.png deleted file mode 100644 index f93a673421..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_13.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_13.png deleted file mode 100644 index bf8d9bc3db..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_14.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_14.png deleted file mode 100644 index e7288ac5c2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_15.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_15.png deleted file mode 100644 index 9c0c2af8f4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_16.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_16.png deleted file mode 100644 index 30cffd20e5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_17.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_17.png deleted file mode 100644 index 81ebaa35cd..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_18.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_18.png deleted file mode 100644 index 8370408b15..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_18.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_19.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_19.png deleted file mode 100644 index da5648fb9c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_19.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_2.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_2.png deleted file mode 100644 index 851d6d878e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_20.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_20.png deleted file mode 100644 index 79ffe11b10..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_21.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_21.png deleted file mode 100644 index 9f80ca5181..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_22.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_22.png deleted file mode 100644 index 403c5ea7e8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_23.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_23.png deleted file mode 100644 index 6e1b9f33b8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_24.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_24.png deleted file mode 100644 index 060b5e94f0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_25.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_25.png deleted file mode 100644 index 7a027897ce..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_26.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_26.png deleted file mode 100644 index 6806d3457e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_27.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_27.png deleted file mode 100644 index dd1717bd6b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_28.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_28.png deleted file mode 100644 index 239b379f3b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_4.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_4.png deleted file mode 100644 index 5cf551b141..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_4.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_5.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_5.png deleted file mode 100644 index 70ac563aa4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_5.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_50.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_50.png deleted file mode 100644 index 4780ef7427..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_50.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_51.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_51.png deleted file mode 100644 index f6501640a1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_51.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_52.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_52.png deleted file mode 100644 index 7c8a880609..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_52.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_53.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_53.png deleted file mode 100644 index 4cb5e21820..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_53.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_54.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_54.png deleted file mode 100644 index 37289bbaaf..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_54.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_55.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_55.png deleted file mode 100644 index e8263cdc1b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_55.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_56.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_56.png deleted file mode 100644 index 48b91385ad..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_56.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_57.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_57.png deleted file mode 100644 index 080eaece28..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_57.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_58.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_58.png deleted file mode 100644 index 7f7034ff9f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_58.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_59.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_59.png deleted file mode 100644 index 735392d59d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_59.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_6.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_6.png deleted file mode 100644 index ff9757c869..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_6.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_60.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_60.png deleted file mode 100644 index 98c94b3826..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_60.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_61.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_61.png deleted file mode 100644 index a924085ef8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_61.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_62.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_62.png deleted file mode 100644 index c20542f34f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_62.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_63.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_63.png deleted file mode 100644 index d408fe0153..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_63.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_64.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_64.png deleted file mode 100644 index 5a9af68c32..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_64.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_65.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_65.png deleted file mode 100644 index 57a7454b4f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_65.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_66.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_66.png deleted file mode 100644 index c471bf466a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_66.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_67.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_67.png deleted file mode 100644 index 22e6178738..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_67.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_68.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_68.png deleted file mode 100644 index a782cffbd9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_69.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_69.png deleted file mode 100644 index a1545ef55f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_69.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_7.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_7.png deleted file mode 100644 index b4a6465ce0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_7.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_8.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_8.png deleted file mode 100644 index d19f036aa9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_8.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_9.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_9.png deleted file mode 100644 index a2b07ad3d7..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_9.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_endpoint.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_endpoint.png deleted file mode 100644 index a1716599df..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_endpoint.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_refresh.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_refresh.png deleted file mode 100644 index d86c3f8024..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_refresh.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/ic_snapshot_ph.png b/libraries/map-amap/src/main/res/drawable-ldpi/ic_snapshot_ph.png deleted file mode 100644 index 281f1bb163..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/ic_snapshot_ph.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable-ldpi/join_checkbox_bg.png deleted file mode 100644 index 89d00803c5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/join_checkbox_bg.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/live_exit.png b/libraries/map-amap/src/main/res/drawable-ldpi/live_exit.png deleted file mode 100644 index 7d9b50f159..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/live_exit.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/location_city_image.png b/libraries/map-amap/src/main/res/drawable-ldpi/location_city_image.png deleted file mode 100644 index ce5515c529..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/location_city_image.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_normal.png b/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_normal.png deleted file mode 100644 index 9c1a2a4aea..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_press.png b/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_press.png deleted file mode 100644 index d927b18877..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_left_page_up_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_normal.png b/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_normal.png deleted file mode 100644 index dda526f475..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_press.png b/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_press.png deleted file mode 100644 index 2289209d9a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/main_solid_right_page_up_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/mainpage_location_img.png b/libraries/map-amap/src/main/res/drawable-ldpi/mainpage_location_img.png deleted file mode 100644 index 7a463ac3ab..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/mainpage_location_img.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png deleted file mode 100644 index 98fc674705..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/map_api_ic_current_location2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/map_location_normal.png b/libraries/map-amap/src/main/res/drawable-ldpi/map_location_normal.png deleted file mode 100644 index 53f5b5a14a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/map_location_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/map_location_press.png b/libraries/map-amap/src/main/res/drawable-ldpi/map_location_press.png deleted file mode 100644 index e3e430c8d6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/map_location_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/not_join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable-ldpi/not_join_checkbox_bg.png deleted file mode 100644 index 663addd255..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/not_join_checkbox_bg.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/public_arrow_back_iv.png b/libraries/map-amap/src/main/res/drawable-ldpi/public_arrow_back_iv.png deleted file mode 100644 index cd7159e219..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/public_arrow_back_iv.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/search_information_normal.png b/libraries/map-amap/src/main/res/drawable-ldpi/search_information_normal.png deleted file mode 100644 index 69529ef0bd..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/search_information_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/search_information_press.png b/libraries/map-amap/src/main/res/drawable-ldpi/search_information_press.png deleted file mode 100644 index 8338cc95ae..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/search_information_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_10.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_10.png deleted file mode 100644 index 629e98359d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_11.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_11.png deleted file mode 100644 index c0d6528e63..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_12.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_12.png deleted file mode 100644 index c14ec9a985..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_13.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_13.png deleted file mode 100644 index 71bc66ca60..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_14.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_14.png deleted file mode 100644 index 15e798dcce..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_15.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_15.png deleted file mode 100644 index a69e9437f3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_16.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_16.png deleted file mode 100644 index ff948797b4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_17.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_17.png deleted file mode 100644 index 8fc3e5d0df..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_20.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_20.png deleted file mode 100644 index b6cf203416..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_21.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_21.png deleted file mode 100644 index 0c55bebb7a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_22.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_22.png deleted file mode 100644 index 73f6c6c7ca..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_23.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_23.png deleted file mode 100644 index fb4a106126..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_24.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_24.png deleted file mode 100644 index a40251e6af..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_25.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_25.png deleted file mode 100644 index dba53847bb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_26.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_26.png deleted file mode 100644 index c2ad298a10..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_27.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_27.png deleted file mode 100644 index 266e5a9a6b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_28.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_28.png deleted file mode 100644 index 15259c17eb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_30.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_30.png deleted file mode 100644 index bc76d71ab9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_30.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_31.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_31.png deleted file mode 100644 index 5e8e8d31fb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_31.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_32.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_32.png deleted file mode 100644 index 52e2e6a540..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_32.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_33.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_33.png deleted file mode 100644 index 357de360f4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_33.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_34.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_34.png deleted file mode 100644 index ef5a9d75b2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_34.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_35.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_35.png deleted file mode 100644 index 9c0d6b2058..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_35.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_36.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_36.png deleted file mode 100644 index f99d780e06..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_36.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_37.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_37.png deleted file mode 100644 index 17fff66f7b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_37.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_38.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_38.png deleted file mode 100644 index d4464587af..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_38.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_39.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_39.png deleted file mode 100644 index a7db692ecc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_39.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_40.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_40.png deleted file mode 100644 index 5cd1176c4d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_40.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_41.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_41.png deleted file mode 100644 index 89c97b5dc8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_41.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_42.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_42.png deleted file mode 100644 index d76fa3a7c6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_42.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_43.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_43.png deleted file mode 100644 index 15ca9088f1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_43.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_44.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_44.png deleted file mode 100644 index fe01e04472..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_44.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_68.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_68.png deleted file mode 100644 index 0d57b42290..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_84.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_84.png deleted file mode 100644 index 99bdea2e1e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_84.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/tc_85.png b/libraries/map-amap/src/main/res/drawable-ldpi/tc_85.png deleted file mode 100644 index e85921c9c3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/tc_85.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-ldpi/video_loading_img.png b/libraries/map-amap/src/main/res/drawable-ldpi/video_loading_img.png deleted file mode 100644 index 48be2bdd18..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-ldpi/video_loading_img.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_bus.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_bus.png deleted file mode 100644 index 66f73f4454..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_bus.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_car.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_car.png deleted file mode 100644 index b12b10c83f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_car.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_end.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_end.png deleted file mode 100644 index 5503dc5a28..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_end.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_man.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_man.png deleted file mode 100644 index 16842d5d12..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_man.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_ride.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_ride.png deleted file mode 100644 index 2fa5633c59..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_ride.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_0_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_0_arrow.png deleted file mode 100644 index 21793fea2b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_0_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_1_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_1_arrow.png deleted file mode 100644 index d7d832857f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_1_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_2_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_2_arrow.png deleted file mode 100644 index c1d019b4ae..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_2_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_3_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_3_arrow.png deleted file mode 100644 index b3318ad436..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_3_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_4_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_4_arrow.png deleted file mode 100644 index 038e63f485..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_4_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_5_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_5_arrow.png deleted file mode 100644 index e15ce84e87..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_5_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_6_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_6_arrow.png deleted file mode 100644 index 9f3540757a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_6_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_7_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_7_arrow.png deleted file mode 100644 index cef675f06f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_7_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_8_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_8_arrow.png deleted file mode 100644 index c4d67d38a4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_8_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_9_arrow.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_9_arrow.png deleted file mode 100644 index 3c92f82f0d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_route_color_texture_9_arrow.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_start.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_start.png deleted file mode 100644 index cd716c8840..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_start.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/amap_through.png b/libraries/map-amap/src/main/res/drawable-mdpi/amap_through.png deleted file mode 100644 index e636b446c1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/amap_through.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/app_icon.png b/libraries/map-amap/src/main/res/drawable-mdpi/app_icon.png deleted file mode 100644 index c97be4be12..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/app_icon.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/default_image.png b/libraries/map-amap/src/main/res/drawable-mdpi/default_image.png deleted file mode 100644 index fdc210cd25..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/default_image.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir1.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir1.png deleted file mode 100644 index fec3f4ec69..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir1.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir10.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir10.png deleted file mode 100644 index 34c2228f6c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir11.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir11.png deleted file mode 100644 index df9e8dc67c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir12.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir12.png deleted file mode 100644 index a4ba8c22cb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir13.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir13.png deleted file mode 100644 index 39ad870c5f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir14.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir14.png deleted file mode 100644 index a3c1632562..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir15.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir15.png deleted file mode 100644 index c99fb65b94..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir16.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir16.png deleted file mode 100644 index 86898c2144..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir2.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir2.png deleted file mode 100644 index 750b6fbb7e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir3.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir3.png deleted file mode 100644 index 8cbe886e81..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir3.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir4.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir4.png deleted file mode 100644 index cfe7d6c0fb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir4.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir5.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir5.png deleted file mode 100644 index e465d5eec2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir5.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir6.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir6.png deleted file mode 100644 index 0d2f3c0360..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir6.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir7.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir7.png deleted file mode 100644 index e53c9ff451..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir7.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir8.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir8.png deleted file mode 100644 index edfdbe1df0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir8.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir9.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir9.png deleted file mode 100644 index a762d0b74a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir9.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir_end.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir_end.png deleted file mode 100644 index f3cb78aed4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir_end.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir_start.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir_start.png deleted file mode 100644 index 4d2a797823..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir_start.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/dir_station.png b/libraries/map-amap/src/main/res/drawable-mdpi/dir_station.png deleted file mode 100644 index 2ed622283b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/dir_station.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_1.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_1.png deleted file mode 100644 index 0fa0edb0a4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_1.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_10.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_10.png deleted file mode 100644 index 797b106127..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_11.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_11.png deleted file mode 100644 index e54bbd6292..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_12.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_12.png deleted file mode 100644 index f93a673421..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_13.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_13.png deleted file mode 100644 index bf8d9bc3db..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_14.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_14.png deleted file mode 100644 index e7288ac5c2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_15.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_15.png deleted file mode 100644 index 9c0c2af8f4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_16.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_16.png deleted file mode 100644 index 30cffd20e5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_17.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_17.png deleted file mode 100644 index 81ebaa35cd..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_18.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_18.png deleted file mode 100644 index 8370408b15..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_18.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_19.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_19.png deleted file mode 100644 index da5648fb9c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_19.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_2.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_2.png deleted file mode 100644 index 851d6d878e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_20.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_20.png deleted file mode 100644 index 79ffe11b10..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_21.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_21.png deleted file mode 100644 index 9f80ca5181..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_22.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_22.png deleted file mode 100644 index 403c5ea7e8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_23.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_23.png deleted file mode 100644 index 6e1b9f33b8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_24.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_24.png deleted file mode 100644 index 060b5e94f0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_25.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_25.png deleted file mode 100644 index 7a027897ce..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_26.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_26.png deleted file mode 100644 index 6806d3457e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_27.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_27.png deleted file mode 100644 index dd1717bd6b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_28.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_28.png deleted file mode 100644 index 239b379f3b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_4.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_4.png deleted file mode 100644 index 5cf551b141..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_4.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_5.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_5.png deleted file mode 100644 index 70ac563aa4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_5.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_50.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_50.png deleted file mode 100644 index 4780ef7427..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_50.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_51.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_51.png deleted file mode 100644 index f6501640a1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_51.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_52.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_52.png deleted file mode 100644 index 7c8a880609..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_52.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_53.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_53.png deleted file mode 100644 index 4cb5e21820..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_53.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_54.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_54.png deleted file mode 100644 index 37289bbaaf..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_54.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_55.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_55.png deleted file mode 100644 index e8263cdc1b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_55.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_56.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_56.png deleted file mode 100644 index 48b91385ad..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_56.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_57.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_57.png deleted file mode 100644 index 080eaece28..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_57.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_58.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_58.png deleted file mode 100644 index 7f7034ff9f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_58.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_59.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_59.png deleted file mode 100644 index 735392d59d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_59.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_6.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_6.png deleted file mode 100644 index ff9757c869..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_6.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_60.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_60.png deleted file mode 100644 index 98c94b3826..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_60.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_61.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_61.png deleted file mode 100644 index a924085ef8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_61.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_62.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_62.png deleted file mode 100644 index c20542f34f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_62.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_63.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_63.png deleted file mode 100644 index d408fe0153..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_63.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_64.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_64.png deleted file mode 100644 index 5a9af68c32..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_64.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_65.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_65.png deleted file mode 100644 index 57a7454b4f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_65.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_66.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_66.png deleted file mode 100644 index c471bf466a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_66.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_67.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_67.png deleted file mode 100644 index 22e6178738..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_67.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_68.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_68.png deleted file mode 100644 index a782cffbd9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_69.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_69.png deleted file mode 100644 index a1545ef55f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_69.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_7.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_7.png deleted file mode 100644 index b4a6465ce0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_7.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_8.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_8.png deleted file mode 100644 index d19f036aa9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_8.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_9.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_9.png deleted file mode 100644 index a2b07ad3d7..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_9.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_endpoint.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_endpoint.png deleted file mode 100644 index a1716599df..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_endpoint.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_refresh.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_refresh.png deleted file mode 100644 index d86c3f8024..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_refresh.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/ic_snapshot_ph.png b/libraries/map-amap/src/main/res/drawable-mdpi/ic_snapshot_ph.png deleted file mode 100644 index 281f1bb163..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/ic_snapshot_ph.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable-mdpi/join_checkbox_bg.png deleted file mode 100644 index 89d00803c5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/join_checkbox_bg.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/live_exit.png b/libraries/map-amap/src/main/res/drawable-mdpi/live_exit.png deleted file mode 100644 index 7d9b50f159..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/live_exit.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/location_city_image.png b/libraries/map-amap/src/main/res/drawable-mdpi/location_city_image.png deleted file mode 100644 index ce5515c529..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/location_city_image.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_normal.png b/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_normal.png deleted file mode 100644 index 9c1a2a4aea..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_press.png b/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_press.png deleted file mode 100644 index d927b18877..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_left_page_up_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_normal.png b/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_normal.png deleted file mode 100644 index dda526f475..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_press.png b/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_press.png deleted file mode 100644 index 2289209d9a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/main_solid_right_page_up_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/mainpage_location_img.png b/libraries/map-amap/src/main/res/drawable-mdpi/mainpage_location_img.png deleted file mode 100644 index 7a463ac3ab..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/mainpage_location_img.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png deleted file mode 100644 index 98fc674705..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/map_api_ic_current_location2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/map_location_normal.png b/libraries/map-amap/src/main/res/drawable-mdpi/map_location_normal.png deleted file mode 100644 index 53f5b5a14a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/map_location_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/map_location_press.png b/libraries/map-amap/src/main/res/drawable-mdpi/map_location_press.png deleted file mode 100644 index e3e430c8d6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/map_location_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/not_join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable-mdpi/not_join_checkbox_bg.png deleted file mode 100644 index 663addd255..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/not_join_checkbox_bg.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/public_arrow_back_iv.png b/libraries/map-amap/src/main/res/drawable-mdpi/public_arrow_back_iv.png deleted file mode 100644 index cd7159e219..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/public_arrow_back_iv.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/search_information_normal.png b/libraries/map-amap/src/main/res/drawable-mdpi/search_information_normal.png deleted file mode 100644 index 69529ef0bd..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/search_information_normal.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/search_information_press.png b/libraries/map-amap/src/main/res/drawable-mdpi/search_information_press.png deleted file mode 100644 index 8338cc95ae..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/search_information_press.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_10.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_10.png deleted file mode 100644 index 629e98359d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_11.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_11.png deleted file mode 100644 index c0d6528e63..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_12.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_12.png deleted file mode 100644 index c14ec9a985..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_13.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_13.png deleted file mode 100644 index 71bc66ca60..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_14.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_14.png deleted file mode 100644 index 15e798dcce..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_15.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_15.png deleted file mode 100644 index a69e9437f3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_16.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_16.png deleted file mode 100644 index ff948797b4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_17.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_17.png deleted file mode 100644 index 8fc3e5d0df..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_20.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_20.png deleted file mode 100644 index b6cf203416..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_21.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_21.png deleted file mode 100644 index 0c55bebb7a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_22.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_22.png deleted file mode 100644 index 73f6c6c7ca..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_23.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_23.png deleted file mode 100644 index fb4a106126..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_24.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_24.png deleted file mode 100644 index a40251e6af..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_25.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_25.png deleted file mode 100644 index dba53847bb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_26.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_26.png deleted file mode 100644 index c2ad298a10..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_27.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_27.png deleted file mode 100644 index 266e5a9a6b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_28.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_28.png deleted file mode 100644 index 15259c17eb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_30.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_30.png deleted file mode 100644 index bc76d71ab9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_30.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_31.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_31.png deleted file mode 100644 index 5e8e8d31fb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_31.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_32.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_32.png deleted file mode 100644 index 52e2e6a540..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_32.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_33.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_33.png deleted file mode 100644 index 357de360f4..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_33.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_34.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_34.png deleted file mode 100644 index ef5a9d75b2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_34.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_35.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_35.png deleted file mode 100644 index 9c0d6b2058..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_35.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_36.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_36.png deleted file mode 100644 index f99d780e06..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_36.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_37.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_37.png deleted file mode 100644 index 17fff66f7b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_37.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_38.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_38.png deleted file mode 100644 index d4464587af..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_38.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_39.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_39.png deleted file mode 100644 index a7db692ecc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_39.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_40.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_40.png deleted file mode 100644 index 5cd1176c4d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_40.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_41.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_41.png deleted file mode 100644 index 89c97b5dc8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_41.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_42.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_42.png deleted file mode 100644 index d76fa3a7c6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_42.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_43.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_43.png deleted file mode 100644 index 15ca9088f1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_43.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_44.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_44.png deleted file mode 100644 index fe01e04472..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_44.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_68.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_68.png deleted file mode 100644 index 0d57b42290..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_84.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_84.png deleted file mode 100644 index 99bdea2e1e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_84.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/tc_85.png b/libraries/map-amap/src/main/res/drawable-mdpi/tc_85.png deleted file mode 100644 index e85921c9c3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/tc_85.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-mdpi/video_loading_img.png b/libraries/map-amap/src/main/res/drawable-mdpi/video_loading_img.png deleted file mode 100644 index 48be2bdd18..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-mdpi/video_loading_img.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png deleted file mode 100644 index eb8ca757dc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png deleted file mode 100755 index 5a4c2cf96e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png deleted file mode 100755 index 5a05ce6474..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png deleted file mode 100755 index 8d8a894b58..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png deleted file mode 100755 index 96ffe793f8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png deleted file mode 100755 index 4cfbae387d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png deleted file mode 100755 index 77d51fe649..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png deleted file mode 100755 index b0f50cc894..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png deleted file mode 100755 index bb21c76be1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png deleted file mode 100755 index eb9cfc2cdd..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png deleted file mode 100755 index 061114de81..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png deleted file mode 100755 index bf4793327c..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png deleted file mode 100755 index eb59de2d41..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png deleted file mode 100755 index e8e6e92b49..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png deleted file mode 100755 index 3f8192d710..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png deleted file mode 100755 index d479431b73..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png deleted file mode 100755 index 981a89f1a3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png deleted file mode 100755 index 6d05927994..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png deleted file mode 100755 index 69df7c1534..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png deleted file mode 100755 index 29c3d23eff..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png deleted file mode 100755 index 611f3b41fb..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png deleted file mode 100755 index 0bdebdd05d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png deleted file mode 100755 index e9d338aa96..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png deleted file mode 100755 index 353e5049b8..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png deleted file mode 100755 index 2b938c892e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png deleted file mode 100755 index 2902206da5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png deleted file mode 100755 index 94db18a7f0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png deleted file mode 100755 index 74e434228a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png deleted file mode 100755 index cd1cfd42f7..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png deleted file mode 100755 index adc0bbbbb3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png deleted file mode 100755 index 3d63020dd2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png deleted file mode 100755 index a4dd04c61a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png deleted file mode 100755 index 9bd9e6945a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png deleted file mode 100755 index 89dd67242a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png deleted file mode 100755 index e1bf5acd56..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png deleted file mode 100755 index 089222b492..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png deleted file mode 100755 index 5c797cfbf2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png deleted file mode 100755 index eddba707ef..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png deleted file mode 100755 index db1ad2eeb7..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png deleted file mode 100755 index 957d08b307..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png deleted file mode 100755 index 3bcc77650a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png deleted file mode 100755 index 47897888a0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png deleted file mode 100755 index 727505beb9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png deleted file mode 100755 index b18126a2f0..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png deleted file mode 100755 index 329995bd2f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png deleted file mode 100755 index 63d1ccd728..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png deleted file mode 100755 index 8257b5dfe3..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png deleted file mode 100755 index 7c29ae8f99..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png deleted file mode 100755 index a348269ccc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_endpoint.png b/libraries/map-amap/src/main/res/drawable-xhdpi/ic_endpoint.png deleted file mode 100644 index f178056730..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/ic_endpoint.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png b/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png deleted file mode 100644 index eb8ca757dc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/map_api_ic_current_location2.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png deleted file mode 100755 index bbc15d056d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png deleted file mode 100755 index 316f5e1b96..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png deleted file mode 100755 index 8e18625e6d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png deleted file mode 100755 index 903dff86ed..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png deleted file mode 100755 index cd95173633..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png deleted file mode 100755 index 8bc4f5247d..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png deleted file mode 100755 index 7b9b08ebf2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png deleted file mode 100755 index 5a1f932024..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png deleted file mode 100755 index 2d4462266e..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png deleted file mode 100755 index 7a950926ce..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png deleted file mode 100755 index 09b1272ce6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png deleted file mode 100755 index 4e52213d57..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png deleted file mode 100755 index d9afd535e5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png deleted file mode 100755 index 70a25f3c25..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png deleted file mode 100755 index d87fe0ba59..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png deleted file mode 100755 index 28afebb493..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png deleted file mode 100755 index 5c23e754e6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png deleted file mode 100755 index 6593326f29..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png deleted file mode 100755 index 3bfa5983b6..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png deleted file mode 100755 index 53fa3dc1b2..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png deleted file mode 100755 index e9a51bb3f1..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png deleted file mode 100755 index c033de20cc..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png deleted file mode 100755 index 78c0a884b5..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png deleted file mode 100755 index 9d2d6889c9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png deleted file mode 100755 index 45b1420b8a..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png deleted file mode 100755 index e716d63c69..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png deleted file mode 100755 index 973a163dc9..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png deleted file mode 100755 index 10a7dc6995..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png deleted file mode 100755 index 89e9415071..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png deleted file mode 100755 index 2716e1a458..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png deleted file mode 100755 index 7ac8809a8b..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png deleted file mode 100755 index 0c4daba210..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png deleted file mode 100755 index 9763518122..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png deleted file mode 100755 index 24a6ef2e82..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png b/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png deleted file mode 100755 index 91e3cb0e8f..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/drawable-xhdpi/video_loading_img.png b/libraries/map-amap/src/main/res/drawable-xhdpi/video_loading_img.png deleted file mode 100644 index 48be2bdd18..0000000000 Binary files a/libraries/map-amap/src/main/res/drawable-xhdpi/video_loading_img.png and /dev/null differ diff --git a/libraries/map-amap/src/main/res/layout/module_map_amap_my_location.xml b/libraries/map-amap/src/main/res/layout/module_map_amap_my_location.xml deleted file mode 100644 index 690f7b6c48..0000000000 --- a/libraries/map-amap/src/main/res/layout/module_map_amap_my_location.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file diff --git a/libraries/map-amap/src/main/res/values-ldpi/dimens.xml b/libraries/map-amap/src/main/res/values-ldpi/dimens.xml deleted file mode 100644 index 242c78ec72..0000000000 --- a/libraries/map-amap/src/main/res/values-ldpi/dimens.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 40px - \ No newline at end of file diff --git a/libraries/map-amap/src/main/res/values-xhdpi/dimens.xml b/libraries/map-amap/src/main/res/values-xhdpi/dimens.xml deleted file mode 100644 index e296400581..0000000000 --- a/libraries/map-amap/src/main/res/values-xhdpi/dimens.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 360px - 63px - 96px - \ No newline at end of file diff --git a/libraries/map-amap/src/main/res/values/dimens.xml b/libraries/map-amap/src/main/res/values/dimens.xml deleted file mode 100644 index 5c0178abb7..0000000000 --- a/libraries/map-amap/src/main/res/values/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 60px - 36px - 53px - 194px - \ No newline at end of file diff --git a/libraries/map-amap/src/main/res/values/strings.xml b/libraries/map-amap/src/main/res/values/strings.xml deleted file mode 100644 index 63a33e31ae..0000000000 --- a/libraries/map-amap/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - map-amap - diff --git a/modules/mogo-module-authorize/.gitignore b/modules/mogo-module-authorize/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/modules/mogo-module-authorize/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/modules/mogo-module-authorize/build.gradle b/modules/mogo-module-authorize/build.gradle deleted file mode 100644 index 18784e1f09..0000000000 --- a/modules/mogo-module-authorize/build.gradle +++ /dev/null @@ -1,76 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' -} - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation rootProject.ext.dependencies.kotlinstdlibjdk7 - implementation rootProject.ext.dependencies.androidxccorektx - implementation rootProject.ext.dependencies.coroutinescore - implementation rootProject.ext.dependencies.coroutinesandroid - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - implementation rootProject.ext.dependencies.arouter - - kapt rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogocommons - implementation rootProject.ext.dependencies.mogoserviceapi - implementation rootProject.ext.dependencies.modulecommon - - implementation rootProject.ext.dependencies.mogo_core_utils - implementation rootProject.ext.dependencies.mogo_core_data - } else { - implementation project(":foudations:mogo-utils") - implementation project(":foudations:mogo-commons") - implementation project(':services:mogo-service-api') - implementation project(":modules:mogo-module-common") - - implementation project(':core:mogo-core-utils') - implementation project(':core:mogo-core-data') - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/modules/mogo-module-authorize/consumer-rules.pro b/modules/mogo-module-authorize/consumer-rules.pro deleted file mode 100644 index 551d2e9258..0000000000 --- a/modules/mogo-module-authorize/consumer-rules.pro +++ /dev/null @@ -1,2 +0,0 @@ -#-----AuthorizeModule----- --keep class com.mogo.module.authorize.module.bean.*{*;} \ No newline at end of file diff --git a/modules/mogo-module-authorize/gradle.properties b/modules/mogo-module-authorize/gradle.properties deleted file mode 100644 index aff034b53f..0000000000 --- a/modules/mogo-module-authorize/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.module -POM_ARTIFACT_ID=module-authorize -VERSION_CODE=1 \ No newline at end of file diff --git a/modules/mogo-module-authorize/proguard-rules.pro b/modules/mogo-module-authorize/proguard-rules.pro deleted file mode 100644 index ff909a2e24..0000000000 --- a/modules/mogo-module-authorize/proguard-rules.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -#-----AuthorizeModule----- --keep class com.mogo.module.authorize.module.bean.**{*;} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/AndroidManifest.xml b/modules/mogo-module-authorize/src/main/AndroidManifest.xml deleted file mode 100644 index bdcca1cd30..0000000000 --- a/modules/mogo-module-authorize/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt deleted file mode 100644 index 911d62b5a1..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/IMogoAuthorizeController.kt +++ /dev/null @@ -1,139 +0,0 @@ -package com.mogo.module.authorize.authprovider.biz - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener -import com.mogo.module.authorize.model.BaseResponse -import com.mogo.module.authorize.model.IMogoAuthorizeModel -import com.mogo.module.authorize.model.bean.* -import com.mogo.module.authorize.net.request -import com.mogo.module.authorize.util.DateUtil.parseDateToTime -import com.mogo.module.authorize.util.SharedPreferenceUtil.getAuthorizeVersion -import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus -import com.mogo.module.authorize.util.SharedPreferenceUtil.updateAuthorizeVersion -import com.mogo.utils.logger.Logger - -open class IMogoAuthorizeController { - - companion object { - const val TAG = "AuthorizeController" - } - - private val authorizeModel: IMogoAuthorizeModel by lazy { IMogoAuthorizeModel() } - - fun getAuthorizeContent(onStart: () -> Unit, onSuccess: (Agreement) -> Unit, onError: (String) -> Unit) { - realInvokeAuthorizeContent(0, { - onStart.invoke() - }, { - if (it.result != null && it.result.agreement.agreementContent != null) { - onSuccess.invoke(it.result.agreement) - } else { - onError.invoke("data is null") - } - }, { msg: String -> - onError.invoke(msg) - }, true) - } - - fun invokeAuthorizeContent(tag: String, agreementType: Int) { - realInvokeAuthorizeContent(agreementType, { - if (agreementType == -1) { - getAuthorizeContentListener(tag, { listener -> - listener.requestContentFailed("invokeAuthorizeContent param tag is not right") - }, { - Logger.d(TAG, "invokeAuthorizeContent ---checkAgreementType can not find tag :$tag") - }) - } - }, { - getAuthorizeContentListener(tag, { listener -> - if (it.result != null && it.result.agreement.agreementContent != null) { - listener.requestContentSuccess(it.result.agreement) - } else { - listener.requestContentFailed("request authorize content success ,but result data is :${it.result}") - } - }, { - Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag") - }) - }, { msg: String -> - getAuthorizeContentListener(tag, { listener -> - listener.requestContentFailed(msg) - }, { - Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag") - }) - }) - } - - private fun realInvokeAuthorizeContent(agreementType: Int, onStart: (() -> Unit), onSuccess: ((BaseResponse) -> Unit), onError: ((String) -> Unit), needContent: Boolean = false) { - onStart.invoke() - try { - request> { - loader { - authorizeModel.invokeAuthorizeContent(agreementType, needContent) - } - onSuccess { - onSuccess.invoke(it) - } - onError { - onError.invoke(it.message - ?: "realInvokeAuthorizeContent onError, message is null") - } - } - } catch (e: Exception) { - e.printStackTrace() - onError.invoke(e.message ?: "realInvokeAuthorizeContent has exception, message is null") - } - } - - private inline fun getAuthorizeContentListener(tag: String, blockSuccess: ((IMogoAuthorizeContentListener) -> Unit), blockNull: (() -> Unit)) { - val authorizeContentListener = MogoAuthorizeRegisterHandler.getAuthorizeContentListener(tag) - if (authorizeContentListener != null) { - blockSuccess(authorizeContentListener) - } else { - blockNull() - } - } - - fun updateAgreementVersion(agreementType: Int) { - realInvokeAuthorizeContent(agreementType, { - Logger.d(TAG, "ready to update agreement") - }, { - if (it.result != null) { - val agreement = it.result.agreement - val updateTime = agreement.tUserAgreementEntity.updateTime - val currentTime = parseDateToTime(updateTime) - if (hasNewVersion(currentTime)) { - updateAuthorizeVersion(currentTime) - setAuthorizeStatus(agreementType, false) - } else { - Logger.d(TAG, "no new version") - } - } - }, { s: String -> - Logger.d(TAG, "updateAgreementAndAuthorization reason:$s") - }) - } - - private fun hasNewVersion(currentTime: Long): Boolean { - val oldVersion = getAuthorizeVersion() - return currentTime > oldVersion - } - - fun checkIfNeedAuthorize(agreementType: Int) { - request> { - loader { - authorizeModel.invokeIfNeedAuthorize(agreementType) - } - onSuccess { - Logger.d(TAG,"result : ${it.result}") - val result = it.result - when (result.agreementStatus) { - AGREEMENT_EFFECT -> setAuthorizeStatus(agreementType, true) - AGREEMENT_NOT_EFFECT -> setAuthorizeStatus(agreementType, false) - else -> Logger.d(TAG, "agreementStatus is not match any case") - } - } - onError { - Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null") - setAuthorizeStatus(agreementType, true) - } - } - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt deleted file mode 100644 index 7c2a88cbf2..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeManagerImpl.kt +++ /dev/null @@ -1,53 +0,0 @@ -package com.mogo.module.authorize.authprovider.biz - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeInvoke -import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener -import com.mogo.module.authorize.model.proxy.AuthorizeProxy -import com.mogo.module.authorize.model.proxy.toAuthorizeType -import com.mogo.module.authorize.util.SharedPreferenceUtil.needAuthorization -import com.mogo.utils.logger.Logger - -abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke { - - companion object { - const val TAG = "AuthorizeManagerImpl" - } - - private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() } - - override fun needAuthorize(tag: String): Boolean { - Logger.d(TAG, "===== needAuthorize update agreement in background") - baseController.checkIfNeedAuthorize(tag.toAuthorizeType()) - return needAuthorization(tag.toAuthorizeType()) - } - - override fun updateAuthorizeStatus(tag: String) { - baseController.checkIfNeedAuthorize(tag.toAuthorizeType()) - } - - override fun invokeAuthorizeContent(tag: String) { - Logger.d(TAG, "tag:$tag") - val agreementType = AuthorizeProxy.getAuthorizeType(tag) - Logger.d(TAG, "agreementType:$agreementType") - baseController.invokeAuthorizeContent(tag, agreementType) - } - - override fun registerInvokeAuthorizeContentListener(tag: String, listener: IMogoAuthorizeContentListener) { - MogoAuthorizeRegisterHandler.registerInvokeAuthorizeContentListener(tag, listener) - } - - override fun unregisterInvokeAuthorizeContentListener(tag: String) { - MogoAuthorizeRegisterHandler.unregisterInvokeAuthorizeContentListener(tag) - } - - override fun registerAuthorizeListener(tag: String, listener: IMogoAcquireAuthorizeListener) { - Logger.d(TAG, "registerAuthorize tag : $tag listener:$listener") - MogoAuthorizeRegisterHandler.registerAuthorizeListener(tag, listener) - } - - override fun unregisterAuthorizeListener(tag: String) { - MogoAuthorizeRegisterHandler.unregisterAuthorizeListener(tag) - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt deleted file mode 100644 index 4f81c494df..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeProvider.kt +++ /dev/null @@ -1,100 +0,0 @@ -@file:Suppress("DEPRECATION") - -package com.mogo.module.authorize.authprovider.biz - -import android.content.Context -import android.os.Bundle -import android.view.View -import androidx.fragment.app.Fragment -import com.alibaba.android.arouter.facade.annotation.Route -import com.mogo.map.listener.IMogoMapListener -import com.mogo.map.location.IMogoLocationListener -import com.mogo.map.marker.IMogoMarkerClickListener -import com.mogo.map.navi.IMogoNaviListener -import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN -import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow -import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide -import com.mogo.eagle.core.data.constants.MogoServicePaths -import com.mogo.service.auth.IMogoAuthManager -import com.mogo.service.module.IMogoModuleLifecycle -import com.mogo.utils.logger.Logger - -@Route(path = MogoServicePaths.PATH_AGREEMENT) -class MogoAuthorizeProvider : IMogoAuthManager { - - companion object { - const val TAG = "MogoAuthorizeProvider" - } - - private var mContext: Context? = null - - override fun createFragment(context: Context?, data: Bundle?): Fragment? { - return null - } - - override fun createView(context: Context?): View? { - return null - } - - override fun getModuleName(): String { - return PATH_AGREEMENT_MODULE_NAME - } - - override fun getCardLifecycle(): IMogoModuleLifecycle? { - return null - } - - override fun getMapListener(): IMogoMapListener? { - return null - } - - override fun getType(): Int { - return 0 - } - - override fun getNaviListener(): IMogoNaviListener? { - return null - } - - override fun getLocationListener(): IMogoLocationListener? { - return null - } - - override fun getMarkerClickListener(): IMogoMarkerClickListener? { - return null - } - - override fun showAuth(context: Context) { - mContext = context - mogoAuthShow.initContext(context) - if (hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) { - mogoAuthShow.invokeAuthorizeForShow() - } else { - //首次进入Launcher同步一下授权状态,防止由于用户清除数据造成首次加载还会出现授权状态不同步问题 - mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN) - Logger.d(TAG, "not do match self startUp condition ,wait for someone invoke") - } - } - - override fun dismiss() { - mogoAuthShow.hideAuthorizeView() - } - - override fun init(context: Context) { - - } - - override fun getAppPackage(): String? { - return null - } - - override fun getAppName(): String? { - return null - } - - override fun onDestroy() { - mContext = null - mogoAuthShow.release() - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeRegisterHandler.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeRegisterHandler.kt deleted file mode 100644 index 889e0e70b2..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/biz/MogoAuthorizeRegisterHandler.kt +++ /dev/null @@ -1,43 +0,0 @@ -package com.mogo.module.authorize.authprovider.biz - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeRegister -import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener -import com.mogo.utils.logger.Logger -import java.util.concurrent.ConcurrentHashMap - -object MogoAuthorizeRegisterHandler : IMogoAuthorizeRegister { - - private val authMap: ConcurrentHashMap = ConcurrentHashMap() - private val authContentMap: ConcurrentHashMap = ConcurrentHashMap() - - override fun registerAuthorizeListener(tag: String, listener: IMogoAcquireAuthorizeListener) { - Logger.d("RegisterHandler", "tag : $tag listener:$listener") - authMap[tag] = listener - } - - override fun unregisterAuthorizeListener(tag: String) { - authMap.remove(tag) - } - - fun getAuthorizeListener(tag: String): IMogoAcquireAuthorizeListener? { - return authMap[tag] - } - - fun getAllAuthorizeListener(): ConcurrentHashMap { - return authMap - } - - override fun registerInvokeAuthorizeContentListener(tag: String, listener: IMogoAuthorizeContentListener) { - authContentMap[tag] = listener - } - - override fun unregisterInvokeAuthorizeContentListener(tag: String) { - authContentMap.remove(tag) - } - - fun getAuthorizeContentListener(tag: String): IMogoAuthorizeContentListener? { - return authContentMap[tag] - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt deleted file mode 100644 index 3da6930843..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeConstant.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -class AuthorizeConstant { - - companion object{ - const val PROVIDER_MODULE = "/authorize/biz" - const val PROVIDER_LAUNCHER = "/authorize/showbiz" - - /** - * provider模块实例名称(暂时仅有卡片用到) - */ - const val PATH_AGREEMENT_MODULE_NAME = "AGREEMENT_MODULE_NAME" - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeInvokerConstant.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeInvokerConstant.kt deleted file mode 100644 index af3930f91b..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/AuthorizeInvokerConstant.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -class AuthorizeInvokerConstant { - - companion object { - const val AUTHORIZE_TYPE_LAUNCHER_MAIN = "AUTHORIZE_TYPE_LAUNCHER_MAIN" //launcher - const val AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY = "AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY" //launcher 新鲜事分享 - const val AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC = "AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC" //launcher 音乐分享 - const val AUTHORIZE_TYPE_LAUNCHER_SHARE = "AUTHORIZE_TYPE_LAUNCHER_SHARE" //launcher 我要分享 - const val AUTHORIZE_TYPE_TAN_LU = "AUTHORIZE_TYPE_TAN_LU" //探路 - const val AUTHORIZE_TYPE_CALL_CHAT = "AUTHORIZE_TYPE_CALL_CHAT" //车聊聊 - const val AUTHORIZE_TYPE_NOVELTY = "AUTHORIZE_TYPE_NOVELTY" //新鲜事 - const val AUTHORIZE_TYPE_AUXILIARY_DRIVING = "AUTHORIZE_TYPE_AUXILIARY_DRIVING" //辅助驾驶 - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeContentListener.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeContentListener.kt deleted file mode 100644 index 06a999aa3e..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeContentListener.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -import com.mogo.module.authorize.model.bean.Agreement - -/** - * 获取授权信息回调 - */ -interface IMogoAuthorizeContentListener { - - fun requestContentSuccess(userAgreement: Agreement) - - fun requestContentFailed(errorMsg: String) -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeForbiddenVoice.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeForbiddenVoice.kt deleted file mode 100644 index bc646e2024..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeForbiddenVoice.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -interface IMogoAuthorizeForbiddenVoice { - - /** - * 当授权页面展示时,语音回调不生效(唤醒、免唤醒) - */ - fun forbiddenVoiceWhenAuthorize(cmd: String) -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeInvoke.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeInvoke.kt deleted file mode 100644 index c84550a0b7..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeInvoke.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -/** - * 公共Business业务 - */ -interface IMogoAuthorizeInvoke : IMogoAuthorizeRegister { - - /** - * 是否需要授权 - */ - fun needAuthorize(tag: String): Boolean - - /** - * 获取授权内容 - * tag:模块ID - */ - fun invokeAuthorizeContent(tag: String) - - /** - * 更新授权状态 - * tag:模块ID - */ - fun updateAuthorizeStatus(tag:String){ - - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeRegister.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeRegister.kt deleted file mode 100644 index 280bc6998a..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/invoke/IMogoAuthorizeRegister.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.mogo.module.authorize.authprovider.invoke - -import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener - -interface IMogoAuthorizeRegister { - - /** - * 注冊授权回调 - * tag:module tag - * @see IMogoAcquireAuthorizeListener - */ - fun registerAuthorizeListener(tag: String, listener: IMogoAcquireAuthorizeListener) - - /** - * 反注册授权回调 - * tag:module tag - */ - fun unregisterAuthorizeListener(tag: String) - - /** - * 注册授权信息内容回调 - * tag:module tag - * @see IMogoAuthorizeContentListener - */ - fun registerInvokeAuthorizeContentListener(tag: String, listener: IMogoAuthorizeContentListener) - - /** - * 反注册授权信息内容回调 - * tag:module tag - */ - fun unregisterInvokeAuthorizeContentListener(tag: String) - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IAuthorizeMainInvoke.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IAuthorizeMainInvoke.kt deleted file mode 100644 index af945e03c7..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IAuthorizeMainInvoke.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeInvoke - -//与Biz业务相同接口实现 -interface IAuthorizeMainInvoke : IMogoAuthorizeInvoke { - - /** - * 同意授权 - * tag:透传模块ID - */ - fun agreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) - - /** - * 不同意授权 - * tag:透传模块ID - */ - fun disAgreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) - - /** - * 是否已经注册回调 - */ - fun hasRegister(tag: String): Boolean -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainManager.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainManager.kt deleted file mode 100644 index c20053c616..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainManager.kt +++ /dev/null @@ -1,47 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import com.alibaba.android.arouter.facade.annotation.Route -import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener -import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow -import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener - -@Route(path = AuthorizeConstant.PROVIDER_LAUNCHER) -class IMogoAuthorizeMainManager : IMogoAuthorizeMainProvider { - - override fun hasRegister(tag: String): Boolean { - return mogoAuthShow.hasRegister(tag) - } - - override fun needAuthorize(tag: String): Boolean { - return mogoAuthShow.needAuthorize(tag) - } - - override fun invokeAuthorizeContent(tag: String) { - mogoAuthShow.invokeAuthorizeContent(tag) - } - - override fun agreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - mogoAuthShow.agreeAuthorize(tag, agrId, onSuccess, onError) - } - - override fun disAgreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - mogoAuthShow.disAgreeAuthorize(tag, agrId, onSuccess, onError) - } - - override fun registerAuthorizeListener(tag: String, listener: IMogoAcquireAuthorizeListener) { - mogoAuthShow.registerAuthorizeListener(tag, listener) - } - - override fun unregisterAuthorizeListener(tag: String) { - mogoAuthShow.unregisterAuthorizeListener(tag) - } - - override fun registerInvokeAuthorizeContentListener(tag: String, listener: IMogoAuthorizeContentListener) { - mogoAuthShow.registerInvokeAuthorizeContentListener(tag, listener) - } - - override fun unregisterInvokeAuthorizeContentListener(tag: String) { - mogoAuthShow.unregisterInvokeAuthorizeContentListener(tag) - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainProvider.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainProvider.kt deleted file mode 100644 index 8a47fe9fc3..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeMainProvider.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import android.content.Context -import com.alibaba.android.arouter.facade.template.IProvider -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeInvoke - -//仅提供给调用业务端(主launcher)使用 -interface IMogoAuthorizeMainProvider : IProvider, IAuthorizeMainInvoke { - - override fun init(context: Context?) { - - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeShow.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeShow.kt deleted file mode 100644 index f6cbde0907..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/IMogoAuthorizeShow.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeForbiddenVoice - -interface IMogoAuthorizeShow : IMogoAuthorizeForbiddenVoice { - - fun showAuthorizeView() -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainController.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainController.kt deleted file mode 100644 index 0a0e3f31b9..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainController.kt +++ /dev/null @@ -1,74 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import com.mogo.module.authorize.authprovider.biz.IMogoAuthorizeController -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler -import com.mogo.module.authorize.model.BaseResponse -import com.mogo.module.authorize.model.bean.AGREEMENT_EFFECT -import com.mogo.module.authorize.model.bean.AGREEMENT_NOT_EFFECT -import com.mogo.module.authorize.model.proxy.toAuthorizeType -import com.mogo.module.authorize.net.request -import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus -import com.mogo.utils.logger.Logger - -object MogoAuthorizeMainController : IMogoAuthorizeController() { - - private val authorizeShowModel: MogoAuthorizeMainModel by lazy { MogoAuthorizeMainModel() } - - @Synchronized - fun agreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - - updateAuthorize(agrId, AGREEMENT_EFFECT, { - authorizeSuccess(tag) - setAuthorizeStatus(tag.toAuthorizeType(), true) - onSuccess.invoke() - }, { - val errorMsg = it ?: "agreeAuthorize failed,please check network" - authorizeFailed(tag, errorMsg) - onError.invoke(errorMsg) - }) - } - - @Synchronized - fun disAgreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - updateAuthorize(agrId, AGREEMENT_NOT_EFFECT, { - authorizeFailed(tag, "UserDisAgree authorize") - onSuccess.invoke() - }, { - val errorMsg = it ?: "disAgreeAuthorize failed,please check network" - authorizeFailed(tag, errorMsg) - onError.invoke(errorMsg) - }) - } - - private fun updateAuthorize(agrId: Long, agreementStatus: Int, onSuccess: (() -> Unit), onError: ((String?) -> Unit)) { - request> { - loader { - authorizeShowModel.updateAuthorize(agrId, agreementStatus) - } - onSuccess { - onSuccess.invoke() - } - onError { - onError.invoke(it.message) - } - } - } - - private fun authorizeFailed(tag: String, errorMsg: String) { - val acquireAuthorizeListener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag) - if (acquireAuthorizeListener != null) { - acquireAuthorizeListener.authorizeFailed(errorMsg) - } else { - Logger.d(TAG, "disAgreeAuthorize --- can not find listener by this tag :$tag ") - } - } - - private fun authorizeSuccess(tag: String) { - val acquireAuthListener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag) - if (acquireAuthListener != null) { - acquireAuthListener.authorizeSuccess() - } else { - Logger.d(TAG, "agreeAuthorize --- can not find listener by this tag :$tag ") - } - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainModel.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainModel.kt deleted file mode 100644 index f24acb8f77..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoAuthorizeMainModel.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import com.google.gson.Gson -import com.mogo.cloud.passport.MoGoAiCloudClientConfig -import com.mogo.module.authorize.model.BaseResponse -import com.mogo.module.authorize.model.IMogoAuthorizeModel -import com.mogo.module.authorize.model.bean.UpdateAuthorize - -class MogoAuthorizeMainModel : IMogoAuthorizeModel() { - - suspend fun updateAuthorize(agrId: Long, agreementStatus: Int): BaseResponse { - val updateAuthorize = Gson().toJson(UpdateAuthorize(agrId, agreementStatus)) - val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to updateAuthorize) - return apiCall { getNetWorkApi().updateAuthorize(map) } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt deleted file mode 100644 index e62a641977..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/launcher/MogoMainAuthorize.kt +++ /dev/null @@ -1,108 +0,0 @@ -package com.mogo.module.authorize.authprovider.launcher - -import android.content.Context -import android.os.Looper -import com.mogo.commons.context.ContextHolderUtil -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN -import com.mogo.module.authorize.layout.AuthorizeDialog -import com.mogo.module.authorize.model.proxy.toAuthorizeType -import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth -import com.mogo.utils.logger.Logger - -class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeMainProvider { - - companion object { - - const val TAG = "MogoMainAuthorize" - - val mogoAuthShow by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { - MogoMainAuthorize() - } - } - - private var mContext: Context? = null - - private var authorizeDialog: AuthorizeDialog? = null - - override fun hasRegister(tag: String): Boolean { - if (tag.isNullOrBlank()) return false - val listener = MogoAuthorizeRegisterHandler.getAuthorizeContentListener(tag) - return listener != null - } - - override fun agreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - MogoAuthorizeMainController.agreeAuthorize(tag, agrId, onSuccess, onError) - } - - override fun disAgreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) { - MogoAuthorizeMainController.disAgreeAuthorize(tag, agrId, onSuccess, onError) - } - - fun initContext(mContext: Context) { - this.mContext = mContext - } - - fun invokeAuthorizeForShow() { - pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN) - } - - fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) { - val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag) - if (listener == null) { - onError.invoke("launcher authorizeShowListener is null,must register in MainActivity") - return - } - if (tag.isNullOrBlank()) { - onError.invoke("tag is null,please invoke with tag") - } - if (Thread.currentThread() != Looper.getMainLooper().thread) { - onError.invoke("invoke should be in main thread") - return - } - if (hasAuth(tag.toAuthorizeType())) { - onError.invoke("already authorize,do not repeat operation") - return - } - Logger.d(TAG, "ready to forbidden voice") - forbiddenVoice.invoke() - Logger.d(TAG, "ready to push fragment") - pushLayoutToMainWindow(tag) - } - - fun hideAuthorizeView() { - if (authorizeDialog != null && authorizeDialog!!.isShowing) { - authorizeDialog?.dismiss() - } - } - - private fun pushLayoutToMainWindow(tag: String) { - if (mContext == null) { - Logger.d(TAG, "Because of mContext has no init, the application has in background now") - return - } - if (authorizeDialog == null) { - authorizeDialog = AuthorizeDialog(tag, ContextHolderUtil.getContext() ?: mContext!!) - authorizeDialog!!.setOnDismissListener { - authorizeDialog = null - } - } - if (authorizeDialog!!.isShowing) { - Logger.d(TAG, "User is operation authorization, do not repeat invoke") - return - } else { - Logger.d(TAG, "pushLayoutToMainWindow") - authorizeDialog!!.show() - } - } - - fun release() { - if (authorizeDialog != null && authorizeDialog!!.isShowing) { - authorizeDialog!!.dismiss() - authorizeDialog = null - } - mContext = null - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IAuthorizeModuleInvoke.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IAuthorizeModuleInvoke.kt deleted file mode 100644 index 6bfb811922..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IAuthorizeModuleInvoke.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeInvoke - -//与Biz业务相同接口实现 -interface IAuthorizeModuleInvoke : IMogoAuthorizeInvoke { -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAcquireAuthorizeListener.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAcquireAuthorizeListener.kt deleted file mode 100644 index 99948178ad..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAcquireAuthorizeListener.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeForbiddenVoice - -interface IMogoAcquireAuthorizeListener : IMogoAuthorizeForbiddenVoice { - - fun authorizeSuccess() - - fun authorizeFailed(errorMsg: String) - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleManager.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleManager.kt deleted file mode 100644 index d33c9f66e5..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleManager.kt +++ /dev/null @@ -1,43 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import com.alibaba.android.arouter.facade.annotation.Route -import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener -import com.mogo.module.authorize.authprovider.module.MogoModuleAuthorize.Companion.mogoAuth - -@Route(path = AuthorizeConstant.PROVIDER_MODULE) -class IMogoAuthorizeModuleManager : IMogoAuthorizeModuleProvider { - - override fun needAuthorize(tag: String): Boolean { - return mogoAuth.needAuthorize(tag) - } - - override fun invokeAuthorizeForShow() { - mogoAuth.invokeAuthorizeForShow() - } - - override fun invokeAuthorization(tag: String) { - mogoAuth.invokeAuthorization(tag) - } - - override fun invokeAuthorizeContent(tag: String) { - mogoAuth.invokeAuthorizeContent(tag) - } - - override fun registerAuthorizeListener(tag: String, listener: IMogoAcquireAuthorizeListener) { - mogoAuth.registerAuthorizeListener(tag, listener) - } - - override fun unregisterAuthorizeListener(tag: String) { - mogoAuth.unregisterAuthorizeListener(tag) - } - - override fun registerInvokeAuthorizeContentListener(tag: String, listener: IMogoAuthorizeContentListener) { - mogoAuth.registerInvokeAuthorizeContentListener(tag, listener) - } - - override fun unregisterInvokeAuthorizeContentListener(tag: String) { - mogoAuth.unregisterInvokeAuthorizeContentListener(tag) - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleProvider.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleProvider.kt deleted file mode 100644 index c85b31190f..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/IMogoAuthorizeModuleProvider.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import android.content.Context -import com.alibaba.android.arouter.facade.template.IProvider -import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeInvoke - -////仅提供给调用业务端(module)使用 -interface IMogoAuthorizeModuleProvider : IProvider, IMogoAuthorizeInvoke { - - override fun init(context: Context) { - - } - - /** - * 用于没有回调且直接调用授权页面展示 仅Launcher主界面业务使用 - */ - fun invokeAuthorizeForShow() - - /** - * 调用授权页面 - */ - fun invokeAuthorization(tag: String) - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoAuthorizeModuleController.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoAuthorizeModuleController.kt deleted file mode 100644 index 2f38af2f7b..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoAuthorizeModuleController.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import com.mogo.module.authorize.authprovider.biz.IMogoAuthorizeController - -object MogoAuthorizeModuleController : IMogoAuthorizeController() { - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoModuleAuthorize.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoModuleAuthorize.kt deleted file mode 100644 index bba7e8463d..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/authprovider/module/MogoModuleAuthorize.kt +++ /dev/null @@ -1,57 +0,0 @@ -package com.mogo.module.authorize.authprovider.module - -import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.commons.AbsMogoApplication -import com.mogo.commons.debug.DebugConfig -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler -import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow -import com.mogo.module.authorize.util.SharedPreferenceUtil -import com.mogo.service.module.IMogoModuleProvider -import com.mogo.utils.logger.Logger - -class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeModuleProvider { - - companion object { - val mogoAuth by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { - MogoModuleAuthorize() - } - } - - override fun invokeAuthorizeForShow() { - mogoAuthShow.invokeAuthorizeForShow() - } - - override fun invokeAuthorization(tag: String) { - if (DebugConfig.isNeedLoadGuideModule()) { - if(!SharedPreferenceUtil.hasGuide()){ - val guideService = ARouter.getInstance().build("/guide/showFragment").navigation() - if(guideService is IMogoModuleProvider){ - guideService.init(AbsMogoApplication.getApp().applicationContext) - } - val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag) - listener?.authorizeFailed("需要先执行用户引导") - return - } - }else{ - Logger.i(TAG,"没有添加Guide模块,无需判断是否引导,准备展示授权") - } - mogoAuthShow.showAuthorizeView(tag, { - //todo SP存储状态 - }, { errorMsg -> - val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag) - listener?.authorizeFailed(errorMsg) - }) - } - - fun forbiddenVoiceWhenAuthorize(cmd: String) { - val tmpMap = MogoAuthorizeRegisterHandler.getAllAuthorizeListener() - if (tmpMap.isEmpty()) { - return - } - tmpMap.forEach { - val acquireListener = it.value - acquireListener.forbiddenVoiceWhenAuthorize(cmd) - } - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/constant/HttpConstant.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/constant/HttpConstant.kt deleted file mode 100644 index 9a61c94ec7..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/constant/HttpConstant.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.mogo.module.authorize.constant - -import com.mogo.commons.debug.DebugConfig - -class HttpConstant { - - companion object { - const val HOST_DEV = "http://dzt-test.zhidaozhixing.com" - const val HOST_TEST = "http://dzt-test.zhidaozhixing.com" - const val HOST_DEMO = "http://dzt-show.zhidaozhixing.com" - const val HOST_PRODUCT = "http://dzt.zhidaozhixing.com" - - fun getNetHost(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV -> HOST_DEV - DebugConfig.NET_MODE_QA -> HOST_TEST - DebugConfig.NET_MODE_DEMO -> HOST_DEMO - else -> HOST_PRODUCT - } - } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/ApiException.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/ApiException.kt deleted file mode 100644 index 1fbac4455c..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/ApiException.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.mogo.module.authorize.exception - - -class ApiException : CommonException { - - companion object { - val NULL_REQUEST_DATA_API_EXCEPTION = ApiException(2, "request data is null") - } - - constructor(code: Int, msg: String) : super(code, msg) - - fun getErrorMsg():String{ - return msg - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/CommonException.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/CommonException.kt deleted file mode 100644 index 927f4819e2..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/exception/CommonException.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.module.authorize.exception - -open class CommonException : Exception { - - companion object { - val NETWORK_EXCEPTION = CommonException(1, "network is error") - val NULL_EXCEPTION = CommonException(1, "error msg is null") - } - - protected var code: Int = 0 - protected var msg: String = "" - - constructor(code: Int, msg: String) : super(msg) { - this.code = code - this.msg = msg - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeController.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeController.kt deleted file mode 100644 index c0fef82e20..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeController.kt +++ /dev/null @@ -1,102 +0,0 @@ -package com.mogo.module.authorize.layout - -import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler -import com.mogo.module.authorize.authprovider.launcher.MogoAuthorizeMainController -import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow -import com.mogo.module.authorize.model.bean.Agreement -import com.mogo.module.authorize.util.DateUtil.parseDateToTime -import com.mogo.module.authorize.util.SharedPreferenceUtil.updateAuthorizeVersion -import com.mogo.utils.logger.Logger - -class AuthorizeController { - - companion object { - const val TAG = "AuthorizeController" - } - - private var invokeTag: String? = null - private var updateTime: Long = 0L - - private constructor() - - constructor(invokeTag: String) { - this.invokeTag = invokeTag - Logger.d(TAG, "onCreate invokeTag:$invokeTag") - } - - fun invokeAuthorizationContent(invokeTag: String, before: () -> Unit, - agreementContent: (id: Long, content: String, title: String, bottomContent: String, lastContent: String) -> Unit, - agreementError: () -> Unit) { - before.invoke() - this.invokeTag = invokeTag - MogoAuthorizeMainController.getAuthorizeContent({ - Logger.d(TAG, "ready to get Authorize Content") - }, { - getContentSuccess(it, agreementContent, agreementError) - }, { msg: String -> - getContentFailed(msg, agreementError) - }) - } - - private fun getContentSuccess(userAgreement: Agreement, - agreementContent: (id: Long, content: String, title: String, bottomContent: String, lastContent: String) -> Unit, - agreementError: () -> Unit) { - Logger.d(TAG, "requestContentSuccess userAgreement:$userAgreement") - if (userAgreement.agreementContent!= null && userAgreement.agreementContent!!.isNotEmpty()) { - val id = userAgreement.tUserAgreementEntity.id - val content = userAgreement.agreementContent!![0] - val title = userAgreement.tUserAgreementEntity.title - val bottomContent = userAgreement.tUserAgreementEntity.agreementButtonFirst - val lastContent = userAgreement.tUserAgreementEntity.agreementButtonSecond - val tmpUpdate = userAgreement.tUserAgreementEntity.updateTime - updateTime = parseDateToTime(tmpUpdate) - Logger.d(TAG, "updateTime ===== $updateTime") - agreementContent.invoke(id, content, title, bottomContent, lastContent) - } else { - agreementError.invoke() - } - } - - private fun getContentFailed(errorMsg: String, agreementError: () -> Unit) { - Logger.d(TAG, "requestContentFailed errorMsg:$errorMsg") - agreementError.invoke() - } - - fun agreeAuthorize(tag: String, agreementId: Long, voiceAuthorizeError: () -> Unit) { - mogoAuthShow.agreeAuthorize(tag, agreementId, { - Logger.d(TAG, "agreeAuthorize success") - updateAuthorizeVersion(updateTime) - closeAuthorizeView() - }, { - Logger.d(TAG, "agreeAuthorize failed") - authorizeFailed(voiceAuthorizeError) - }) - } - - fun disAgreeAuthorize(tag: String, agreementId: Long, voiceAuthorizeError: () -> Unit) { - mogoAuthShow.disAgreeAuthorize(tag, agreementId, { - authorizeFailed(voiceAuthorizeError) - }, { - authorizeFailed(voiceAuthorizeError) - }) - } - - private inline fun authorizeFailed(voiceAuthorizeError: () -> Unit) { - voiceAuthorizeError.invoke() - closeAuthorizeView() - } - - private fun closeAuthorizeView() { - invokeTag = null - mogoAuthShow.hideAuthorizeView() - } - - fun onDestroy() { - Logger.d(TAG, "onDestroy invokeTag : $invokeTag") - invokeTag?.let { - MogoAuthorizeRegisterHandler.getAuthorizeContentListener(it)?.requestContentFailed("user exit authorize --- onDestroy") - MogoAuthorizeRegisterHandler.getAuthorizeListener(it)?.authorizeFailed("user exit authorize --- onDestroy") - } - mogoAuthShow.hideAuthorizeView() - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt deleted file mode 100644 index 0d4654de5a..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/layout/AuthorizeDialog.kt +++ /dev/null @@ -1,214 +0,0 @@ -package com.mogo.module.authorize.layout - -import android.content.Context -import android.text.Html -import android.view.View -import android.widget.Button -import android.widget.TextView -import androidx.constraintlayout.widget.ConstraintLayout -import com.mogo.commons.AbsMogoApplication -import com.mogo.commons.debug.DebugConfig -import com.mogo.module.authorize.R -import com.mogo.module.authorize.util.AnalyticsUtil -import com.mogo.module.authorize.util.HtmlUtil -import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener -import com.mogo.module.authorize.voice.IVoiceCommandListener -import com.mogo.module.authorize.voice.VoiceUtil -import com.mogo.module.common.dialog.BaseFloatDialog -import com.mogo.module.common.utils.CarSeries -import com.mogo.utils.TipToast -import com.mogo.utils.logger.Logger -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.async -import kotlinx.coroutines.withContext - -class AuthorizeDialog(invokeTag: String, context: Context) : BaseFloatDialog(context), - View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener { - - companion object { - const val TAG = "AuthorizeDialog" - } - - private var mContext: Context? = context - private var invokeTag: String? = invokeTag - - private var agreementId: Long = 0L - - private var clTopParent: ConstraintLayout? = null - private var clErrorContainer: ConstraintLayout? = null - private var clLoadAuthorizeContainer: ConstraintLayout? = null - private var clContainer: ConstraintLayout? = null - private var clAuthorizeLoading: ConstraintLayout? = null - private var btnAgree: Button? = null - private var btnDisAgree: Button? = null - private var btnLoadingError: Button? = null - private var tvTitle: TextView? = null - private var tvContent: TextView? = null - private var tvButtonContent: TextView? = null - private var tvLastContent: TextView? = null - - private var authorizeController: AuthorizeController? = null - - init { - initView() - } - - private fun initView() { - setContentView(R.layout.module_authorize_fragment) - setWrapContent() - initViews() - } - - private fun setWrapContent() { - val mWindow = window - mWindow?.let { - if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) { - if (CarSeries.isF8xxSeries()) { - val lp = it.attributes - lp.width = 1920 - lp.height = 1080 - it.attributes = lp - } else { - val lp = it.attributes - lp.width = 1024 - lp.height = 600 - it.attributes = lp - } - } else { - val lp = it.attributes - lp.width = 1920 - lp.height = 1000 - it.attributes = lp - } - } - } - - private fun initViews() { - Logger.d(TAG, "initView ") - AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW) - init() - Logger.d(TAG, "invokeTag :$invokeTag") - authorizeController = AuthorizeController(invokeTag!!) - invokeAuthorizationContent() - VoiceUtil.registerAll(this, this) - } - - private fun init() { - clTopParent = findViewById(R.id.clAuthorizeTopParent) - clErrorContainer = findViewById(R.id.clLoadingErrorContainer) - clLoadAuthorizeContainer = findViewById(R.id.clLoadingAuthorizeContainer) - clContainer = findViewById(R.id.clAuthorizeContainer) - clAuthorizeLoading = findViewById(R.id.clAuthorizeLoading) - btnAgree = findViewById(R.id.btnAuthorizeAgree) - btnDisAgree = findViewById(R.id.btnAuthorizeDisAgree) - btnLoadingError = findViewById(R.id.btnAuthorizeLoadingError) - tvTitle = findViewById(R.id.tvAuthorizeTitle) - tvContent = findViewById(R.id.tvAuthorizeContent) - tvButtonContent = findViewById(R.id.tvAuthorizeButtonContent) - tvLastContent = findViewById(R.id.tvAuthorizeLastContent) - btnAgree?.setOnClickListener(this) - btnDisAgree?.setOnClickListener(this) - btnLoadingError?.setOnClickListener(this) - clTopParent?.setOnClickListener(this) - clContainer?.setOnClickListener(this) - clErrorContainer?.setOnClickListener(this) - clLoadAuthorizeContainer?.setOnClickListener(this) - clAuthorizeLoading?.setOnClickListener(this) - } - - private fun readyToAuthorize() { - clErrorContainer?.visibility = View.GONE - clLoadAuthorizeContainer?.visibility = View.VISIBLE - } - - private fun showAuthorizationAgreementContent( - agreementId: Long, - agreementContent: String, - agreementTitle: String, - agreementBottom: String, - agreementLast: String) { - VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.resources.getString(R.string.module_authorize_agreement_tip), AbsMogoApplication.getApp().applicationContext, this) - this.agreementId = agreementId - clLoadAuthorizeContainer?.visibility = View.GONE - clContainer?.visibility = View.VISIBLE - tvTitle?.text = HtmlUtil.getSpanned(agreementTitle) - GlobalScope.async(Dispatchers.IO) { - val spannable = HtmlUtil.getSpanned(agreementContent) - withContext(Dispatchers.Main) { - tvContent?.text = spannable - } - } - tvButtonContent?.text = HtmlUtil.getSpanned(agreementBottom) - tvLastContent?.text = HtmlUtil.getSpanned(agreementLast) - } - - private fun showAuthorizationError() { - clLoadAuthorizeContainer?.visibility = View.GONE - clErrorContainer?.visibility = View.VISIBLE - } - - private fun voiceAuthorizeError() { - TipToast.shortTip("授权失败,请稍后重试") - VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this) - Logger.d(TAG, "onDestroy") - VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this) - } - - override fun onClick(v: View) { - when (v.id) { - R.id.btnAuthorizeAgree -> { - AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 1)) - agreeAuthorize() - } - R.id.btnAuthorizeDisAgree -> { - AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 2)) - disAgreeAuthorize() - } - R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> { - invokeAuthorizationContent() - } - R.id.clAuthorizeTopParent -> { - Logger.i(TAG, "dismiss authorizeView") - authorizeController?.onDestroy() - } - } - } - - override fun onVoiceCmdAgree() { - AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 1)) - agreeAuthorize() - } - - override fun onVoiceCmdDisAgree() { - AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 2)) - disAgreeAuthorize() - } - - private fun agreeAuthorize() { - authorizeController?.agreeAuthorize(invokeTag!!, agreementId) { - voiceAuthorizeError() - } - } - - private fun disAgreeAuthorize() { - authorizeController?.disAgreeAuthorize(invokeTag!!, agreementId) { - voiceAuthorizeError() - } - } - - private fun invokeAuthorizationContent() { - authorizeController?.invokeAuthorizationContent(invokeTag!!, { - readyToAuthorize() - }, { id: Long, content: String, title: String, bottomContent: String, lastContent: String -> - showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent) - }, { - showAuthorizationError() - }) - } - - override fun dismiss() { - super.dismiss() - mContext = null - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseRepository.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseRepository.kt deleted file mode 100644 index 8e216d70df..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseRepository.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.mogo.module.authorize.model - -import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.module.authorize.net.AuthorizeApi -import com.mogo.module.common.constants.HostConst -import com.mogo.service.IMogoServiceApis -import com.mogo.eagle.core.data.constants.MogoServicePaths - -open class BaseRepository { - - suspend fun apiCall(call: suspend () -> BaseResponse): BaseResponse { - return call.invoke() - } - - fun getNetWorkApi(): AuthorizeApi { - var serviceApi: IMogoServiceApis? = null - val mogoService = ARouter.getInstance().build(com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_SERVICE_APIS).navigation() - if (mogoService is IMogoServiceApis) { - serviceApi = mogoService - } - return serviceApi!!.networkApi.createNoCallAdapter(AuthorizeApi::class.java, HostConst.CHANNEL_MANAGER_HOST) - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseResponse.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseResponse.kt deleted file mode 100644 index 963747434a..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/BaseResponse.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.mogo.module.authorize.model - - -class BaseResponse(val code: Int, val msg: String, val detailMsg: String, val result: T) { - -} diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/IMogoAuthorizeModel.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/IMogoAuthorizeModel.kt deleted file mode 100644 index d3cd96a4b9..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/IMogoAuthorizeModel.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.module.authorize.model - -import com.google.gson.Gson -import com.mogo.cloud.passport.MoGoAiCloudClientConfig -import com.mogo.module.authorize.model.bean.AgreementData -import com.mogo.module.authorize.model.bean.AgreementStatus -import com.mogo.module.authorize.model.bean.RequestUserAgreement - -open class IMogoAuthorizeModel : BaseRepository() { - - companion object { - const val TAG = "IMogoAuthorizeModel" - } - - suspend fun invokeAuthorizeContent(agreementType: Int, needContent: Boolean = false): BaseResponse { - val requestUserAgreement = Gson().toJson(RequestUserAgreement(agreementType, needContent)) - val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to requestUserAgreement) - return apiCall { getNetWorkApi().getAuthorizeContent(map) } - } - - suspend fun invokeIfNeedAuthorize(agreementType: Int): BaseResponse { - val requestUserAgreement = Gson().toJson(RequestUserAgreement(agreementType)) - val map = mapOf("sn" to MoGoAiCloudClientConfig.getInstance().sn, "data" to requestUserAgreement) - return apiCall { getNetWorkApi().checkIfNeedAuthorize(map) } - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/Agreement.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/Agreement.kt deleted file mode 100644 index 11c0443050..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/Agreement.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.mogo.module.authorize.model.bean - -const val AGREEMENT_EFFECT = 1 //用户协议生效 -const val AGREEMENT_NOT_EFFECT = 2 //用户协议不生效 - -class RequestUserAgreement{ - var agreementType:Int - var want:Boolean = false - - constructor(agreementType:Int){ - this.agreementType = agreementType - } - - constructor(agreementType: Int, want: Boolean) { - this.agreementType = agreementType - this.want = want - } -} - -data class AgreementStatus(val agreementStatus:Int) - -data class AgreementData(val agreement: Agreement) - -data class Agreement(var tUserAgreementEntity: TUserAgreementEntity, var agreementContent: List?) - -data class TUserAgreementEntity( - val id: Long, //协议ID - val title: String, //标题 - val subhead: String, //副标题 - val agreementButtonFirst: String, //底部标题1 - val agreementButtonSecond: String, //底部标题2 - val agreementType: Int, //协议类型 - val agreementVersion: String, //协议版本 - val agreementUserType: String, //协议适用用户 - val agreementStatus: Int, //协议状态 1:生效 2:未生效 - val createTime: String, //协议创建时间 - val updateTime: String) //协议更新时间 diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/UpdateAuthorize.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/UpdateAuthorize.kt deleted file mode 100644 index 305be207a8..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/bean/UpdateAuthorize.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.mogo.module.authorize.model.bean - -class UpdateAuthorize { - var agrId: Long - var status: Int - - constructor(agrId: Long, status: Int) { - this.agrId = agrId - this.status = status - } - - override fun toString(): String { - return "UpdateAuthorize(agrId=$agrId, status=$status)" - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/AuthorizeProxy.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/AuthorizeProxy.kt deleted file mode 100644 index 093b4b20e8..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/AuthorizeProxy.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.mogo.module.authorize.model.proxy - -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_AUXILIARY_DRIVING -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_CALL_CHAT -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_SHARE -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_NOVELTY -import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_TAN_LU - - -fun String.toAuthorizeType(): Int { - return AuthorizeProxy.getAuthorizeType(this) -} - -class AuthorizeProxy { - - companion object { - - const val TAG = "AuthorizeProxy" - - fun getAuthorizeType(authorizeName: String): Int { - if (authorizeName.isNullOrBlank()) { - return -1 - } - return when (authorizeName) { - AUTHORIZE_TYPE_LAUNCHER_MAIN, - AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY, - AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC, - AUTHORIZE_TYPE_LAUNCHER_SHARE -> 0 - AUTHORIZE_TYPE_TAN_LU -> 1 - AUTHORIZE_TYPE_CALL_CHAT -> 2 - AUTHORIZE_TYPE_NOVELTY -> 3 - AUTHORIZE_TYPE_AUXILIARY_DRIVING -> 4 - else -> -1 - } - } - } - - enum class AuthorizeEnum : IAuthorizeOperation { - LAUNCHER_MAIN(0, AUTHORIZE_TYPE_LAUNCHER_MAIN), - LAUNCHER_SHARE_NOVELTY(0, AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY), - LAUNCHER_SHARE_MUSIC(0, AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC), - LAUNCHER_SHARE(0, AUTHORIZE_TYPE_LAUNCHER_SHARE), - CALL_CHAT(1, AUTHORIZE_TYPE_TAN_LU), - TANLU(2, AUTHORIZE_TYPE_CALL_CHAT), - NOVELTY(3, AUTHORIZE_TYPE_NOVELTY), - AUXILIARY_DRIVING(4, AUTHORIZE_TYPE_AUXILIARY_DRIVING); - - private var authorizeType = 0 - private var authorizeName: String? = null - - constructor(authorizeType: Int, authorizeName: String?) { - this.authorizeType = authorizeType - this.authorizeName = authorizeName - } - - override fun getOperationName(): String? { - return authorizeName - } - - override fun getAcquireId(): Int { - return authorizeType - } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/IAuthorizeOperation.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/IAuthorizeOperation.kt deleted file mode 100644 index 952246213b..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/model/proxy/IAuthorizeOperation.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.module.authorize.model.proxy - -interface IAuthorizeOperation { - - fun getOperationName(): String? - - fun getAcquireId(): Int -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/AuthorizeApi.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/AuthorizeApi.kt deleted file mode 100644 index 71163940dd..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/AuthorizeApi.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.mogo.module.authorize.net - -import com.mogo.module.authorize.model.BaseResponse -import com.mogo.module.authorize.model.bean.AgreementData -import com.mogo.module.authorize.model.bean.AgreementStatus -import retrofit2.http.FieldMap -import retrofit2.http.FormUrlEncoded -import retrofit2.http.POST - -interface AuthorizeApi { - - //获取授权内容· - @FormUrlEncoded - @POST("yycp-channelManager/agreement/findUserAgreement") - suspend fun getAuthorizeContent(@FieldMap authorizeContent: Map): BaseResponse - - //更新授权状态 - @FormUrlEncoded - @POST("yycp-channelManager/agreement/updateStatus") - suspend fun updateAuthorize(@FieldMap updateStatus: Map): BaseResponse - - //查询是否要授权 - @FormUrlEncoded - @POST("yycp-channelManager/agreement/queryUserAuthorizeStatusByType") - suspend fun checkIfNeedAuthorize(@FieldMap needAuthorize: Map): BaseResponse - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/CoroutineDSL.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/CoroutineDSL.kt deleted file mode 100644 index c74c2e36b9..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/net/CoroutineDSL.kt +++ /dev/null @@ -1,84 +0,0 @@ -package com.mogo.module.authorize.net - -import com.mogo.module.authorize.exception.ApiException -import com.mogo.module.authorize.exception.ApiException.Companion.NULL_REQUEST_DATA_API_EXCEPTION -import com.mogo.module.authorize.exception.CommonException.Companion.NETWORK_EXCEPTION -import com.mogo.module.authorize.exception.CommonException.Companion.NULL_EXCEPTION -import com.mogo.module.authorize.model.BaseResponse -import kotlinx.coroutines.* -import java.net.SocketTimeoutException -import java.net.UnknownHostException -import java.util.concurrent.TimeoutException - -class Request { - private lateinit var loader: suspend () -> T - - private var start: (() -> Unit)? = null - - private var onSuccess: ((T) -> Unit)? = null - - private var onError: ((java.lang.Exception) -> Unit)? = null - - private var onComplete: (() -> Unit)? = null - - infix fun loader(loader: suspend () -> T) { - this.loader = loader - } - - infix fun start(start: (() -> Unit)?) { - this.start = start - } - - infix fun onSuccess(onSuccess: ((T) -> Unit)?) { - this.onSuccess = onSuccess - } - - infix fun onError(onError: ((java.lang.Exception) -> Unit)?) { - this.onError = onError - } - - infix fun onComplete(onComplete: (() -> Unit)?) { - this.onComplete = onComplete - } - - fun request() { - - GlobalScope.launch(context = Dispatchers.Main) { - - start?.invoke() - try { - val deferred = GlobalScope.async(Dispatchers.IO, start = CoroutineStart.LAZY) { - loader() - } - val result = deferred.await() - if (result != null && result is BaseResponse<*>) { - if (result.code == 0) { - onSuccess?.invoke(result) - } else { - throw ApiException(result.code, result.msg) - } - } else { - throw NULL_REQUEST_DATA_API_EXCEPTION - } - } catch (e: Exception) { - e.printStackTrace() - if (e.message == null) { - onError?.invoke(NULL_EXCEPTION) - return@launch - } - when (e) { - is UnknownHostException -> onError?.invoke(NETWORK_EXCEPTION) - is TimeoutException -> onError?.invoke(NETWORK_EXCEPTION) - is SocketTimeoutException -> onError?.invoke(NETWORK_EXCEPTION) - else -> onError?.invoke(java.lang.Exception(e.message ?: "")) - } - } finally { - onComplete?.invoke() - } - } - } -} - -inline fun request(buildRequest: Request.() -> Unit) { - Request().apply(buildRequest).request() -} diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/AnalyticsUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/AnalyticsUtil.kt deleted file mode 100644 index 00a7d0194b..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/AnalyticsUtil.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.module.authorize.util - -import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.service.IMogoServiceApis -import com.mogo.eagle.core.data.constants.MogoServicePaths -import com.mogo.service.analytics.IMogoAnalytics - -object AnalyticsUtil { - - const val INVOKE_TRACK_AUTHORIZE_SHOW = "Launcher_Privacy_protocol_Show" - const val INVOKE_TRACK_AUTHORIZE_CLICK = "Launcher_Privacy_protocol_click" - - private var trackRouter: IMogoAnalytics? = null - - fun track(eventType: String, data: MutableMap? = hashMapOf()) { - if (trackRouter == null) { - val arouter = ARouter.getInstance().build(com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_SERVICE_APIS).navigation() - if (arouter is IMogoServiceApis) { - trackRouter = arouter.analyticsApi - } - } - trackRouter!!.track(eventType, data) - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DateUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DateUtil.kt deleted file mode 100644 index 87c05a7ac5..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/DateUtil.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.mogo.module.authorize.util - -import java.util.* - -object DateUtil { - - @Suppress("DEPRECATION") - fun parseDateToTime(tmpDate: String): Long { - val time = Date(tmpDate) - return time.time - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/HtmlUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/HtmlUtil.kt deleted file mode 100644 index e714a1e97d..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/HtmlUtil.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.mogo.module.authorize.util - -import android.os.Build -import android.text.Html -import android.text.Spanned - -class HtmlUtil { - - companion object{ - fun getSpanned(content: String): Spanned { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY) - } else { - @Suppress("DEPRECATION") - Html.fromHtml(content) - } - } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/SharedPreferenceUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/SharedPreferenceUtil.kt deleted file mode 100644 index 9262e0184b..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/util/SharedPreferenceUtil.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.mogo.module.authorize.util - -import com.mogo.commons.AbsMogoApplication -import com.mogo.module.common.utils.SPConst.getSpGuide -import com.mogo.utils.storage.SharedPrefsMgr - -object SharedPreferenceUtil { - - private const val HAS_AUTH = "HAS_AUTH" - private const val AUTHORIZE_UPDATE_TIME = "AUTHORIZE_UPDATE_TIME" - - fun needAuthorization(type: Int): Boolean { - return !hasAuth(type) - } - - fun hasAuth(type: Int): Boolean { - return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_AUTH + type, false) - } - - fun setAuthorizeStatus(type: Int, authorize: Boolean) { - SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putBoolean(HAS_AUTH + type, authorize) - } - - fun updateAuthorizeVersion(updateTime: Long) { - SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putLong(AUTHORIZE_UPDATE_TIME, updateTime) - } - - fun getAuthorizeVersion(): Long { - return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getLong(AUTHORIZE_UPDATE_TIME, 0L) - } - - fun hasGuide(): Boolean { - return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false) - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceAuthorizeIntentListener.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceAuthorizeIntentListener.kt deleted file mode 100644 index 6199f36637..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceAuthorizeIntentListener.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.module.authorize.voice - -import android.content.Intent -import com.mogo.service.intent.IMogoIntentListener -import com.mogo.utils.logger.Logger - -private const val IVoiceIntentTAG = "IVoiceAuthorizeIntentListener" - -interface IVoiceAuthorizeIntentListener : IMogoIntentListener, IVoiceBusinessListener { - - override fun onIntentReceived(cmd: String?, intent: Intent?) { - Logger.i(IVoiceIntentTAG, "cmd -> $cmd") - if (intent != null && cmd != null) { - VoiceManager.handleOnIntentCmd(cmd,this) - } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceBusinessListener.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceBusinessListener.kt deleted file mode 100644 index b9792d1126..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceBusinessListener.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.module.authorize.voice - -interface IVoiceBusinessListener { - - fun onVoiceCmdAgree() - - fun onVoiceCmdDisAgree() -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceCommandListener.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceCommandListener.kt deleted file mode 100644 index bf50a36ae6..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/IVoiceCommandListener.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.mogo.module.authorize.voice - -import com.mogo.commons.voice.IMogoVoiceCmdCallBack -import com.mogo.utils.logger.Logger - -private const val IVoiceCommandTAG = "IVoiceCommandTAG" - -interface IVoiceCommandListener : IMogoVoiceCmdCallBack, IVoiceBusinessListener { - - override fun onCmdSelected(cmd: String?) { - Logger.i( - IVoiceCommandTAG, "onCmdSelected cmd:${cmd ?: "cmd is null"}" - ) - cmd?.let { - VoiceManager.handleOnCmdSelected(cmd, this) - } - } - - override fun onCmdAction(speakText: String?) { - - } - - override fun onCmdCancel(speakText: String?) { - - } - - override fun onSpeakSelectTimeOut(speakText: String?) { - - } - - override fun onSpeakEnd(speakText: String?) { - Logger.i(IVoiceCommandTAG, "onSpeakEnd --- speakText : $speakText") - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceManager.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceManager.kt deleted file mode 100644 index 90438ff580..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceManager.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.mogo.module.authorize.voice - -import android.content.Intent -import com.mogo.module.authorize.voice.VoiceUtil.VOICE_INTENT_AGREE -import com.mogo.module.authorize.voice.VoiceUtil.VOICE_INTENT_DISAGREE -import com.mogo.module.authorize.voice.VoiceUtil.VOICE_REGISTER_AUTHORIZE_AGREE -import com.mogo.module.authorize.voice.VoiceUtil.VOICE_REGISTER_AUTHORIZE_DISAGREE -import com.mogo.utils.logger.Logger - -object VoiceManager { - - private const val TAG = "VoiceManager" - - fun handleOnCmdSelected(cmd: String, listener: IVoiceCommandListener) { - Logger.i(TAG, "handleOnCmdSelected: cmd ---> $cmd") - when (cmd) { - VOICE_REGISTER_AUTHORIZE_AGREE -> { - Logger.i(TAG, "语音免唤醒 同意") - listener.onVoiceCmdAgree() - } - VOICE_REGISTER_AUTHORIZE_DISAGREE -> { - Logger.i(TAG, "语音免唤醒 不同意") - listener.onVoiceCmdDisAgree() - } - } - } - - fun handleOnIntentCmd(cmd: String, listener: IVoiceAuthorizeIntentListener) { - Logger.i(TAG, "handleOnIntentCmd: cmd -> $cmd") - when (cmd) { - VOICE_INTENT_AGREE -> { - Logger.i(TAG, "语音唤醒 同意") - listener.onVoiceCmdAgree() - } - VOICE_INTENT_DISAGREE -> { - Logger.i(TAG, "语音唤醒 不同意") - listener.onVoiceCmdDisAgree() - } - } - } - -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceUtil.kt b/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceUtil.kt deleted file mode 100644 index cd8fb4af32..0000000000 --- a/modules/mogo-module-authorize/src/main/java/com/mogo/module/authorize/voice/VoiceUtil.kt +++ /dev/null @@ -1,93 +0,0 @@ -package com.mogo.module.authorize.voice - -import android.content.Context -import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.commons.AbsMogoApplication -import com.mogo.commons.voice.AIAssist -import com.mogo.service.IMogoServiceApis -import com.mogo.eagle.core.data.constants.MogoServicePaths -import com.mogo.service.intent.IMogoIntentManager -import com.mogo.utils.logger.Logger - -object VoiceUtil { - - private const val TAG = "VoiceUtil" - private var intentRegister: IMogoIntentManager? = null - - init { - Logger.i(TAG, "init") - val register = - ARouter.getInstance().build(com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_SERVICE_APIS).navigation() - if (register is IMogoServiceApis) { - intentRegister = register.intentManagerApi - } - } - - //WakeUp Command (Intent) - const val VOICE_INTENT_AGREE = "com.zhidao.agree" //同意 - const val VOICE_INTENT_DISAGREE = "com.zhiao.disagree" //不同意 - - //unWakeUp Command - const val VOICE_REGISTER_AUTHORIZE_AGREE = "CMD_AUTHORIZATION_AGREE" - private val agreeArray: Array = arrayOf("同意", "调整", "好的") - const val VOICE_REGISTER_AUTHORIZE_DISAGREE = "CMD_AUTHORIZATION_DISAGREE" - private val disAgreeArray: Array = arrayOf("不同意", "不调整") - - private var hasRegister = false - - fun speak(content: String, context: Context, listener: IVoiceCommandListener) { - AIAssist.getInstance(context).speakTTSVoice(content, listener) - } - - fun registerAll( - voiceCommand: IVoiceCommandListener, - intentCommand: IVoiceAuthorizeIntentListener, context: Context = AbsMogoApplication.getApp().applicationContext - ) { - if (!hasRegister) { - hasRegister = true - registerAgree(context, voiceCommand, intentCommand) - registerDisAgree(context, voiceCommand, intentCommand) - } - } - - private fun registerAgree( - context: Context, - voiceCommand: IVoiceCommandListener, - intentCommand: IVoiceAuthorizeIntentListener - ) { - Logger.i(TAG, "registerAgree") - AIAssist.getInstance(context) - .registerUnWakeupCommand( - VOICE_REGISTER_AUTHORIZE_AGREE, - agreeArray, voiceCommand - ) - intentRegister?.registerIntentListener(VOICE_INTENT_AGREE, intentCommand) - } - - private fun registerDisAgree( - context: Context, - voiceCommand: IVoiceCommandListener, - intentCommand: IVoiceAuthorizeIntentListener - ) { - Logger.i(TAG, "registerDisAgree") - AIAssist.getInstance(context) - .registerUnWakeupCommand( - VOICE_REGISTER_AUTHORIZE_DISAGREE, - disAgreeArray, voiceCommand - ) - intentRegister?.registerIntentListener(VOICE_INTENT_DISAGREE, intentCommand) - } - - fun unregisterAll(context: Context, listener: IVoiceAuthorizeIntentListener) { - Logger.i(TAG, "unregister All") - AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_AGREE) - AIAssist.getInstance(context).unregisterUnWakeupCommand(VOICE_REGISTER_AUTHORIZE_DISAGREE) - hasRegister = false - - Logger.i(TAG, "unregister IntentVoiceCommand --- intentRegister:$intentRegister") - intentRegister?.let { - it.unregisterIntentListener(VOICE_INTENT_AGREE, listener) - it.unregisterIntentListener(VOICE_INTENT_DISAGREE, listener) - } - } -} \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml deleted file mode 100644 index 93b269154a..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml deleted file mode 100644 index 9d0ac5061d..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_blue_left_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml deleted file mode 100644 index e9cb674da9..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_corner.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml deleted file mode 100644 index 086f0e93fa..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1000/module_authorize_selector_dark_right_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_corner.xml deleted file mode 100644 index 63144dcf3c..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_left_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_left_corner.xml deleted file mode 100644 index 9d0ac5061d..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_blue_left_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_corner.xml deleted file mode 100644 index e9cb674da9..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_corner.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_right_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_right_corner.xml deleted file mode 100644 index 086f0e93fa..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_selector_dark_right_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_shape_top_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_shape_top_corner.xml deleted file mode 100644 index 47a3428433..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable-xhdpi-1920x1080/module_authorize_shape_top_corner.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_scrollbar.png b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_scrollbar.png deleted file mode 100644 index 1bb3d4882d..0000000000 Binary files a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_scrollbar.png and /dev/null differ diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_corner.xml deleted file mode 100644 index 63144dcf3c..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_left_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_left_corner.xml deleted file mode 100644 index 536fc2c742..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_blue_left_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_corner.xml deleted file mode 100644 index c366e79eea..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_corner.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_right_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_right_corner.xml deleted file mode 100644 index d866721b3b..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_selector_dark_right_corner.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_shape_top_corner.xml b/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_shape_top_corner.xml deleted file mode 100644 index 47e186f1e7..0000000000 --- a/modules/mogo-module-authorize/src/main/res/drawable/module_authorize_shape_top_corner.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml b/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml deleted file mode 100644 index e3a16367f6..0000000000 --- a/modules/mogo-module-authorize/src/main/res/layout-xhdpi-1920x1000/module_authorize_fragment.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - -