diff --git a/.idea/misc.xml b/.idea/misc.xml index b94f4d0967..2ea71aea8b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,11 +1,11 @@ - + + diff --git a/gradle.properties b/gradle.properties index 8c5d7dbf54..dad99f6274 100644 --- a/gradle.properties +++ b/gradle.properties @@ -60,11 +60,11 @@ MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.5 ## 工程外部模块 # 探路 -MOGO_MODULE_TANLU_VERSION=1.1.0.1-SNAPSHOT +MOGO_MODULE_TANLU_VERSION=1.2.1.1 # 车聊聊 -CARCHATTING_VERSION=1.0.6 +CARCHATTING_VERSION=1.0.7 # 车聊聊接口 -CARCHATTINGPROVIDER_VERSION=1.0.6 +CARCHATTINGPROVIDER_VERSION=1.0.7 # 视频引导 MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT # 视频引导接口 @@ -72,13 +72,13 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT # 在线车辆F MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2 # v2x -MOGO_MODULE_V2X_VERSION=1.1.24 +MOGO_MODULE_V2X_VERSION=1.1.25 # 推送 MOGO_MODULE_PUSH_VERSION=1.0.1 # 广告资源位 MOGO_MODULE_AD_CARD_VERSION=1.0.1 # 探路上报和分享模块 -TANLULIB_VERSION=1.0.2-SNAPSHOT +TANLULIB_VERSION=1.2.1.1 ## 产品库必备配置 applicationId=com.mogo.launcer diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 9ae47cfe5a..58a6e726ad 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -27,7 +27,9 @@ import com.mogo.map.uicontroller.MapCameraPosition; import com.mogo.map.uicontroller.MapControlResult; import com.mogo.utils.logger.Logger; import com.zhidaoauto.map.sdk.inner.common.MapHelper; +import com.zhidaoauto.map.sdk.open.MapAutoApi; import com.zhidaoauto.map.sdk.open.MapParams; +import com.zhidaoauto.map.sdk.open.abs.MapStatusListener; import com.zhidaoauto.map.sdk.open.abs.OnMapClickListener; import com.zhidaoauto.map.sdk.open.abs.OnMapLoadedListener; import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener; @@ -47,7 +49,7 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, LocationListener, OnMapLoadedListener, +public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, LocationListener, OnMapLoadedListener, MapStatusListener, OnMapClickListener, OnMapTouchListener, Marker.OnMarkClickListener { private static final String TAG = "AMapViewWrapper"; @@ -58,8 +60,9 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca private EnumMapUI mCurrentUIMode; private boolean mIsCarLocked = false; + private int mLockZoom = 14; - private float mDefaultZoomLevel = 7.0f; + private float mDefaultZoomLevel = 14.0f; private final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder() .carCursorRes(R.drawable.map_api_ic_current_location2) .naviCursorRes(R.drawable.ic_amap_navi_cursor) @@ -147,6 +150,9 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca mMapView.setOnMapTouchListener(this); mMapView.setOnMapClickListener(this); mMapView.getLocationClient().registerListener(this); + mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ZOOM); + mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ROTATE); + mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_3D); // mMapView.setOnPolylineClickListener( this ); // mMapView.setAMapNaviViewListener( this ); @@ -224,45 +230,10 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca } - - /** - * 地图marker点击 - */ -// @Override -// public boolean onMarkerClick( Marker marker ) { -// return mMarkerClickHandler.handleMarkerClicked( marker ); -// } -// -// /** -// * 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 (checkAMapView()) { -// mMapView.setTrafficLine( visible ); + mMapView.getMapAutoViewHelper().setTraffic(visible); } } @@ -292,7 +263,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca mDefaultZoomLevel = 0; } } - changeZoom((int) mDefaultZoomLevel); + changeZoom(mDefaultZoomLevel); } return MapControlResult.SUCCESS; } @@ -434,7 +405,8 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca // if ( DebugConfig.isDebug() ) { // Logger.d( TAG, Log.getStackTraceString( new Throwable() ) ); // } - Logger.d(TAG, "锁车"); + Log.d(TAG, "锁车"); + mMapView.getMapAutoViewHelper().setZoom(mLockZoom/2); mMapView.getMapAutoViewHelper().setLockMode(true); mIsCarLocked = true; } @@ -445,14 +417,14 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca if (DebugConfig.isDebug()) { Logger.d(TAG, Log.getStackTraceString(new Throwable())); } - Logger.d(TAG, "解锁锁车"); + Log.d(TAG, "解锁锁车"); mMapView.getMapAutoViewHelper().setLockMode(false); mIsCarLocked = false; } @Override public void setLockZoom(int var1) { - + mLockZoom = var1; } @Override @@ -474,7 +446,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca @Override public MogoLatLng getCameraNorthEastPosition() { - return null; + return ObjectUtils.fromAMap( MapTools.INSTANCE.getVisibleRegion().getRightTopPoint()); } @@ -722,4 +694,9 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca public void onRoadLoaded(@Nullable String s) { } + + @Override + public void onMapStatusChanged(int type, int value) { + Log.i(TAG, "onMapStatusChanged: "+type+","+value); + } } diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapWrapper.java index 78761ccbaa..b91b99fe09 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapWrapper.java @@ -171,7 +171,6 @@ public class AMapWrapper implements IMogoMap { @Override public void setTouchPoiEnable(boolean touchPoiEnable) { if (checkAMap()) { - // TODO: 2020/5/27 jia 设置 mAMap.setTouchPoiEnable( touchPoiEnable ); } } @@ -224,7 +223,7 @@ public class AMapWrapper implements IMogoMap { @Override public void changeZoom(float zoom) { if (checkAMap()) { - mAMap.setZoom((int) zoom); + mAMap.setZoom((int) zoom/2); } } @@ -232,7 +231,7 @@ public class AMapWrapper implements IMogoMap { public float getZoomLevel() { if (checkAMap()) { try { - return mAMap.getZoom(); + return mAMap.getZoom()*2; } catch (Exception e) { } diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java index 96a612153c..a98ac0e07f 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/uicontroller/AMapUIController.java @@ -175,7 +175,7 @@ public class AMapUIController implements IMogoMapUIController { @Override public void setPointToCenter(double mapCenterX, double mapCenterY) { if (mClient != null) { -// mClient.setPointToCenter(mapCenterX, mapCenterY); + mClient.setPointToCenter(mapCenterX, mapCenterY); } } diff --git a/modules/mogo-module-authorize/src/main/res/layout/module_authorize_fragment.xml b/modules/mogo-module-authorize/src/main/res/layout/module_authorize_fragment.xml index 5e5992f151..c8b7f7aa56 100644 --- a/modules/mogo-module-authorize/src/main/res/layout/module_authorize_fragment.xml +++ b/modules/mogo-module-authorize/src/main/res/layout/module_authorize_fragment.xml @@ -151,6 +151,8 @@ android:layout_height="0px" android:layout_marginBottom="@dimen/dp_160" android:scrollbarSize="@dimen/dp_207" + android:layout_marginTop="@dimen/dp_54" + android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar" android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" diff --git a/modules/mogo-module-extensions/src/main/res/drawable/module_map_ic_move2_current_location.png b/modules/mogo-module-extensions/src/main/res/drawable/module_map_ic_move2_current_location.png deleted file mode 100644 index c1183aff8d..0000000000 Binary files a/modules/mogo-module-extensions/src/main/res/drawable/module_map_ic_move2_current_location.png and /dev/null differ diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java index 9416d12b43..f3fec2a330 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java @@ -1,6 +1,5 @@ package com.mogo.module.main; -import android.content.Intent; import android.location.Location; import android.view.MotionEvent; @@ -21,11 +20,6 @@ import com.mogo.map.navi.MogoNaviInfo; import com.mogo.map.navi.MogoTraffic; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.module.main.registercenter.MogoRegisterCenterHandler; -import com.mogo.module.service.receiver.AccStatusReceiver; -import com.mogo.module.service.receiver.MogoReceiver; -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.intent.IMogoIntentManager; -import com.mogo.service.module.IMogoModuleLifecycle; import com.mogo.utils.logger.Logger; import java.util.Iterator; @@ -43,8 +37,7 @@ public class EventDispatchCenter implements IMogoCarLocationChangedListener2, IMogoMapListener, IMogoNaviListener2, - IMogoLocationListener, - IMogoIntentListener { + IMogoLocationListener { private static volatile EventDispatchCenter sInstance; @@ -66,12 +59,6 @@ public class EventDispatchCenter implements private static final String TAG = "DispatchCenter"; - public void registerReceiver( IMogoIntentManager intentManager ) { - intentManager.registerIntentListener( Intent.ACTION_POWER_CONNECTED, this ); - intentManager.registerIntentListener( Intent.ACTION_POWER_DISCONNECTED, this ); - intentManager.registerIntentListener( AccStatusReceiver.ACTION_NWD_ACC, this ); - } - @Override public boolean onMarkerClicked( IMogoMarker marker ) { IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener( marker.getOwner() ); @@ -437,32 +424,6 @@ public class EventDispatchCenter implements Logger.i( TAG, "onLocationChanged event cost " + ( System.currentTimeMillis() - start ) + "ms" ); } - @Override - public void onIntentReceived( String intentStr, Intent intent ) { - - Iterator< IMogoModuleLifecycle > iterator = MogoRegisterCenterHandler.getInstance().getLifecycleListeners(); - if ( Intent.ACTION_POWER_CONNECTED.equals( intentStr ) ) { - while ( iterator.hasNext() ) { - IMogoModuleLifecycle lifecycle = iterator.next(); - if ( lifecycle != null ) { - lifecycle.accOn(); - } - } - } else if ( Intent.ACTION_POWER_DISCONNECTED.equals( intentStr ) ) { - } else if ( AccStatusReceiver.ACTION_NWD_ACC.equals( intentStr ) ) { - int state = intent.getByteExtra( AccStatusReceiver.PARAM_ACC_STATUS, ( byte ) 0 ); - if ( state == 1 ) { - while ( iterator.hasNext() ) { - IMogoModuleLifecycle lifecycle = iterator.next(); - if ( lifecycle != null ) { - lifecycle.accOn(); - } - } - } - } - } - - @Override public void onArriveDestination() { Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners(); diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java index 876d4c01d2..71d7303ea9 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java @@ -60,7 +60,6 @@ public class MogoModulesManager implements MogoModulesHandler { throw new NullPointerException( "activity can't be null." ); } this.mActivity = activity; - EventDispatchCenter.getInstance().registerReceiver( apis.getIntentManagerApi() ); } private Context getContext() { diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java index ce556acb4c..3a979612ae 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java @@ -27,7 +27,7 @@ public * * 描述 */ -@Route( path = "/service/base/info" ) +@Route(path = "/service/base/info") class MogoMainService extends Service implements IMogoLocationListener { private static final String TAG = "MogoMainService"; @@ -40,11 +40,11 @@ class MogoMainService extends Service implements IMogoLocationListener { @Override public void onCreate() { - Logger.d( TAG, "基本服务启动" ); - mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(); + Logger.d(TAG, "基本服务启动"); + mServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(); initAndStartLocation(); initGpsSimulatorListener(); - UiThreadHandler.postDelayed( () -> { + UiThreadHandler.postDelayed(() -> { loadBaseModules(); startTanluService(); initADAS(); @@ -54,49 +54,53 @@ class MogoMainService extends Service implements IMogoLocationListener { @Nullable @Override - public IBinder onBind( Intent intent ) { + public IBinder onBind(Intent intent) { return null; } @Override - public int onStartCommand( Intent intent, int flags, int startId ) { + public int onStartCommand(Intent intent, int flags, int startId) { return START_STICKY; } private void initAndStartLocation() { - Logger.d( TAG, "开始定位" ); - mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ); - mLocationClient.addLocationListener( this ); - mLocationClient.start( 2_000L ); + Logger.d(TAG, "开始定位"); + mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient(AbsMogoApplication.getApp()); + mLocationClient.addLocationListener(this); + mLocationClient.start(2_000L); } private void initGpsSimulatorListener() { - mServiceApis.getMapServiceApi().getNavi( this ).registerCarLocationChangedListener( EventDispatchCenter.getInstance() ); + mServiceApis.getMapServiceApi().getNavi(this).registerCarLocationChangedListener(EventDispatchCenter.getInstance()); } private void loadBaseModules() { - Logger.d( TAG, "加载基本模块" ); + Logger.d(TAG, "加载基本模块"); MogoModulesManager.getInstance().loadBaseModule(); } private void startTanluService() { - MainService.Companion.launchService( getApplicationContext(), "0" ); + UiThreadHandler.postDelayed(() -> { + Logger.d(TAG, "startTanluService ---------- "); + MainService.Companion.launchService(getApplicationContext(), "0"); + }, 58_000L + ); } private void initADAS() { - mServiceApis.getAdasControllerApi().init( AbsMogoApplication.getApp() ); + mServiceApis.getAdasControllerApi().init(AbsMogoApplication.getApp()); } @Override - public void onLocationChanged( MogoLocation location ) { - EventDispatchCenter.getInstance().onLocationChanged( location ); + public void onLocationChanged(MogoLocation location) { + EventDispatchCenter.getInstance().onLocationChanged(location); } @Override public void onDestroy() { super.onDestroy(); - if ( mLocationClient != null ) { - mLocationClient.removeLocationListener( this ); + if (mLocationClient != null) { + mLocationClient.removeLocationListener(this); mLocationClient.stop(); mLocationClient.destroy(); mLocationClient = null; diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java index 2153c9a17e..c00caf03df 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java @@ -1,19 +1,12 @@ package com.mogo.module.share.dialog; import android.content.Context; -import android.graphics.PixelFormat; -import android.os.Build; -import android.view.Gravity; -import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.TextView; -import androidx.annotation.NonNull; - import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.module.common.dialog.BaseFloatDialog; -import com.mogo.module.common.utils.CarSeries; import com.mogo.module.share.R; import com.mogo.module.share.constant.ShareConstants; import com.mogo.module.share.manager.ISeekHelpListener; @@ -23,7 +16,6 @@ import com.mogo.service.IMogoServiceApis; import com.mogo.service.MogoServicePaths; import com.mogo.service.analytics.IMogoAnalytics; import com.mogo.service.statusmanager.IMogoStatusManager; -import com.mogo.utils.WindowUtils; import com.mogo.utils.logger.Logger; import java.util.HashMap; diff --git a/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_left.png b/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_left.png deleted file mode 100644 index 058a752bf6..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_left.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_right.png b/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_right.png deleted file mode 100644 index bbcedd2484..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/module_share_title_icon_right.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_accident.png b/modules/mogo-module-share/src/main/res/drawable/share_accident.png deleted file mode 100644 index 9dd6d425c9..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_accident.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_block_up.png b/modules/mogo-module-share/src/main/res/drawable/share_block_up.png deleted file mode 100644 index b504cffe87..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_block_up.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_dense_fog.png b/modules/mogo-module-share/src/main/res/drawable/share_dense_fog.png deleted file mode 100644 index 6a16103d0e..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_dense_fog.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_real_time_traffic.png b/modules/mogo-module-share/src/main/res/drawable/share_real_time_traffic.png deleted file mode 100644 index 7defe6986d..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_real_time_traffic.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_road_closure.png b/modules/mogo-module-share/src/main/res/drawable/share_road_closure.png deleted file mode 100644 index d20dacee3a..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_road_closure.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_road_construction.png b/modules/mogo-module-share/src/main/res/drawable/share_road_construction.png deleted file mode 100644 index 3c2ba1225c..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_road_construction.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_road_icy.png b/modules/mogo-module-share/src/main/res/drawable/share_road_icy.png deleted file mode 100644 index 53585d40d1..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_road_icy.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_seek_help.png b/modules/mogo-module-share/src/main/res/drawable/share_seek_help.png deleted file mode 100644 index 30f26921aa..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_seek_help.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_stagnant_water.png b/modules/mogo-module-share/src/main/res/drawable/share_stagnant_water.png deleted file mode 100644 index f125b9f22e..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_stagnant_water.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/drawable/share_traffic_check.png b/modules/mogo-module-share/src/main/res/drawable/share_traffic_check.png deleted file mode 100644 index 1b5af5fe54..0000000000 Binary files a/modules/mogo-module-share/src/main/res/drawable/share_traffic_check.png and /dev/null differ diff --git a/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml index e3a6a7987d..f5012a4dce 100644 --- a/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml +++ b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share_2.xml @@ -2,8 +2,7 @@ + android:layout_height="match_parent"> * 卡片生命周期 */ +@Deprecated public interface IMogoModuleLifecycle { /** diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java b/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java index 908af22c34..47a501fb53 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java @@ -13,4 +13,14 @@ public interface IMogoStatusChangedListener { * @param isTrue true - accOn、adas ui show、voice ui show、push ui show、v2x ui show */ void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ); + + /** + * 是否需要黏性状态: 先改变状态,后注册监听 + * + * @param descriptor 状态 + * @return 默认不需要 + */ + default boolean requestStickyStatus( StatusDescriptor descriptor ) { + return false; + } } diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java b/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java index 06a9ce1779..a16ca51607 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/statusmanager/MogoStatusManager.java @@ -8,6 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.service.MogoServicePaths; import com.mogo.service.statusmanager.IMogoStatusChangedListener; import com.mogo.service.statusmanager.IMogoStatusManager; +import com.mogo.service.statusmanager.IMogoStickyStatusChangedListener; import com.mogo.service.statusmanager.StatusDescriptor; import com.mogo.utils.logger.Logger; @@ -227,14 +228,21 @@ public class MogoStatusManager implements IMogoStatusManager { } @Override - public void registerStatusChangedListener( String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listeners ) { - if ( listeners == null || descriptor == null ) { + public void registerStatusChangedListener( String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listener ) { + if ( listener == null || descriptor == null ) { return; } if ( !mListeners.containsKey( descriptor ) ) { mListeners.put( descriptor, new ArrayList<>() ); } - mListeners.get( descriptor ).add( listeners ); + mListeners.get( descriptor ).add( listener ); + + if ( listener instanceof IMogoStickyStatusChangedListener && listener.requestStickyStatus( descriptor ) ) { + Boolean val = mStatus.get( descriptor ); + if ( val != null ) { + listener.onStatusChanged( descriptor, get_bool_val( descriptor ) ); + } + } } @Override