From d7a1b75fef1ab1948cb99ede71a15a39e7438ebf Mon Sep 17 00:00:00 2001 From: lvmeng <848755140@qq.com> Date: Mon, 1 Jun 2026 10:42:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E6=B7=BB=E5=8A=A0=20HomeV2Activit?= =?UTF-8?q?y=20=E5=B9=B6=E7=A7=BB=E9=99=A4=E8=AE=BE=E5=A4=87=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 AndroidManifest.xml 中注册新的 HomeV2Activity 页面 - 移除 BaseApp 中的设备角色判断和秤服务相关初始化代码 - 添加蓝色和橙色渐变按钮背景资源文件 - 修改 InitActivity 默认跳转至 HomeV2Activity 页面 - 移除与设备角色相关的路由逻辑代码 --- app/src/main/AndroidManifest.xml | 5 ++ .../com/shuwei/dish/match/base/BaseApp.kt | 87 +++++++++---------- .../shuwei/dish/match/ui/HomeV2Activity.kt | 29 +++++++ .../com/shuwei/dish/match/ui/InitActivity.kt | 47 +++++----- .../res/drawable/bg_gradient_blue_btn.xml | 13 +++ .../res/drawable/bg_gradient_orange_btn.xml | 13 +++ app/src/main/res/layout/activity_home_v2.xml | 46 ++++++++++ 7 files changed, 167 insertions(+), 73 deletions(-) create mode 100644 app/src/main/java/com/shuwei/dish/match/ui/HomeV2Activity.kt create mode 100644 app/src/main/res/drawable/bg_gradient_blue_btn.xml create mode 100644 app/src/main/res/drawable/bg_gradient_orange_btn.xml create mode 100644 app/src/main/res/layout/activity_home_v2.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e73b59f..62ba0ec 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -59,6 +59,11 @@ android:screenOrientation="portrait" tools:ignore="DiscouragedApi,LockedOrientationActivity" /> + + () - // 延迟到下一帧 finish,避免与 LaunchActivityItem 事务竞态导致 - // "Activity client record must not be null" 偶发崩溃 - window.decorView.post { finish() } - return@launch - } - // 主设备:走原有路由逻辑 - when (SpTool.cookMode) { - 0 -> { - startActivity() - } - - 1 -> { - goSampling() - } - - else -> { - startActivity() - } - } +// if (GlobalData.deviceRole == DeviceRole.SLAVE) { +// startActivity() +// // 延迟到下一帧 finish,避免与 LaunchActivityItem 事务竞态导致 +// // "Activity client record must not be null" 偶发崩溃 +// window.decorView.post { finish() } +// return@launch +// } +// // 主设备:走原有路由逻辑 +// when (SpTool.cookMode) { +// 0 -> { +// startActivity() +// } +// +// 1 -> { +// goSampling() +// } +// +// else -> { +// startActivity() +// } +// } + startActivity() // 延迟到下一帧 finish,避免与 LaunchActivityItem 事务竞态导致 // "Activity client record must not be null" 偶发崩溃 window.decorView.post { finish() } diff --git a/app/src/main/res/drawable/bg_gradient_blue_btn.xml b/app/src/main/res/drawable/bg_gradient_blue_btn.xml new file mode 100644 index 0000000..af78694 --- /dev/null +++ b/app/src/main/res/drawable/bg_gradient_blue_btn.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/drawable/bg_gradient_orange_btn.xml b/app/src/main/res/drawable/bg_gradient_orange_btn.xml new file mode 100644 index 0000000..0770e4f --- /dev/null +++ b/app/src/main/res/drawable/bg_gradient_orange_btn.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/layout/activity_home_v2.xml b/app/src/main/res/layout/activity_home_v2.xml new file mode 100644 index 0000000..e8acf46 --- /dev/null +++ b/app/src/main/res/layout/activity_home_v2.xml @@ -0,0 +1,46 @@ + + + + + + + + + +