优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user