实现了热量值计算
This commit is contained in:
@@ -54,6 +54,7 @@ class MainActivity : AppCompatActivity() {
|
||||
private var checkedItem: FoodInfo? = null
|
||||
private var imageAnalysis: ImageAnalysis? = null
|
||||
private var cameraProviderFuture: ListenableFuture<ProcessCameraProvider>? = null
|
||||
private var canIdentify: Boolean = true
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -156,14 +157,15 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
viewModel.getIdentifiedFoodList()
|
||||
// SensorScaleUtils.startScale { weight ->
|
||||
SensorScaleUtils.startScale { weight ->
|
||||
// Timber.d("weight = $weight")
|
||||
// if (weight > 0.0) {
|
||||
// if (canIndentify) {
|
||||
// viewModel.getIdentifiedFoodList()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (weight > 0.0) {
|
||||
if (canIdentify) {
|
||||
canIdentify = false
|
||||
viewModel.getIdentifiedFoodList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun createAdapter(): GenericItemAdapter<FoodInfo, ItemFoodInfoBinding> {
|
||||
|
||||
Reference in New Issue
Block a user