|
@@ -9,6 +9,7 @@ import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
import androidx.room.Update
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
+import com.develop.base.ext.getSN
|
|
|
import com.develop.base.ext.isBrand036I
|
|
|
import com.develop.base.ext.isFrLanguage
|
|
|
import com.develop.base.ext.isNightTheme
|
|
@@ -76,6 +77,11 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
+ if (getSN().startsWith("002D")){
|
|
|
+ binding.ivTab.setImageResource(com.develop.common.R.drawable.ic_more_002d)
|
|
|
+ binding.homeLayout.setBackgroundResource(com.develop.common.R.drawable.home_entrance_bg_002d)
|
|
|
+ }
|
|
|
+
|
|
|
if (isNightTheme()) {
|
|
|
binding.entranceRecycle.apply {
|
|
|
linear(RecyclerView.HORIZONTAL)
|
|
@@ -156,6 +162,89 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
|
|
|
}
|
|
|
}
|
|
|
}.models = DataFactory.getNightEntranceData()
|
|
|
+ } else if (getSN().startsWith("002D")){
|
|
|
+ binding.entranceRecycle.apply {
|
|
|
+ grid(2)
|
|
|
+ setup {
|
|
|
+ addType<EntranceData>(R.layout.item_entrance_002d)
|
|
|
+ onBind {
|
|
|
+ val model = getModel<EntranceData>()
|
|
|
+ findView<AppCompatTextView>(R.id.tv_entrance_name).updateText(
|
|
|
+ getString(
|
|
|
+ model.titleStrId
|
|
|
+ )
|
|
|
+ )
|
|
|
+ findView<ImageView>(R.id.iv_icon).setBackgroundResource(model.iconResId)
|
|
|
+ }
|
|
|
+ R.id.entrance_item.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()) {
|
|
|
+ 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",resources.getString(com.develop.common.R.string.adapted_cooking))
|
|
|
+ with(bundle)
|
|
|
+ }else{
|
|
|
+ val bundle = Bundle()
|
|
|
+ bundle.putString(MODE_TYPE, WorkModes.AF_DIY)
|
|
|
+ with(bundle)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ showLoading()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ EntranceType.download_new_recipes -> {
|
|
|
+ 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.get002DEntranceData()
|
|
|
} else {
|
|
|
binding.entranceRecycle.apply {
|
|
|
grid(2)
|