|
@@ -21,11 +21,13 @@ import com.develop.base.ext.resId2Dimension
|
|
|
import com.develop.base.ext.setGone
|
|
|
import com.develop.base.ext.src
|
|
|
import com.develop.base.manager.WifiHelp
|
|
|
+import com.develop.base.util.DevModesEvent
|
|
|
import com.develop.base.widgets.CommonPopupWindow
|
|
|
import com.develop.common.data_repo.FoodDataProvider
|
|
|
import com.develop.common.data_repo.db.NewsModel
|
|
|
import com.develop.common.data_repo.db.RecipesType
|
|
|
import com.develop.common.data_repo.db.entity.UserInfo
|
|
|
+import com.develop.common.dialog.CancelConfirmDialog
|
|
|
import com.develop.common.router.Screens
|
|
|
import com.develop.common.tag.*
|
|
|
import com.develop.common.ui.CommonBVMActivity
|
|
@@ -35,6 +37,7 @@ import com.develop.common.widget.NewsLayout
|
|
|
import com.develop.main.R
|
|
|
import com.develop.main.databinding.ActivityHomeBinding
|
|
|
import com.develop.main.viewmodel.HomeViewModel
|
|
|
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevModes
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.constant.core.WorkModes
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
|
|
@@ -449,6 +452,46 @@ class HomeActivity : CommonBVMActivity<ActivityHomeBinding, HomeViewModel>() {
|
|
|
|
|
|
class HomeBackClickEvent(showOnline: Boolean)
|
|
|
|
|
|
+ //5037 点击切换模式eb传递
|
|
|
+ @Subscribe
|
|
|
+ fun onDevModes(event: DevModesEvent) {
|
|
|
+ if (CofarSDK.devInfo().devMode == DevModes.SOUP){
|
|
|
+ showDevModeDialog(getString(com.develop.common.R.string.dev_air_parts))
|
|
|
+
|
|
|
+ }else if (CofarSDK.devInfo().devMode == DevModes.AIR_FRYER){
|
|
|
+ showDevModeDialog(getString(com.develop.common.R.string.dev_soup_parts))
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ fun showDevModeDialog(title :String){
|
|
|
+ var cancelConfirmDialog = CancelConfirmDialog()
|
|
|
+ cancelConfirmDialog.showCancel = false
|
|
|
+ cancelConfirmDialog.showConfirm = true
|
|
|
+ cancelConfirmDialog.confirmStr = resources.getString(
|
|
|
+ resources.getIdentifier(
|
|
|
+ "ok", "string", this.packageName
|
|
|
+ )
|
|
|
+ )
|
|
|
+ cancelConfirmDialog.title = title
|
|
|
+ cancelConfirmDialog.showDialog(supportFragmentManager, "confirmCancelDialog")
|
|
|
+ cancelConfirmDialog.onDialogClickListener =
|
|
|
+ object : CancelConfirmDialog.OnDialogClickListener {
|
|
|
+ override fun onConfirm() {
|
|
|
+ cancelConfirmDialog.removeSelf();
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onCancel() {
|
|
|
+ cancelConfirmDialog.removeSelf();
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onKey() {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
override fun onDestroy() {
|
|
|
super.onDestroy()
|
|
|
wifiHelp.destroy()
|