This commit is contained in:
mazengfei
2026-04-01 17:11:00 +08:00
parent 3ef93c5f5e
commit 12da153df3
@@ -102,7 +102,7 @@ class MainScreenPresentation(
// private var userNutritionData: UserNutritionData? = null
private var userNutrition: UserNutrition? = null
private var dinnerTypeInfo: DinnerType? = null
private val debouncer = Debouncer(3000)
private val debouncer = Debouncer(1500)
private var recognitionTime: Long = 0L // 人脸识别时的时间
var recognitionWeight: Int = 0 // 人脸识别时的重量
@@ -771,14 +771,14 @@ class MainScreenPresentation(
if (currentFood == null || userNutrition == null) {
return
}
debouncer.debounce {
var weight = value
if (weight < 0) weight = 0
if (activity.settlementMode == 0) {
activity.runOnUiThread {
addFoodToOrder(weight, currentFood!!)
}
var weight = value
if (weight < 0) weight = 0
if (activity.settlementMode == 0) {
activity.runOnUiThread {
addFoodToOrder(weight, currentFood!!)
}
}
debouncer.debounce {
Timber.tag(TAG)
.d("calculateNutrition weight = $weight, recognitionWeight = $recognitionWeight")
val dinnerType = dinnerTypeInfo?.dinnerType