[Update]
1、开发动态换肤
This commit is contained in:
donghongyu-pc
2024-10-12 12:12:12 +08:00
parent a1efc370ab
commit c1080232b7
23 changed files with 108 additions and 8 deletions

View File

@@ -12,9 +12,11 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.AppUtils
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.och.biz.R
import com.mogo.och.biz.login.bean.DriverStatusQueryRespBean
import com.mogo.och.biz.login.bean.TaxiLoginReqBean
@@ -35,10 +37,13 @@ import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.ToastUtilsOch
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.data.manager.cache.CacheDataManager
import com.mogo.skin.Skin
import com.mogo.skin.SkinManager
import io.reactivex.Observable
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
/**
* Created by pangfan on 2021/8/19
*
@@ -183,6 +188,14 @@ object LoginModel {
OchCommonServiceManager.queryDriverServiceStatus(it, object : OchCommonServiceCallback<DriverStatusQueryRespBean> {
override fun onSuccess(data: DriverStatusQueryRespBean?) {
go2LoginInfo(data)
// TODO yangyakun 根据后台配置的用户租户对应的皮肤包进行下载换肤
val skin = Skin(
"f97d8076dcedd2cb5c30149da28cf863",
"YiXin-skin.skin",
"https://carlife-static-1255510688.cos.ap-beijing.myqcloud.com/MoGoEagleEye/YiXin-skin.skin"
)
//换肤
SkinManager.getInstance().selectSkin(Utils.getApp(), skin)
}
override fun onError() {

View File

@@ -158,6 +158,7 @@ ext {
mogoaicloudtrafficlive : "com.mogo.cloud:trafficlive:${MOGO_TRAFFICLIVE_VERSION}",
mogoaicloudlocation : "com.mogo.cloud:location:${MOGO_LOCATION_VERSION}",
mogoaicloudtelematic : "com.mogo.cloud:telematic:${MOGO_TELEMATIC_VERSION}",
mogo_aicloud_skin : "com.mogo.cloud:skin:${MOGO_SKIN_VERSION}",
//========================= 新架构的 Maven 版本管理 =========================
mogo_core_function_devatools : "com.mogo.eagle.core.function.impl:devatools:${MOGO_CORE_FUNCTION_DEVATOOLS_VERSION}",

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.main.threadopt.ThreadOptInitializer;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.skin.SkinManager;
import java.util.HashMap;
@@ -33,6 +34,10 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
super.onCreate();
// 动态换肤
SkinManager.init(this);
if (!shouldInit()) {
return;
}

View File

@@ -73,6 +73,7 @@ dependencies {
api rootProject.ext.dependencies.livesdk
implementation 'com.android.support:cardview-v7:26.1.0'
api rootProject.ext.dependencies.mogo_aicloud_skin
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_utils

View File

@@ -64,21 +64,23 @@ bytex.ASM_API=ASM7
LOGLIB_VERSION=1.10.18
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.40
MOGO_NETWORK_VERSION=1.4.7.42
# 鉴权
MOGO_PASSPORT_VERSION=1.4.7.40
MOGO_PASSPORT_VERSION=1.4.7.42
# 长链接
MOGO_SOCKET_VERSION=1.4.7.40
MOGO_SOCKET_VERSION=1.4.7.42
# 数据采集
MOGO_REALTIME_VERSION=1.4.7.40
MOGO_REALTIME_VERSION=1.4.7.42
# 直播推流
MOGO_LIVE_VERSION=1.4.7.40
MOGO_LIVE_VERSION=1.4.7.42
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.7.40
MOGO_TRAFFICLIVE_VERSION=1.4.7.42
# 定位服务
MOGO_LOCATION_VERSION=1.4.7.40
MOGO_LOCATION_VERSION=1.4.7.42
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.7.40
MOGO_TELEMATIC_VERSION=1.4.7.42
# 动态换肤SDK
MOGO_SKIN_VERSION=1.4.7.42
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=3.4.1.2

View File

@@ -90,3 +90,7 @@ include ':OCH:offline:driver'
include ':core:function-impl:mogo-core-function-patch'
// 以下是项目定制中的不同皮肤项目,皮肤项目独立打包并通过 COS 发布,后续借助运营平台能力进行动态维护
include ':skin:YiXin-skin'

4
skin/README.md Normal file
View File

@@ -0,0 +1,4 @@
# 应用皮肤包
> 这里按照不同的项目(mogo、德清、易鑫)需要的皮肤包
> 皮肤包均为无代码的项目资源包,
-

1
skin/YiXin-skin/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,30 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.dongnao.app.skin"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
}

21
skin/YiXin-skin/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,21 @@
# 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

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.mogo.skin"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#1F1F1F</color>
<color name="colorPrimaryDark">#373935</color>
<color name="colorAccent">#ffffff</color>
<color name="tabSelectedTextColor">#FFA500</color>
</resources>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">易鑫</string>
</resources>