优化
This commit is contained in:
@@ -102,7 +102,7 @@ class MainScreenPresentation(
|
|||||||
// private var userNutritionData: UserNutritionData? = null
|
// private var userNutritionData: UserNutritionData? = null
|
||||||
private var userNutrition: UserNutrition? = null
|
private var userNutrition: UserNutrition? = null
|
||||||
private var dinnerTypeInfo: DinnerType? = null
|
private var dinnerTypeInfo: DinnerType? = null
|
||||||
private val debouncer = Debouncer(3000)
|
private val debouncer = Debouncer(1500)
|
||||||
private var recognitionTime: Long = 0L // 人脸识别时的时间
|
private var recognitionTime: Long = 0L // 人脸识别时的时间
|
||||||
var recognitionWeight: Int = 0 // 人脸识别时的重量
|
var recognitionWeight: Int = 0 // 人脸识别时的重量
|
||||||
|
|
||||||
@@ -771,7 +771,6 @@ class MainScreenPresentation(
|
|||||||
if (currentFood == null || userNutrition == null) {
|
if (currentFood == null || userNutrition == null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
debouncer.debounce {
|
|
||||||
var weight = value
|
var weight = value
|
||||||
if (weight < 0) weight = 0
|
if (weight < 0) weight = 0
|
||||||
if (activity.settlementMode == 0) {
|
if (activity.settlementMode == 0) {
|
||||||
@@ -779,6 +778,7 @@ class MainScreenPresentation(
|
|||||||
addFoodToOrder(weight, currentFood!!)
|
addFoodToOrder(weight, currentFood!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
debouncer.debounce {
|
||||||
Timber.tag(TAG)
|
Timber.tag(TAG)
|
||||||
.d("calculateNutrition weight = $weight, recognitionWeight = $recognitionWeight")
|
.d("calculateNutrition weight = $weight, recognitionWeight = $recognitionWeight")
|
||||||
val dinnerType = dinnerTypeInfo?.dinnerType
|
val dinnerType = dinnerTypeInfo?.dinnerType
|
||||||
|
|||||||
Reference in New Issue
Block a user