Browse Source

054图片处理

zhangshenjie 1 day ago
parent
commit
3a1264ada8

+ 3 - 3
BusinessAirFryer/src/main/assets/config_054.json

@@ -4,7 +4,7 @@
     {
       "type": "ADAPTED_COOKING",
       "name": "adapted_cooking",
-      "bg": "ic_mode_diy_054",
+      "bg": "ic_mode_diy_054_1",
       "icon": "ic_grid_adapted_cooking_054",
       "devMode": "SOUP",
       "listShow": true
@@ -28,8 +28,8 @@
     {
       "type": "BOIL_WATER",
       "name": "boil_water",
-      "bg": "ic_mode_boil_water_054",
-      "icon": "ic_grid_boil_water_054",
+      "bg": "ic_mode_boil_water_054_1",
+      "icon": "ic_grid_boil_water_054_1",
       "devMode": "SOUP",
       "listShow": true
     },

BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_grid_boil_water_054_1.png


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_mode_boil_water_054_1.png


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_mode_diy_054_1.png


+ 28 - 0
BusinessCommon/src/main/res/layout/item_entrance_night_view_054.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/content_view"
+    android:layout_width="@dimen/convert_320px"
+    android:layout_height="match_parent">
+
+    <ImageView
+        android:scaleType="fitXY"
+        android:id="@+id/iv_bg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="@dimen/convert_52px"
+        android:layout_marginEnd="@dimen/convert_52px"
+        android:layout_marginBottom="@dimen/convert_75px"
+        android:gravity="center"
+        android:textColor="@color/white"
+        android:textSize="@dimen/convert_30px"
+        android:textStyle="bold"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 113 - 2
BusinessMain/src/main/java/com/develop/main/ui/ModeEntranceActivity.kt

@@ -451,7 +451,6 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
                     }
                 }.models =
                     if (sn.startsWith("011")) DataFactory.get011NightEntranceData()
-                    else if (sn.startsWith("054")) DataFactory.get054NightEntranceData()
                     else DataFactory.getNightEntranceData()
             }
 
@@ -728,7 +727,119 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
                     }
                 }
             }.models = DataFactory.get029CEntranceData()
-        } else if (sn.startsWith("049")) {
+        }  else if (sn.startsWith("054")) {
+            binding.entranceRecycle.apply {
+                linear(RecyclerView.HORIZONTAL)
+                setup {
+                    addType<EntranceData>(com.develop.common.R.layout.item_entrance_night_view_054)
+                    onBind {
+                        val model = getModel<EntranceData>()
+                        findView<ImageView>(com.develop.common.R.id.iv_bg).src = model.bgResId
+                        var appCompatTextView =
+                            findView<AppCompatTextView>(com.develop.common.R.id.tv_title)
+                        if (sn.startsWith("025")) {
+                            appCompatTextView.setGone()
+                        } else {
+                            appCompatTextView.setText(model.titleStrId)
+                        }
+                    }
+                    R.id.content_view.onClick {
+                        val clickModel = getModel<EntranceData>()
+                        title = getString(clickModel.title2StrId)
+                        when (clickModel.type) {
+                            EntranceType.automatic_recipes -> {
+                                if (FoodDataProvider.checkDataExit()) {
+                                    val bundle = Bundle()
+                                    bundle.putInt(MODE_ENTRANCE, Recipes)
+                                    bundle.putInt(RECIPES_TYPE, LocalFood)
+                                    bundle.putString(HOME_TITLE, title)
+                                    navigateTo(Screens.Main.HOME) {
+                                        with(bundle)
+                                    }
+                                } else {
+                                    showLoading()
+                                }
+                            }
+
+                            EntranceType.automatic_programmes -> {
+                                if (FoodDataProvider.checkDataExit()) {
+                                    val bundle = Bundle()
+                                    bundle.putInt(MODE_ENTRANCE, Mode)
+                                    bundle.putString(HOME_TITLE, title)
+                                    navigateTo(Screens.Main.HOME) {
+                                        with(bundle)
+                                    }
+                                } else {
+                                    showLoading()
+                                }
+                            }
+
+                            EntranceType.manual_cooking -> {
+                                if (FoodDataProvider.checkDataExit()) {
+
+
+                                    var modeName =
+                                        if (sn.startsWith("011")) resources.getString(com.develop.common.R.string.manual_cooking_011)
+                                            .replace(
+                                                "\n",
+                                                " "
+                                            ) else resources.getString(com.develop.common.R.string.adapted_cooking)
+                                    navigateTo(Screens.Cook.COOK_MODES) {
+
+                                        if (DevModes.SOUP == CofarSDK.devInfo().devMode) {
+                                            val bundle = Bundle()
+                                            bundle.putString(
+                                                MODE_TYPE,
+                                                WorkModes.ADAPTED_COOKING
+                                            )
+                                            bundle.putString(
+                                                "mode_name",
+                                                modeName
+                                            )
+                                            with(bundle)
+                                        } else {
+                                            val bundle = Bundle()
+                                            bundle.putString(MODE_TYPE, WorkModes.AF_DIY)
+                                            with(bundle)
+                                        }
+
+
+                                    }
+                                } else {
+                                    showLoading()
+                                }
+                            }
+
+                            EntranceType.download_new_recipes -> {
+                                if (sn.startsWith("011")) {
+                                    if (NetworkUtils.isWifiConnected()) {
+                                        if (!AppVersionUtil.dialogRecipeUpdate.isShow) {
+                                            AppVersionUtil.checkAboutRecipeUpdate(true)
+                                        }
+                                    } else {
+                                        GlobalToast.showToast(getString(com.develop.common.R.string.network_error))
+
+                                    }
+                                } else {
+                                    if (FoodDataProvider.checkDataExit()) {
+                                        val bundle = Bundle()
+                                        bundle.putInt(MODE_ENTRANCE, Recipes)
+                                        bundle.putInt(RECIPES_TYPE, NetFood)
+                                        bundle.putString(HOME_TITLE, title)
+                                        navigateTo(Screens.Main.HOME) {
+                                            with(bundle)
+                                        }
+                                    } else {
+                                        showLoading()
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+                }
+            }.models = DataFactory.get054NightEntranceData()
+        }else if (sn.startsWith("049")) {
             binding.entranceRecycle049.apply {
 //                linear(RecyclerView.HORIZONTAL)
                 grid(4)

+ 1 - 1
app/build.gradle

@@ -602,7 +602,7 @@ android {
             manifestPlaceholders = [channelName: "brand054ATuya"]
             dimension "platform"
             applicationId "com.develop.foodcooking"
-            buildConfigField("String", "UpdatePlatform", "\"night\"")
+            buildConfigField("String", "UpdatePlatform", "\"011\"")
             resValue("string", "app_theme", "@style/Splash054ATheme")
             buildConfigField("String", "model", "\"1039\"")
             buildConfigField("String", "brandCode", "\"054A\"")

+ 1 - 1
app/src/brand054A5037Tuya/res/values-en/strings.xml

@@ -39,7 +39,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="settings">Settings</string>
     <string name="grid_view">Grid view</string>
     <string name="list_view">List view</string>
-    <string name="adapted_cooking">ADAPTED COOKING</string>
+    <string name="adapted_cooking">Manual Cooking</string>
     <string name="scales">SCALES</string>
     <string name="boil_water">BOIL WATER</string>
     <string name="chop">CHOP</string>

+ 1 - 1
app/src/brand054ATuya/res/values-en/strings.xml

@@ -39,7 +39,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="settings">Settings</string>
     <string name="grid_view">Grid view</string>
     <string name="list_view">List view</string>
-    <string name="adapted_cooking">ADAPTED COOKING</string>
+    <string name="adapted_cooking">Manual Cooking</string>
     <string name="scales">SCALES</string>
     <string name="boil_water">BOIL WATER</string>
     <string name="chop">CHOP</string>