|
@@ -68,7 +68,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isNightTheme()){
|
|
|
+ if (isNightTheme()) {
|
|
|
binding.entranceRecycle.apply {
|
|
|
linear(RecyclerView.HORIZONTAL)
|
|
|
setup {
|
|
@@ -96,6 +96,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
showLoading()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
EntranceType.automatic_programmes -> {
|
|
|
val bundle = Bundle()
|
|
|
bundle.putInt(MODE_ENTRANCE, Mode)
|
|
@@ -105,6 +106,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
}
|
|
|
finish()
|
|
|
}
|
|
|
+
|
|
|
EntranceType.manual_cooking -> {
|
|
|
navigateTo(Screens.Cook.COOK_MODES) {
|
|
|
val bundle = Bundle()
|
|
@@ -112,6 +114,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
with(bundle)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
EntranceType.download_new_recipes -> {
|
|
|
val bundle = Bundle()
|
|
|
bundle.putInt(MODE_ENTRANCE, Recipes)
|
|
@@ -157,31 +160,49 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
showLoading()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
EntranceType.automatic_programmes -> {
|
|
|
- val bundle = Bundle()
|
|
|
- bundle.putInt(MODE_ENTRANCE, Mode)
|
|
|
- bundle.putString(HOME_TITLE, title)
|
|
|
- navigateTo(Screens.Main.HOME) {
|
|
|
- with(bundle)
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
+ val bundle = Bundle()
|
|
|
+ bundle.putInt(MODE_ENTRANCE, Mode)
|
|
|
+ bundle.putString(HOME_TITLE, title)
|
|
|
+ navigateTo(Screens.Main.HOME) {
|
|
|
+ with(bundle)
|
|
|
+ }
|
|
|
+ finish()
|
|
|
+ } else {
|
|
|
+ showLoading()
|
|
|
}
|
|
|
- finish()
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
EntranceType.manual_cooking -> {
|
|
|
- navigateTo(Screens.Cook.COOK_MODES) {
|
|
|
- val bundle = Bundle()
|
|
|
- bundle.putString(MODE_TYPE, "ADAPTED_COOKING")
|
|
|
- with(bundle)
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
+ navigateTo(Screens.Cook.COOK_MODES) {
|
|
|
+ val bundle = Bundle()
|
|
|
+ bundle.putString(MODE_TYPE, "ADAPTED_COOKING")
|
|
|
+ with(bundle)
|
|
|
+ }
|
|
|
+ finish()
|
|
|
+ } else {
|
|
|
+ showLoading()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
EntranceType.download_new_recipes -> {
|
|
|
- val bundle = Bundle()
|
|
|
- bundle.putInt(MODE_ENTRANCE, Recipes)
|
|
|
- bundle.putInt(RECIPES_TYPE, NetFood)
|
|
|
- bundle.putString(HOME_TITLE, title)
|
|
|
- navigateTo(Screens.Main.HOME) {
|
|
|
- with(bundle)
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ finish()
|
|
|
+ } else {
|
|
|
+ showLoading()
|
|
|
}
|
|
|
- finish()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -241,7 +262,18 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
}
|
|
|
|
|
|
binding.ivTab.setOnClickListener {
|
|
|
- binding.contentView.openDrawer(binding.rightContentLayout)
|
|
|
+ if (FoodDataProvider.checkDataExit()) {
|
|
|
+ binding.contentView.openDrawer(binding.rightContentLayout)
|
|
|
+ } else {
|
|
|
+ showLoading()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isNightTheme()) {
|
|
|
+ binding.tvFavourite.textSize = HomeActivity.dp20
|
|
|
+ binding.tvSetting.textSize = HomeActivity.dp20
|
|
|
+ binding.tvHistory.textSize = HomeActivity.dp20
|
|
|
+ binding.tvPolicy.textSize = HomeActivity.dp20
|
|
|
+ binding.tvHelp.textSize = HomeActivity.dp20
|
|
|
}
|
|
|
}
|
|
|
|