Browse Source

011多渠道打包兼容

zhangshenjie 9 months ago
parent
commit
df5fdc875b

+ 1 - 0
BusinessCommon/src/main/res/values/colors.xml

@@ -37,6 +37,7 @@
     <color name="color_FFE3E3">#FFE3E3</color>
     <color name="color_FFF6E9">#FFF6E9</color>
     <color name="color_A3A3A2">#A3A3A2</color>
+    <color name="color_CCAAAAAA">#CCAAAAAA</color>
     <color name="color_E4E4E4">#E4E4E4</color>
     <color name="color_6FB1FB">#6FB1FB</color>
     <color name="color_00000000">#00000000</color>

+ 1 - 1
BusinessMain/src/main/java/com/develop/main/adapter/LetterTextAdapter.kt

@@ -27,7 +27,7 @@ class LetterTextAdapter:  RecyclerView.Adapter<RecyclerView.ViewHolder>() {
         text.text = data
 
         // isType = 1 是黑色风格, 2是蓝色风格,0是默认
-        if (isType ==1){
+        if (isType ==1 || isType ==3){
             letter_layout.background = mContext.resources.getDrawable(com.develop.common.R.color.color_00000000)
         }else{
             letter_layout.background = mContext.resources.getDrawable(com.develop.common.R.color.bg_color)

+ 2 - 1
BusinessStep/src/main/res/layout/activity_cook_detail.xml

@@ -88,7 +88,8 @@
         android:textStyle="bold"
         android:scrollbars="vertical"
         android:maxLines="3"
-        android:scrollbarThumbVertical="@color/color_A3A3A2"
+        android:scrollbarSize="@dimen/convert_8px"
+        android:scrollbarThumbVertical="@color/color_CCAAAAAA"
 
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@+id/iv_top_banner"

+ 79 - 19
app/build.gradle

@@ -18,13 +18,14 @@ ext {
 
     versionCode = Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
-    brandCode="049B"
+    brandCode="011A"
 //    brandCode = "010D"
     model = "1039"
 
 }
 
 
+
 android {
     compileSdk 31
 
@@ -65,6 +66,10 @@ android {
         }
         multiDexEnabled true
     }
+
+
+
+
     flavorDimensions "platform"
     productFlavors {
 
@@ -80,6 +85,18 @@ android {
 //            buildConfigField("String", "appCode", "\"2.01\"")
             buildConfigField("String", "time","\"${getCurrentTime()}\"" )
         }
+        brand000A5037Tuya {
+            dimension "platform"
+            applicationId "com.develop.foodcooking"
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+            buildConfigField("String", "model", "\"5037\"")
+            buildConfigField("String", "brandCode", "\"000A\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
+//            buildConfigField("String", "appCode", "\"2.01\"")
+            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
+        }
 
         brand000A5067Tuya {
             dimension "platform"
@@ -115,9 +132,10 @@ android {
 //        }
 
         brand011ATuya {
+            manifestPlaceholders = [channelName: "brand011ATuya"]
             dimension "platform"
             applicationId "com.develop.foodcooking"
-            buildConfigField("String", "UpdatePlatform", "\"night\"")
+            buildConfigField("String", "UpdatePlatform", "\"011\"")
             resValue("string", "app_theme", "@style/Splash011ATheme")
             buildConfigField("String", "model", "\"1039\"")
             buildConfigField("String", "brandCode", "\"011A\"")
@@ -125,11 +143,22 @@ android {
             buildConfigField("String", "appCode", "\"1.01\"")
             buildConfigField("String", "time","\"${getCurrentTime()}\"" )
 
+            // 在构建过程中的某个阶段调用任务
+            // 假设我们在处理资源之前替换资源
+//            android.applicationVariants.all { variant ->
+//                variant.preBuildProvider.get().doLast {
+//                    // 替换资源文件
+//                    replaceUkStringsFile("src/brand011ATuya/uk/strings.xml", "${variant.resDir}/values-uk/strings.xml")
+//                }
+//            }
+
+
         }
         brand011A5037Tuya {
+            manifestPlaceholders = [channelName: "brand011A5037Tuya"]
             dimension "platform"
             applicationId "com.develop.foodcooking"
-            buildConfigField("String", "UpdatePlatform", "\"night\"")
+            buildConfigField("String", "UpdatePlatform", "\"011\"")
             resValue("string", "app_theme", "@style/Splash011A5037Theme")
             buildConfigField("String", "model", "\"5037\"")
             buildConfigField("String", "brandCode", "\"011A\"")
@@ -413,6 +442,37 @@ android {
         }
     }
 
+//    sourceSets {
+//        main {
+//            manifest.srcFile 'src/main/AndroidManifest.xml'
+//            java.srcDirs = ['src/main/java']
+//            resources.srcDirs = ['src/main/resources']
+//            aidl.srcDirs = ['src/main/aidl']
+//            renderscript.srcDirs = ['src/maom']
+//            res.srcDirs = ['src/main/res']
+//            assets.srcDirs = ['src/main/assets']
+//            jniLibs.srcDir 'src/main/jniLibs'
+//        }
+//
+//        //用各自对应的资源文件路径
+//        brand011ATuya.res.srcDirs = ['src/main/res-zerooneone']
+////        huawei.res.srcDirs = ['src/main/res-huawei']
+//
+//        // Move the tests to tests/java, tests/res, etc...
+//        androidTest.setRoot('tests')
+//        // Move the build types to build-types/<type>
+//        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
+//        // This moves them out of them default location under src/<type>/... which would
+//        // conflict with src/ being used by the main source set.
+//        // Adding new build types or product flavors should be accompanied
+//        // by a similar customization.
+//        debug.setRoot('build-types/debug')
+//        release.setRoot('build-types/release')
+//    }
+
+
+
+
     signingConfigs {
         debug {
             storeFile file('..\\signature\\rk.jks')
@@ -504,13 +564,13 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-
-//            buildConfigField("String", "UpdatePlatform", "\"night\"")
-//            resValue("string", "app_theme", "@style/Splash011ATheme")
-//            buildConfigField("String", "model", "\"1039\"")
-//            buildConfigField("String", "brandCode", "\"011A\"")
-//            //appCode 1.01 指向bug修复,2.01指向功能变更
-//            buildConfigField("String", "appCode", "\"1.01\"")
+            manifestPlaceholders = [channelName: "brand011ATuya"]
+            buildConfigField("String", "UpdatePlatform", "\"011\"")
+            resValue("string", "app_theme", "@style/Splash011ATheme")
+            buildConfigField("String", "model", "\"1039\"")
+            buildConfigField("String", "brandCode", "\"011A\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
 
 //            buildConfigField("String", "UpdatePlatform", "\"normal\"")
 //            resValue("string", "app_theme", "@style/SplashTheme")
@@ -589,15 +649,15 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
-            buildConfigField("String", "model", "\"1039\"")
-            buildConfigField("String", "brandCode", "\"049B\"")
-            //appCode 1.01 指向bug修复,2.01指向功能变更
-            buildConfigField("String", "appCode", "\"1.01\"")
-
-
-            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
+//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
+//            buildConfigField("String", "model", "\"1039\"")
+//            buildConfigField("String", "brandCode", "\"049B\"")
+//            //appCode 1.01 指向bug修复,2.01指向功能变更
+//            buildConfigField("String", "appCode", "\"1.01\"")
+//
+//
+//            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
 
         }
     }

File diff suppressed because it is too large
+ 465 - 0
app/src/brand011ATuya/res/values-uk/strings.xml


+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -68,7 +68,7 @@
         </activity>
         <activity android:name="com.github.moduth.blockcanary.ui.DisplayActivity" android:exported="true" />
 
-
+        <meta-data android:name="channel" android:value="${channelName}"/>
         <meta-data
             android:name="design_width_in_dp"
             android:value="640" />

+ 3 - 2
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -203,6 +203,7 @@ fun getSN(): String {
     var serial: String
 //    //由于063 需要写死SN 估在这加
 //    return  "063A21050020123010190001"
+//    return "011A10390020123010190001"
 
     if (BuildConfig.DEBUG) {
 //        return "045A21030020123010190001"
@@ -213,10 +214,10 @@ fun getSN(): String {
 //        return "010D10390020123010190001"
 //        return "010F10390020123010190001"
 
-//        return "011A10390020123010190001"
+        return "011A10390020123010190001"
 //        return "000A50370020123010190004"
 //        return "011A50370020123010190003"
-        return "011A50370020123010190006"
+//        return "011A50370020123010190006"
 //    return "007D20020020123010190001"
 //        return "036I21060020123010190007"
 //        return "030A10390020123010190004"