|
@@ -69,6 +69,8 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
@Autowired(name = "portionSizelJson")
|
|
|
var portionSizelJson: String? = null
|
|
|
|
|
|
+ private var titleName = ""
|
|
|
+
|
|
|
private fun turnDevModeUI(){
|
|
|
|
|
|
if(CofarSDK.devInfo().devMode == DevModes.AIR_FRYER){
|
|
@@ -241,14 +243,16 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
viewModel.queryRecipeCookStep(recipeNumber ?: "", currentStepIndex)
|
|
|
viewModel.stepDisplay.observe(this) { it ->
|
|
|
coverPath = FoodDataProvider.getImagePath(it.source.photoVideoFilePath)
|
|
|
- if (it.workMode == "FINISH_DESC") {
|
|
|
+ if (it.workMode == "Final Step") {
|
|
|
val stepCount = viewModel.getStepCount()
|
|
|
val stepIndex = viewModel.allSteps.indexOf(it)
|
|
|
changeDescription()
|
|
|
cookProgressDrawable.setStepState(stepIndex, stepCount)
|
|
|
binding.tvStepName.text = getText(R.string.engjoy_your_meal)
|
|
|
binding.tvTitleStep.text = getText(R.string.recipe_complete)
|
|
|
-
|
|
|
+ binding.viewChangeCrush.setGone()
|
|
|
+ binding.viewChangeWeight.setGone()
|
|
|
+ binding.viewRemark.setGone()
|
|
|
if (stepCount == 1) {
|
|
|
binding.ivPrevStep.setGone()
|
|
|
binding.ivNextStep.setGone()
|
|
@@ -274,6 +278,10 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
)
|
|
|
}
|
|
|
} else {
|
|
|
+ binding.tvTitleStep.text = titleName
|
|
|
+ binding.viewChangeCrush.setVisible()
|
|
|
+ binding.viewChangeWeight.setVisible()
|
|
|
+ binding.viewRemark.setVisible()
|
|
|
if (CofarSDK.devInfo().status == DevStatus.STOP.toInt()) {
|
|
|
CofarSDK.changeModeWithoutCfg(
|
|
|
"$recipeNumber:${viewModel.stepIndex}",
|
|
@@ -416,6 +424,7 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
}
|
|
|
}
|
|
|
viewModel.recipeLiveData.observe(this) {
|
|
|
+ titleName = it.name.toString()
|
|
|
binding.tvTitleStep.text = it.name
|
|
|
}
|
|
|
}
|
|
@@ -441,7 +450,13 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
configing = true;
|
|
|
if (viewModel.allSteps.isNotEmpty()){
|
|
|
viewModel.allSteps.get(viewModel.stepIndex)?.let {
|
|
|
-
|
|
|
+ if (it.workMode == "Final Step") {
|
|
|
+ //享用美食页面
|
|
|
+ notifyAllCookStepComplete()
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ binding.llStepFinish.setGone()
|
|
|
+ }
|
|
|
it.uiData.applyRecipeSetting(it.source)
|
|
|
|
|
|
if (!it.isWeightMode() && !it.isDescription()) {
|
|
@@ -994,13 +1009,13 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
* 所有步骤已经结束,展示结束页面
|
|
|
*/
|
|
|
private fun notifyAllCookStepComplete() {
|
|
|
- binding.controller.root.setGone()
|
|
|
- binding.tvStepName.setGone()
|
|
|
- binding.viewChangeCrush.setGone()
|
|
|
- binding.viewChangeWeight.setGone()
|
|
|
- binding.viewRemark.setGone()
|
|
|
- binding.ivTurboView.setGone()
|
|
|
- binding.llWeightView.setGone()
|
|
|
+// binding.controller.root.setGone()
|
|
|
+// binding.tvStepName.setGone()
|
|
|
+// binding.viewChangeCrush.setGone()
|
|
|
+// binding.viewChangeWeight.setGone()
|
|
|
+// binding.viewRemark.setGone()
|
|
|
+// binding.ivTurboView.setGone()
|
|
|
+// binding.llWeightView.setGone()
|
|
|
binding.llStepFinish.setVisible()
|
|
|
binding.ivAddToFav.setOnClickListener {
|
|
|
if (isLike) {
|
|
@@ -1010,10 +1025,10 @@ class CookStepActivity : CookStepBaseActivity() {
|
|
|
CURRENT_USER_ID, recipeNumber ?: ""
|
|
|
)
|
|
|
}
|
|
|
- binding.ivAddToFav.background_drawable = R.drawable.ic_cook_fav
|
|
|
+ binding.ivAddToFav.src = R.drawable.ic_cook_fav
|
|
|
} else {
|
|
|
isLike = true
|
|
|
- binding.ivAddToFav.background_drawable = R.drawable.ic_like
|
|
|
+ binding.ivAddToFav.src = R.drawable.ic_like
|
|
|
FoodDataProvider.getUserDatabase().runInTransaction {
|
|
|
FoodDataProvider.getUserDatabase().userInfoDao().insertFavoriteRecipe(
|
|
|
UserFavoriteRecipes(CURRENT_USER_ID, recipeNumber ?: "")
|