优化模块依赖

This commit is contained in:
wangcongtao
2020-11-20 17:42:37 +08:00
parent 832d87ec4b
commit cd37051d1d
13 changed files with 55 additions and 37 deletions

View File

@@ -214,9 +214,9 @@ android {
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'false'
// 是否支持桌面卡片刷新
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
// 是否基于地图
buildConfigField 'boolean', 'IS_MAP_BASED', 'false'
}
@@ -363,7 +363,6 @@ dependencies {
implementation rootProject.ext.dependencies.moduleshare
implementation rootProject.ext.dependencies.tanluupload
implementation rootProject.ext.dependencies.mogomonitor
implementation rootProject.ext.dependencies.mogomoduleback
implementation rootProject.ext.dependencies.guideshow
implementation rootProject.ext.dependencies.moduleextensions
implementation rootProject.ext.dependencies.modulemap
@@ -380,7 +379,6 @@ dependencies {
implementation project(':modules:mogo-module-share')
implementation project(':libraries:tanlulib')
implementation project(':modules:mogo-module-monitor')
implementation project(':modules:mogo-module-back')
implementation project(':modules:mogo-module-guide')
implementation project(':modules:mogo-module-extensions')
implementation project(':modules:mogo-module-map')
@@ -395,6 +393,7 @@ dependencies {
apply from: "./functions/crashreport.gradle"
apply from: "./functions/widgets.gradle"
apply from: "./functions/tts.gradle"
apply from: "./functions/backwidget.gradle"
// implementation group: "com.tencent.matrix", name: "matrix-android-lib", version: '0.6.6', changing: true
// implementation group: "com.tencent.matrix", name: "matrix-android-commons", version: '0.6.6', changing: true

View File

@@ -0,0 +1,9 @@
// 辅助驾驶占位模块,目前部分车机不上辅助驾驶功能,使用该模块能力代替
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
launcherImplementation rootProject.ext.dependencies.mogomoduleback
} else {
launcherImplementation project(':modules:mogo-module-back')
}
}

View File

@@ -13,7 +13,6 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.back.BackToLauncherConst;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
@@ -68,11 +67,9 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK ) );
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
} else {
}
// TODO
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );

View File

@@ -1,14 +0,0 @@
package com.mogo.module.back;
/**
* @author congtaowang
* @since 2020-02-26
* <p>
* 描述
*/
public class BackToLauncherConst {
public static final String MODULE_NAME ="MOGO_BACK_2_LAUNCHER";
public static final String MODULE_PATH = "/back2launcher/ui";
}

View File

@@ -9,6 +9,8 @@ import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.ModuleType;
@@ -18,7 +20,7 @@ import com.mogo.service.module.ModuleType;
* <p>
* 描述
*/
@Route( path = BackToLauncherConst.MODULE_PATH )
@Route( path = MogoServicePaths.PATH_BACK )
public class BackToLauncherModuleProvider implements IMogoModuleProvider {
private static final String TAG = "BackToLauncherModuleProvider";
@@ -36,7 +38,7 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
@NonNull
@Override
public String getModuleName() {
return BackToLauncherConst.MODULE_NAME;
return TAG;
}
@Override

View File

@@ -278,7 +278,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
}
mServiceApis.getLauncherApi().setFloatButtonVisible( false );
if ( mServiceApis.getLauncherApi() != null ) {
mServiceApis.getLauncherApi().setFloatButtonVisible( false );
}
}
@Override
@@ -290,7 +292,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
mServiceApis.getLauncherApi().setFloatButtonVisible( true );
if ( mServiceApis.getLauncherApi() != null ) {
mServiceApis.getLauncherApi().setFloatButtonVisible( true );
}
}
protected boolean shouldCloseADASPanelWhenPause() {

View File

@@ -112,7 +112,9 @@ public class SchemeIntent implements IMogoStatusChangedListener {
delay = 5_000L;
}
mNextIntent = new IntentWrapper(intent, delay);
mApis.getLauncherApi().backToLauncher(mContext);
if ( mApis.getLauncherApi() != null ) {
mApis.getLauncherApi().backToLauncher(mContext);
}
return;
}

View File

@@ -117,7 +117,9 @@ public class MapPresenter extends Presenter< MapView > implements
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
} else {
mLauncher.backToLauncher( getContext() );
if ( mLauncher != null ) {
mLauncher.backToLauncher( getContext() );
}
UiThreadHandler.postDelayed( () -> {
try {
mStatusManager.setDisplayOverview( TAG, false );
@@ -136,7 +138,9 @@ public class MapPresenter extends Presenter< MapView > implements
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
return;
}
mLauncher.backToLauncher( getContext() );
if ( mLauncher != null ) {
mLauncher.backToLauncher( getContext() );
}
if ( !mMogoMapService.getNavi( getContext() ).isNaviing() && !mStatusManager.isSearchUIShow() ) {
mSearchManager.showSearch();
}
@@ -148,7 +152,9 @@ public class MapPresenter extends Presenter< MapView > implements
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
return;
}
mLauncher.backToLauncher( getContext() );
if ( mLauncher != null ) {
mLauncher.backToLauncher( getContext() );
}
mMogoSearchManager.calculatePath( new MogoLatLng( lat, lon ) );
}
@@ -158,7 +164,9 @@ public class MapPresenter extends Presenter< MapView > implements
// 导航过程中语音指令退出导航,会出现 activity 不走 onResume 的情况
UiThreadHandler.postDelayed( () -> {
if ( AppUtils.isAppForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
mLauncher.backToLauncher( getContext() );
if ( mLauncher != null ) {
mLauncher.backToLauncher( getContext() );
}
}
}, 500L );
return;
@@ -203,7 +211,9 @@ public class MapPresenter extends Presenter< MapView > implements
mView.getUIController().displayOverview( mDisplayOverviewBounds );
AIAssist.getInstance( getContext() ).speakTTSVoice( "展示全程路线" );
} else {
mLauncher.backToLauncher( getContext() );
if ( mLauncher != null ) {
mLauncher.backToLauncher( getContext() );
}
UiThreadHandler.postDelayed( () -> {
mStatusManager.setUserInteractionStatus( TAG, true, false );
mStatusManager.setDisplayOverview( TAG, true );

View File

@@ -171,7 +171,6 @@ public class MogoServices implements IMogoMapListener,
private IMogoIntentManager mIntentManager;
private IMogoActionManager mActionManager;
private IMogoADASController mADASController;
private IMogoLauncher mLauncher;
private IMogoFragmentManager mFragmentManager;
private IMogoNavi mNavi;
private IMogoRegisterCenter mRegisterCenter;
@@ -557,7 +556,6 @@ public class MogoServices implements IMogoMapListener,
mIntentManager.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, this);
mADASController = MarkerServiceHandler.getADASController();
mLauncher = MarkerServiceHandler.getLauncher();
mFragmentManager = MarkerServiceHandler.getFragmentManager();
mFragmentManager.addMainFragmentStackTransactionListener(this);

View File

@@ -22,7 +22,9 @@ public class MyLocationHandler implements IntentHandler {
if ( MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) {
MarkerServiceHandler.getMapUIController().recoverLockMode();
} else {
MarkerServiceHandler.getLauncher().backToLauncher( context );
if ( MarkerServiceHandler.getLauncher() != null ) {
MarkerServiceHandler.getLauncher().backToLauncher( context );
}
UiThreadHandler.postDelayed( () -> {
MarkerServiceHandler.getMapUIController().recoverLockMode();
}, 2_000L );

View File

@@ -50,7 +50,9 @@ class WholeVoiceCommandIntentHandler implements IntentHandler {
}
switch ( command ) {
case ServiceConst.COMMAND_BACK:
MarkerServiceHandler.getLauncher().backToLauncher( context );
if ( MarkerServiceHandler.getLauncher() != null ) {
MarkerServiceHandler.getLauncher().backToLauncher( context );
}
break;
}
}

View File

@@ -227,7 +227,9 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
private void enterApp( Context context ) {
try {
if ( DebugConfig.isLauncher() ) {
MogoWidgetManger.getInstance().getApis().getLauncherApi().backToLauncher( context );
if ( MogoWidgetManger.getInstance().getApis().getLauncherApi() != null ) {
MogoWidgetManger.getInstance().getApis().getLauncherApi().backToLauncher( context );
}
} else {
LaunchUtils.launchByPkg( context, "com.mogo.launcher.app" );
}

View File

@@ -279,4 +279,9 @@ public class MogoServicePaths {
* 全局免唤醒
*/
public static final String PATH_GLOBAL_UNWAKE = "/global/unwake";
/**
* 返回悬浮按钮
*/
public static final String PATH_BACK = "/back2launcher/ui";
}