|
@@ -13,8 +13,10 @@ import com.bumptech.glide.Glide
|
|
|
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
|
|
import com.develop.base.ext.background_drawable
|
|
|
import com.develop.base.ext.isNightTheme
|
|
|
+import com.develop.base.ext.navigateTo
|
|
|
import com.develop.base.ext.setGone
|
|
|
import com.develop.base.ext.setVisible
|
|
|
+import com.develop.base.ext.src
|
|
|
import com.develop.base.ext.updateText
|
|
|
import com.develop.base.util.MusicBackPlayerUtil
|
|
|
import com.develop.base.util.ThreadUtils
|
|
@@ -83,8 +85,10 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
//隐藏称重与电动
|
|
|
-// binding.viewChangeCrush.setGone()
|
|
|
-// binding.viewChangeWeight.setGone()
|
|
|
+ if (!isNightTheme()){
|
|
|
+ binding.viewChangeCrush.setGone()
|
|
|
+ binding.viewChangeWeight.setGone()
|
|
|
+ }
|
|
|
|
|
|
if (!isNightTheme()){
|
|
|
binding.viewChangeCrush.setBgColor(R.color.view_change)
|
|
@@ -92,6 +96,8 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
} else {
|
|
|
binding.viewChangeCrush.setBgColor(R.color.white)
|
|
|
binding.viewChangeWeight.setBgColor(R.color.white)
|
|
|
+ binding.viewChangeWeight.src = R.drawable.ic_detail_tab1
|
|
|
+ binding.viewChangeCrush.src = R.drawable.ic_cooking_weight
|
|
|
binding.viewNote.setVisible()
|
|
|
}
|
|
|
|
|
@@ -139,47 +145,76 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
}
|
|
|
|
|
|
binding.viewChangeWeight.setOnClickListener {
|
|
|
- if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
- Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
|
- return@setOnClickListener
|
|
|
- }
|
|
|
- val weightSelected = binding.viewChangeWeight.isSelected
|
|
|
- if (weightSelected) {
|
|
|
- CofarSDK.stoptWeight()
|
|
|
- viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
- } else {
|
|
|
- binding.ivPrevStep.setGone()
|
|
|
- binding.ivNextStep.setGone()
|
|
|
- CofarSDK.changeMode(
|
|
|
- "$recipeNumber:${viewModel.stepIndex}",
|
|
|
- CofarSDK.devMode("WEIGHT")
|
|
|
- )
|
|
|
- changeWeightPanel()
|
|
|
- CofarSDK.stoptWeight()
|
|
|
- CofarSDK.startWeight()
|
|
|
+ if (isNightTheme()){
|
|
|
+ //此主题下,点击显示食材
|
|
|
+ navigateTo(Screens.Cook.COOK_SOURCE)
|
|
|
+ }else{
|
|
|
+ if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
+ Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ val weightSelected = binding.viewChangeWeight.isSelected
|
|
|
+ if (weightSelected) {
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
+ } else {
|
|
|
+ binding.ivPrevStep.setGone()
|
|
|
+ binding.ivNextStep.setGone()
|
|
|
+ CofarSDK.changeMode(
|
|
|
+ "$recipeNumber:${viewModel.stepIndex}",
|
|
|
+ CofarSDK.devMode("WEIGHT")
|
|
|
+ )
|
|
|
+ changeWeightPanel()
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ CofarSDK.startWeight()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
binding.viewChangeCrush.setOnClickListener {
|
|
|
- if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
- Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
|
- return@setOnClickListener
|
|
|
- }
|
|
|
- val turboSelected = binding.viewChangeCrush.isSelected
|
|
|
- if (turboSelected) {
|
|
|
- CofarSDK.stoptWeight()
|
|
|
- viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
+ if (isNightTheme()){
|
|
|
+ //此主题下,点餐是称重
|
|
|
+ if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
+ Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ val weightSelected = binding.viewChangeWeight.isSelected
|
|
|
+ if (weightSelected) {
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
+ } else {
|
|
|
+ binding.ivPrevStep.setGone()
|
|
|
+ binding.ivNextStep.setGone()
|
|
|
+ CofarSDK.changeMode(
|
|
|
+ "$recipeNumber:${viewModel.stepIndex}",
|
|
|
+ CofarSDK.devMode("WEIGHT")
|
|
|
+ )
|
|
|
+ changeWeightPanel()
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ CofarSDK.startWeight()
|
|
|
+ }
|
|
|
} else {
|
|
|
- binding.ivPrevStep.setGone()
|
|
|
- binding.ivNextStep.setGone()
|
|
|
- CofarSDK.changeMode(
|
|
|
- "$recipeNumber:${viewModel.stepIndex}",
|
|
|
- CofarSDK.devMode("TURBO")
|
|
|
- )
|
|
|
- CofarSDK.stoptWeight()
|
|
|
- changeTurboPanel()
|
|
|
+ if (CofarSDK.devInfo().status == DevStatus.RUNNING.toInt()) {
|
|
|
+ Toast.makeText(this, "Step is running!", Toast.LENGTH_SHORT).show()
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ val turboSelected = binding.viewChangeCrush.isSelected
|
|
|
+ if (turboSelected) {
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ viewModel.setDisplayStep(viewModel.stepIndex, force = true)
|
|
|
+ } else {
|
|
|
+ binding.ivPrevStep.setGone()
|
|
|
+ binding.ivNextStep.setGone()
|
|
|
+ CofarSDK.changeMode(
|
|
|
+ "$recipeNumber:${viewModel.stepIndex}",
|
|
|
+ CofarSDK.devMode("TURBO")
|
|
|
+ )
|
|
|
+ CofarSDK.stoptWeight()
|
|
|
+ changeTurboPanel()
|
|
|
+ }
|
|
|
+ binding.viewChangeWeight.isSelected = false
|
|
|
+ binding.viewChangeCrush.isSelected = !turboSelected
|
|
|
}
|
|
|
- binding.viewChangeWeight.isSelected = false
|
|
|
- binding.viewChangeCrush.isSelected = !turboSelected
|
|
|
+
|
|
|
}
|
|
|
initData()
|
|
|
initStepData()
|