refactor(activity): 重构 BaseActivity 并优化相关页面
- 将 handler 改为 private,onDestroy 统一清理所有待执行任务 - 新增 protected postDelayed 方法供子类安全调度延时任务 - 将 DateTimeFormatter 提取为 companion object 常量,避免每秒重复创建 - setTitleBar 调用时自动显示标题栏 - 拆分 permissionCallback 为单权限和多权限独立回调,避免覆盖 - 将权限 launcher 改为 private,收敛访问入口 - 删除死代码 bgState/useBackground 及注释掉的旧代码 - InitActivity 倒计时改用私有 countdownHandler/countdownTask,解除对父类 handler 的依赖 - PrepareFoodActivity 替换 handler.postDelayed 为 BaseActivity.postDelayed - FoodRecognizeActivity 持有弹窗引用防止重复打开 - BaseApp 使用 ScaleDeviceConfig.DEVICE_ID_2 替换硬编码设备 ID
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/bg_home_page" />
|
||||
tools:src="@drawable/bg_other_page" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLeftTime"
|
||||
|
||||
Reference in New Issue
Block a user