diff --git a/app/src/main/java/com/shuwei/dish/match/dialog/CommonDialog.kt b/app/src/main/java/com/shuwei/dish/match/dialog/CommonDialog.kt index da271f0..af9feef 100644 --- a/app/src/main/java/com/shuwei/dish/match/dialog/CommonDialog.kt +++ b/app/src/main/java/com/shuwei/dish/match/dialog/CommonDialog.kt @@ -66,16 +66,21 @@ open class CommonDialog( requestWindowFeature(Window.FEATURE_NO_TITLE) binding = DialogCommonBinding.inflate(layoutInflater) setContentView(binding.root) + // 弹窗不允许点击外部关闭 + setCancelable(false) window?.run { val screenWidth = context.resources.displayMetrics.widthPixels val isMaster = GlobalData.deviceRole == DeviceRole.MASTER attributes = attributes.apply { width = if (isMaster) (screenWidth * 0.72f).toInt() else (screenWidth * 0.60f).toInt() } + // 透明背景,让 shape_dialog_bg 的阴影层正常显示 setBackgroundDrawable(ColorDrawable()) - setCancelable(false) + // 应用缩放+淡入淡出动画 + setWindowAnimations(com.shuwei.dish.match.R.style.CommonDialogAnimation) } - val verticalMargin = if (GlobalData.deviceRole == DeviceRole.MASTER) 35.dp else 20.dp + // 主/从设备边距微调:主设备内容区域更大,适当增加上下留白 + val verticalMargin = if (GlobalData.deviceRole == DeviceRole.MASTER) 48.dp else 36.dp binding.tvTitle.updateLayoutParams { topMargin = verticalMargin } binding.tvContent.updateLayoutParams { bottomMargin = verticalMargin } diff --git a/app/src/main/java/com/shuwei/dish/match/ui/InitActivity.kt b/app/src/main/java/com/shuwei/dish/match/ui/InitActivity.kt index 2de962b..afa1076 100644 --- a/app/src/main/java/com/shuwei/dish/match/ui/InitActivity.kt +++ b/app/src/main/java/com/shuwei/dish/match/ui/InitActivity.kt @@ -17,6 +17,7 @@ import com.shuwei.dish.match.base.GlobalData import com.shuwei.dish.match.databinding.ActivityInitBinding import com.shuwei.dish.match.objbox.FoodModule import com.shuwei.dish.match.scale.ScaleServiceManager +import com.shuwei.dish.match.utils.AddressUtil import com.shuwei.dish.match.utils.AppUtil import com.shuwei.dish.match.utils.NetworkUtils import com.shuwei.dish.match.utils.SpTool @@ -57,7 +58,9 @@ class InitActivity : BaseActivity() { WeightUtil.init() WeightUtil.getWeight() WeightUtil.startContinuousRead() - + //对净材秤1和熟食秤2称进行清零 + WeightUtil.tareTwo(AddressUtil.ONE) + WeightUtil.tareTwo(AddressUtil.TWO) initViews() } diff --git a/app/src/main/java/com/shuwei/dish/match/ui/PrepareCookActivity.kt b/app/src/main/java/com/shuwei/dish/match/ui/PrepareCookActivity.kt index 0ed4e8d..5b03a28 100644 --- a/app/src/main/java/com/shuwei/dish/match/ui/PrepareCookActivity.kt +++ b/app/src/main/java/com/shuwei/dish/match/ui/PrepareCookActivity.kt @@ -265,7 +265,8 @@ class PrepareCookActivity : BaseActivity() { private fun showRemindDialog() { CommonDialog(this) - .setTitle("温馨提示") + .setTitle("制作提示") + .setContent(getString(R.string.food_remind_01)) .setNegativeButton("返回调整") .setPositiveButton("确认无误") { openSubmitPage() } .setOnDismissCallback { hideStatusBar() } diff --git a/app/src/main/res/anim/dialog_in.xml b/app/src/main/res/anim/dialog_in.xml new file mode 100644 index 0000000..1c9e983 --- /dev/null +++ b/app/src/main/res/anim/dialog_in.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/app/src/main/res/anim/dialog_out.xml b/app/src/main/res/anim/dialog_out.xml new file mode 100644 index 0000000..bfef683 --- /dev/null +++ b/app/src/main/res/anim/dialog_out.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/app/src/main/res/drawable/ripple_btn_bottom.xml b/app/src/main/res/drawable/ripple_btn_bottom.xml new file mode 100644 index 0000000..2f5434a --- /dev/null +++ b/app/src/main/res/drawable/ripple_btn_bottom.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ripple_btn_left.xml b/app/src/main/res/drawable/ripple_btn_left.xml new file mode 100644 index 0000000..f2d7a1b --- /dev/null +++ b/app/src/main/res/drawable/ripple_btn_left.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ripple_btn_right.xml b/app/src/main/res/drawable/ripple_btn_right.xml new file mode 100644 index 0000000..ad9a682 --- /dev/null +++ b/app/src/main/res/drawable/ripple_btn_right.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/shape_dialog_bg.xml b/app/src/main/res/drawable/shape_dialog_bg.xml new file mode 100644 index 0000000..c2527aa --- /dev/null +++ b/app/src/main/res/drawable/shape_dialog_bg.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_dish_sampling.xml b/app/src/main/res/layout/activity_dish_sampling.xml index 6cfe9f8..88664a6 100644 --- a/app/src/main/res/layout/activity_dish_sampling.xml +++ b/app/src/main/res/layout/activity_dish_sampling.xml @@ -117,7 +117,7 @@ android:layout_height="1dp" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" - android:background="@color/gray_eb" /> + app:dividerColor="@color/gray_eb" /> + app:dividerColor="@color/gray_eb" /> + + + + android:textSize="26sp" + tools:text="这是弹窗的内容信息,请确认"/> - + @@ -40,35 +47,38 @@ + + android:textColor="@color/black666" + android:textSize="28sp" + tools:text="取消" /> - + + android:textSize="28sp" + android:textStyle="bold" + tools:text="确认"/> @@ -79,42 +89,45 @@ android:orientation="vertical" android:visibility="gone"> + + android:gravity="center" + android:textColor="@color/black666" + android:textSize="28sp" /> - + + android:textSize="28sp" /> - + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 47d4c19..d56ed2f 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -52,4 +52,9 @@ @android:anim/fade_in @android:anim/fade_out + + \ No newline at end of file