|
@@ -451,7 +451,6 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
}
|
|
}
|
|
}.models =
|
|
}.models =
|
|
if (sn.startsWith("011")) DataFactory.get011NightEntranceData()
|
|
if (sn.startsWith("011")) DataFactory.get011NightEntranceData()
|
|
- else if (sn.startsWith("054")) DataFactory.get054NightEntranceData()
|
|
|
|
else DataFactory.getNightEntranceData()
|
|
else DataFactory.getNightEntranceData()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -728,7 +727,119 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}.models = DataFactory.get029CEntranceData()
|
|
}.models = DataFactory.get029CEntranceData()
|
|
- } else if (sn.startsWith("049")) {
|
|
|
|
|
|
+ } else if (sn.startsWith("054")) {
|
|
|
|
+ binding.entranceRecycle.apply {
|
|
|
|
+ linear(RecyclerView.HORIZONTAL)
|
|
|
|
+ setup {
|
|
|
|
+ addType<EntranceData>(com.develop.common.R.layout.item_entrance_night_view_054)
|
|
|
|
+ onBind {
|
|
|
|
+ val model = getModel<EntranceData>()
|
|
|
|
+ findView<ImageView>(com.develop.common.R.id.iv_bg).src = model.bgResId
|
|
|
|
+ var appCompatTextView =
|
|
|
|
+ findView<AppCompatTextView>(com.develop.common.R.id.tv_title)
|
|
|
|
+ if (sn.startsWith("025")) {
|
|
|
|
+ appCompatTextView.setGone()
|
|
|
|
+ } else {
|
|
|
|
+ appCompatTextView.setText(model.titleStrId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ R.id.content_view.onClick {
|
|
|
|
+ val clickModel = getModel<EntranceData>()
|
|
|
|
+ title = getString(clickModel.title2StrId)
|
|
|
|
+ when (clickModel.type) {
|
|
|
|
+ EntranceType.automatic_recipes -> {
|
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putInt(MODE_ENTRANCE, Recipes)
|
|
|
|
+ bundle.putInt(RECIPES_TYPE, LocalFood)
|
|
|
|
+ bundle.putString(HOME_TITLE, title)
|
|
|
|
+ navigateTo(Screens.Main.HOME) {
|
|
|
|
+ with(bundle)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showLoading()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ EntranceType.automatic_programmes -> {
|
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putInt(MODE_ENTRANCE, Mode)
|
|
|
|
+ bundle.putString(HOME_TITLE, title)
|
|
|
|
+ navigateTo(Screens.Main.HOME) {
|
|
|
|
+ with(bundle)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showLoading()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ EntranceType.manual_cooking -> {
|
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var modeName =
|
|
|
|
+ if (sn.startsWith("011")) resources.getString(com.develop.common.R.string.manual_cooking_011)
|
|
|
|
+ .replace(
|
|
|
|
+ "\n",
|
|
|
|
+ " "
|
|
|
|
+ ) else resources.getString(com.develop.common.R.string.adapted_cooking)
|
|
|
|
+ navigateTo(Screens.Cook.COOK_MODES) {
|
|
|
|
+
|
|
|
|
+ if (DevModes.SOUP == CofarSDK.devInfo().devMode) {
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putString(
|
|
|
|
+ MODE_TYPE,
|
|
|
|
+ WorkModes.ADAPTED_COOKING
|
|
|
|
+ )
|
|
|
|
+ bundle.putString(
|
|
|
|
+ "mode_name",
|
|
|
|
+ modeName
|
|
|
|
+ )
|
|
|
|
+ with(bundle)
|
|
|
|
+ } else {
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putString(MODE_TYPE, WorkModes.AF_DIY)
|
|
|
|
+ with(bundle)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showLoading()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ EntranceType.download_new_recipes -> {
|
|
|
|
+ if (sn.startsWith("011")) {
|
|
|
|
+ if (NetworkUtils.isWifiConnected()) {
|
|
|
|
+ if (!AppVersionUtil.dialogRecipeUpdate.isShow) {
|
|
|
|
+ AppVersionUtil.checkAboutRecipeUpdate(true)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ GlobalToast.showToast(getString(com.develop.common.R.string.network_error))
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putInt(MODE_ENTRANCE, Recipes)
|
|
|
|
+ bundle.putInt(RECIPES_TYPE, NetFood)
|
|
|
|
+ bundle.putString(HOME_TITLE, title)
|
|
|
|
+ navigateTo(Screens.Main.HOME) {
|
|
|
|
+ with(bundle)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showLoading()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }.models = DataFactory.get054NightEntranceData()
|
|
|
|
+ }else if (sn.startsWith("049")) {
|
|
binding.entranceRecycle049.apply {
|
|
binding.entranceRecycle049.apply {
|
|
// linear(RecyclerView.HORIZONTAL)
|
|
// linear(RecyclerView.HORIZONTAL)
|
|
grid(4)
|
|
grid(4)
|