合并黑夜白天模式等需求

This commit is contained in:
wangcongtao
2020-09-10 16:27:01 +08:00
940 changed files with 19301 additions and 2446 deletions

View File

@@ -109,6 +109,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// f系列-分体机
f80x {
@@ -123,6 +125,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// e系列采用Launcher方案
e8xx {
@@ -137,6 +141,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// 同上
em4 {
@@ -151,6 +157,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// e系列-2+32对标D系列2+32采用独立app的形式
em3 {
@@ -165,6 +173,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// e系列-1+16对标D系列1+16采用独立app形式
em1 {
@@ -179,6 +189,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
// d系列
d8xx {
@@ -193,6 +205,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
}
// d系列 2 + 32
d80x {
@@ -207,6 +221,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
}
// d系列 1+16 版本
d82x {
@@ -221,6 +237,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
}
// 比亚迪
bydauto {
@@ -235,6 +253,8 @@ android {
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.bydautoIndependentApiValue]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
}
qa {
dimension "env"
@@ -253,6 +273,12 @@ android {
packagingOptions {
exclude 'META-INF/io.netty.versions.properties'
}
sourceSets {
main {
res.srcDirs = ['src/main/res', 'src/main/res-night']
}
}
}
repositories {
@@ -269,14 +295,15 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.boostmultidex
debugImplementation rootProject.ext.dependencies.leakcanary
testImplementation rootProject.ext.dependencies.leakcanary
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
debugImplementation rootProject.ext.dependencies.debugleakcanary
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
implementation rootProject.ext.dependencies.carcallprovider
implementation rootProject.ext.dependencies.carcall
implementation rootProject.ext.dependencies.mogologlib
compileOnly rootProject.ext.dependencies.adasapi
compileOnly rootProject.ext.dependencies.adasconfigapi
// implementation rootProject.ext.dependencies.modulepushbase
// launcherImplementation rootProject.ext.dependencies.modulepush
@@ -300,6 +327,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogomonitor
implementation rootProject.ext.dependencies.mogomodulewidgets
implementation rootProject.ext.dependencies.mogomoduleback
implementation rootProject.ext.dependencies.guideshow
} else {
implementation project(':foudations:mogo-commons')
implementation project(':modules:mogo-module-common')
@@ -317,6 +345,7 @@ dependencies {
implementation project(':modules:mogo-module-monitor')
implementation project(':modules:mogo-module-widgets')
implementation project(':modules:mogo-module-back')
implementation project(':modules:mogo-module-guide')
}
apply from: "./functions/perform.gradle"
@@ -324,6 +353,8 @@ dependencies {
apply from: "./functions/socketpush.gradle"
apply from: "./functions/gpssimulator.gradle"
apply from: "./functions/leftpanel.gradle"
apply from: "./functions/skin.gradle"
apply from: "./functions/crashreport.gradle"
}
android.applicationVariants.all { variant ->

View File

@@ -0,0 +1,13 @@
// bugly 上报目前仅在debug编译下加载bugly
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.crashreport
debugImplementation rootProject.ext.dependencies.crashreportbugly
releaseImplementation rootProject.ext.dependencies.crashreportnoop
} else {
implementation project(':test:crashreport')
debugImplementation project(':test:crashreport-bugly')
releaseImplementation project(':test:crashreport-noop')
}
}

48
app/functions/skin.gradle Normal file
View File

@@ -0,0 +1,48 @@
project.dependencies {
if (Boolean.valueOf(RELEASE)) {
bydautoImplementation rootProject.ext.dependencies.skinsupportnoop
d8xxImplementation rootProject.ext.dependencies.skinsupportnoop
d82xImplementation rootProject.ext.dependencies.skinsupportnoop
em1Implementation rootProject.ext.dependencies.skinsupportnoop
d80xImplementation rootProject.ext.dependencies.skinsupportnoop
em3Implementation rootProject.ext.dependencies.skinsupportnoop
f8xxImplementation rootProject.ext.dependencies.skinsupportimpl
f80xImplementation rootProject.ext.dependencies.skinsupportimpl
em4Implementation rootProject.ext.dependencies.skinsupportimpl
e8xxImplementation rootProject.ext.dependencies.skinsupportimpl
f8xxImplementation rootProject.ext.dependencies.skinsupportlight
f80xImplementation rootProject.ext.dependencies.skinsupportlight
em4Implementation rootProject.ext.dependencies.skinsupportlight
e8xxImplementation rootProject.ext.dependencies.skinsupportlight
// d8xxImplementation rootProject.ext.dependencies.skinsupportlight
// d82xImplementation rootProject.ext.dependencies.skinsupportlight
// em1Implementation rootProject.ext.dependencies.skinsupportlight
// d80xImplementation rootProject.ext.dependencies.skinsupportlight
// em3Implementation rootProject.ext.dependencies.skinsupportlight
} else {
bydautoImplementation project(':skin:mogo-skin-support-noop')
d8xxImplementation project(':skin:mogo-skin-support-noop')
d82xImplementation project(':skin:mogo-skin-support-noop')
em1Implementation project(':skin:mogo-skin-support-noop')
d80xImplementation project(':skin:mogo-skin-support-noop')
em3Implementation project(':skin:mogo-skin-support-noop')
f8xxImplementation project(':skin:mogo-skin-support-impl')
f80xImplementation project(':skin:mogo-skin-support-impl')
em4Implementation project(':skin:mogo-skin-support-impl')
e8xxImplementation project(':skin:mogo-skin-support-impl')
f8xxImplementation project(':skin:mogo-skin-light')
f80xImplementation project(':skin:mogo-skin-light')
em4Implementation project(':skin:mogo-skin-light')
e8xxImplementation project(':skin:mogo-skin-light')
// d8xxImplementation project(':skin:mogo-skin-light')
// d82xImplementation project(':skin:mogo-skin-light')
// em1Implementation project(':skin:mogo-skin-light')
// d80xImplementation project(':skin:mogo-skin-light')
// em3Implementation project(':skin:mogo-skin-light')
}
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:sharedUserId="android.uid.system"
package="com.mogo.launcher">
</manifest>

View File

@@ -3,4 +3,5 @@
xmlns:tools="http://schemas.android.com/tools"
android:sharedUserId="android.uid.system"
package="com.mogo.launcher">
</manifest>

View File

@@ -27,13 +27,18 @@ import com.mogo.module.widgets.MogoWidgetsProvider;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
import com.squareup.leakcanary.LeakCanary;
import com.zhidao.boot.persistent.lib.PersistentManager;
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
import com.zhidao.mogo.tanlu.api.TanluApiConst;
import static com.mogo.module.guide.GuideConstant.PATH_GUIDE_FRAGMENT;
import static com.mogo.module.guide.GuideConstant.PATH_GUIDE_MODULE_NAME;
/**
* @author congtaowang
* @since 2019-12-18
@@ -48,6 +53,9 @@ public class MogoApplication extends AbsMogoApplication {
public void onCreate() {
initDebugConfig();
super.onCreate();
if ( !shouldInit() ) {
return;
}
// Crash 日志收集
final long start = System.currentTimeMillis();
CrashSystem crashSystem = CrashSystem.getInstance( this );
@@ -56,7 +64,9 @@ public class MogoApplication extends AbsMogoApplication {
crashSystem.setDebug( BuildConfig.DEBUG );
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
if ( DebugConfig.isLoadGuideModule() ) {
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
}
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
@@ -68,16 +78,17 @@ public class MogoApplication extends AbsMogoApplication {
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
}
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
MogoModulePaths.addBaseModule(new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE,"StrategyShare"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare" ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
@@ -86,10 +97,25 @@ public class MogoApplication extends AbsMogoApplication {
Intent intent = new Intent( this, MogoMainService.class );
startService( intent );
}
LeakCanary.install( this );
// debug 下初始化 bugly 上报
if ( DebugConfig.isDebug() ) {
ARouter.getInstance().navigation( ITestCrashReportProvider.class );
}
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override
protected boolean shouldInit() {
return !LeakCanary.isInAnalyzerProcess( this );
}
private void initDebugConfig() {
if ( !shouldInit() ) {
return;
}
DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setAIType( BuildConfig.AIType );
@@ -103,20 +129,28 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
DebugConfig.setLoadGuideModule( BuildConfig.LOAD_GUIDE_MODULE );
}
@Override
protected void asyncInitImpl() {
super.asyncInitImpl();
}
@Override
protected void init() {
super.init();
prepareBaseService( 2_000L );
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
prepareBaseService( apis, 2_000L );
// installSkinManager( this, apis );
}
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService( long delay ) {
private void prepareBaseService( IMogoServiceApis apis, long delay ) {
UiThreadHandler.postDelayed( () -> {
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
// 第三方平台的sn是服务端生成的所以必须在返回后才能开启
if ( TextUtils.isEmpty( Utils.getSn() ) ) {
preparePassportEnvironment( apis, () -> {