|
@@ -6,6 +6,7 @@ import android.util.Log
|
|
|
import android.view.KeyEvent
|
|
|
import android.view.View
|
|
|
import android.widget.Toast
|
|
|
+import androidx.core.view.isInvisible
|
|
|
import com.alibaba.android.arouter.facade.annotation.Autowired
|
|
|
import com.develop.base.ext.load
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
@@ -73,6 +74,7 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
var portionSizelJson: String? = null
|
|
|
|
|
|
private var titleName = ""
|
|
|
+ private var currModes = ""
|
|
|
|
|
|
private fun turnDevModeUI(){
|
|
|
|
|
@@ -110,6 +112,7 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
} else {
|
|
|
binding.viewChangeCrush.setBgColor(R.color.white)
|
|
|
binding.viewChangeWeight.setBgColor(R.color.white)
|
|
|
+ binding.viewWeightClose.setBgColor(R.color.white)
|
|
|
binding.viewChangeWeight.src = R.drawable.ic_detail_tab1
|
|
|
binding.viewChangeCrush.src = R.drawable.ic_cooking_weight
|
|
|
binding.viewNote.setVisible()
|
|
@@ -189,8 +192,21 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ binding.viewWeightClose.setOnClickListener {
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
+ binding.viewWeightClose.setGone()
|
|
|
+ binding.viewChangeCrush.setVisible()
|
|
|
+ }
|
|
|
+
|
|
|
binding.viewChangeCrush.setOnClickListener {
|
|
|
if (isNightTheme()){
|
|
|
+ if (currModes != "WIGHT" && currModes != "WEIGH" && currModes != "WEIGHT") {
|
|
|
+ binding.viewWeightClose.setVisible()
|
|
|
+ binding.viewChangeCrush.visibility = View.INVISIBLE
|
|
|
+ }
|
|
|
//此主题下,点餐是称重
|
|
|
if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
@@ -248,6 +264,7 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
viewModel.queryRecipeCookStep(recipeNumber ?: "", currentStepIndex)
|
|
|
viewModel.stepDisplay.observe(this) { it ->
|
|
|
coverPath = FoodDataProvider.getImagePath(it.source.photoVideoFilePath)
|
|
|
+ currModes = it.workMode
|
|
|
if (it.workMode == "Final Step") {
|
|
|
val stepCount = viewModel.getStepCount()
|
|
|
val stepIndex = viewModel.allSteps.indexOf(it)
|