123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694 |
- package com.develop.main.ui
- import android.content.Intent
- import android.os.Bundle
- import android.util.DisplayMetrics
- import android.view.LayoutInflater
- import android.view.View
- import android.view.ViewGroup.LayoutParams
- import android.widget.ImageView
- import androidx.appcompat.widget.AppCompatTextView
- 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.getGoneLogin
- import com.develop.base.ext.getModelNum
- import com.develop.base.ext.getSN
- import com.develop.base.ext.isBrand011A
- import com.develop.base.ext.isBrand036I
- import com.develop.base.ext.isBrand054A
- import com.develop.base.ext.isFrLanguage
- import com.develop.base.ext.isNightTheme
- import com.develop.base.ext.navigateTo
- import com.develop.base.ext.src
- import com.develop.base.ext.updateText
- import com.develop.common.data_repo.FoodDataProvider
- import com.develop.base.util.MMkvUtils
- import com.develop.base.util.SerialportUtils
- import com.develop.base.util.SettingKeyBoardUtils
- import com.develop.base.util.TopResumedAtyHolder
- import com.develop.common.data_repo.db.DataFactory
- import com.develop.common.data_repo.db.RecipesType
- import com.develop.common.data_repo.db.entity.UserInfo
- import com.develop.common.dialog.LoadingDialog
- import com.develop.common.router.Screens
- import com.develop.common.tag.*
- import com.develop.common.ui.CommonBindingActivity
- import com.develop.common.utils.AppVersionUtil
- import com.develop.common.utils.UpdateUtil
- import com.develop.common.widget.EntranceData
- import com.develop.common.widget.EntranceItemView
- import com.develop.common.widget.EntranceType
- import com.develop.main.R
- import com.develop.main.databinding.ActivityModeEntranceBinding
- import com.drake.brv.utils.grid
- import com.drake.brv.utils.linear
- import com.drake.brv.utils.models
- import com.drake.brv.utils.setup
- import com.kuyuntech.cofarcooking.device.sdk.constant.core.CommonEventTypes
- 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.DevCommonEvent
- import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevPromptEvent
- import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
- import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
- import com.smarx.notchlib.utils.ScreenUtil
- import com.tuya.smartai.iot_sdk.Log
- import org.alee.component.skin.service.ThemeSkinService
- import org.greenrobot.eventbus.EventBus
- import org.greenrobot.eventbus.Subscribe
- import org.greenrobot.eventbus.ThreadMode
- @Route(path = Screens.Main.ENTRANCE_CHOSEN)
- class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>() {
- private val loadingDialog by lazy {
- LoadingDialog()
- }
- var prepareDataLiveData = MutableLiveData<Boolean>()
- override fun createViewBinding(inflater: LayoutInflater): ActivityModeEntranceBinding {
- return ActivityModeEntranceBinding.inflate(inflater)
- }
- private var title = ""
- private var isShowLoading = false
- private var isDevModes = true
- private var isModelNum = ""
- private var devMode = ""
- private var isResetZero = -1 //初始扭橙的值
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- MMkvUtils.save(FIRST_IN, true)
- //设置系统语言
- addListLocale()
- devMode = CofarSDK.devInfo().devMode
- isModelNum = getModelNum()
- isResetZero = CofarSDK.devInfo().resetZero.toInt()
- prepareDataLiveData = FoodDataProvider.getPrepareLiveData() as MutableLiveData<Boolean>
- prepareDataLiveData.observe(this) {
- loadingDialog.removeSelf()
- // if (FoodDataProvider.checkDataExit() && isShowLoading) {
- // isShowLoading = false
- // val bundle = Bundle()
- // bundle.putInt(MODE_ENTRANCE, Recipes)
- // bundle.putInt(RECIPES_TYPE, LocalFood)
- // bundle.putString(HOME_TITLE, title)
- // navigateTo(Screens.Main.HOME) {
- // with(bundle)
- // }
- // finish()
- // }
- }
- 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)
- setup {
- addType<EntranceData>(com.develop.common.R.layout.item_entrance_night_view)
- onBind {
- val model = getModel<EntranceData>()
- findView<ImageView>(com.develop.common.R.id.iv_bg).src = model.bgResId
- findView<AppCompatTextView>(com.develop.common.R.id.tv_title).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()) {
- 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.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 if (getSN().startsWith("032D")) {
- binding.entranceRecycle.apply {
- grid(2)
- setup {
- addType<EntranceData>(R.layout.item_entrance_032d)
- onBind {
- val model = getModel<EntranceData>()
- findView<ImageView>(com.develop.common.R.id.iv_bg).src = model.bgResId
- findView<AppCompatTextView>(com.develop.common.R.id.tv_title).setText(model.titleStrId)
- findView<ImageView>(com.develop.common.R.id.ic_icon).src = model.iconResId
- }
- 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()) {
- navigateTo(Screens.Cook.COOK_MODES) {
- if (CofarSDK.devInfo().devMode == DevModes.SOUP) {
- 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.get032DEntranceData()
- } else {
- binding.entranceRecycle.apply {
- grid(2)
- setup {
- addType<EntranceData>(R.layout.item_entrance)
- onBind {
- val itemView = findView<EntranceItemView>(R.id.entrance_item)
- val params = itemView.layoutParams as LayoutParams
- params.height = (ScreenUtil.getScreenSize(this@ModeEntranceActivity)[1] / 2)
- itemView.layoutParams = params
- itemView.setEntranceData(getModel())
- }
- 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 (CofarSDK.devInfo().devMode == DevModes.SOUP) {
- 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 =
- if (isBrand036I()) DataFactory.get036IEntranceData()
- else if (isBrand011A()) DataFactory.get011A5037EntranceData()
- else if (isBrand054A()) DataFactory.get054AEntranceData()
- else if (getSN().startsWith("045")) DataFactory.get045AEntranceData()
- else if (getSN().startsWith("032")) DataFactory.get032DEntranceData()
- else DataFactory.getEntranceData()
- }
- // if (isBrand011A()) DataFactory.get011AEntranceData()
- binding.rightContentLayout.setOnClickListener {
- }
- binding.settingLayout.setOnClickListener {
- navigateTo(Screens.Setting.MAIN_SETTING)
- binding.contentView.closeDrawers()
- }
- binding.favouriteLayout.setOnClickListener {
- val bundle = Bundle()
- bundle.putString(
- FOOL_LIST_TITLE, getString(com.develop.common.R.string.favourite_recipes)
- )
- bundle.putInt(FOOD_LIST_TYPE, Favourite)
- navigateTo(Screens.Cook.FOOD_LIST) {
- with(bundle)
- }
- binding.contentView.closeDrawers()
- }
- binding.historyLayout.setOnClickListener {
- val bundle = Bundle()
- bundle.putString(FOOL_LIST_TITLE, getString(com.develop.common.R.string.cook_history))
- bundle.putInt(FOOD_LIST_TYPE, History)
- navigateTo(Screens.Cook.FOOD_LIST) {
- with(bundle)
- }
- binding.contentView.closeDrawers()
- }
- binding.policyLayout.setOnClickListener {
- val bundle = Bundle()
- bundle.putBoolean(POLICY_FROM_MAIN_SETTING, true)
- navigateTo(Screens.Setting.POLICY) {
- with(bundle)
- }
- binding.contentView.closeDrawers()
- }
- binding.helpLayout.setOnClickListener {
- navigateTo(Screens.Setting.HELP)
- binding.contentView.closeDrawers()
- }
- binding.ivAvatar.setOnClickListener {
- navigateTo(Screens.Auth.MEMBER) {
- withBoolean("enter_from_home", true)
- }
- }
- binding.ivTab.setOnClickListener {
- if (FoodDataProvider.checkDataExit()) {
- binding.contentView.openDrawer(binding.rightContentLayout)
- } else {
- showLoading()
- }
- }
- //2024.01.04 客户需要把法语的字体变回来
- // if (isFrLanguage()) {
- // 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
- // }
- //032客户需要隐藏登录和注册
- if (getGoneLogin()) {
- binding.tvUserName.visibility = View.GONE
- //头像需要占位显示
- binding.ivAvatar.visibility = View.INVISIBLE
- }
- }
- override fun onResume() {
- devMode = CofarSDK.devInfo().devMode
- //需要页面重新打开再拿一次扭橙值,需要再父类前,因为父类重新注册EventBus
- isResetZero = CofarSDK.devInfo().resetZero.toInt()
- super.onResume()
- if (!AppVersionUtil.dialogRecipeUpdate.isShow){
- AppVersionUtil.checkRecipeUpdate(false)
- }
- // UpdateUtil.checkApkVersion(false)
- val userInfo = FoodDataProvider
- .getUserDatabase()
- .userInfoDao()
- .queryUserInfoByUserId(CURRENT_USER_ID)
- updateUserInfoUi(userInfo)
- }
- override fun onDestroy() {
- super.onDestroy()
- loadingDialog.removeSelf()
- }
- private fun updateUserInfoUi(userInfo: UserInfo?) {
- if (userInfo?.userName != null) {
- binding.tvUserName.text = userInfo.userName ?: ""
- val icon = when (userInfo.userAvatar?.toInt() ?: 0) {
- 0 -> {
- com.develop.common.R.drawable.ic_icon1
- }
- 1 -> {
- com.develop.common.R.drawable.ic_icon2
- }
- 2 -> {
- com.develop.common.R.drawable.ic_icon3
- }
- 3 -> {
- com.develop.common.R.drawable.ic_icon4
- }
- 4 -> {
- com.develop.common.R.drawable.ic_icon5
- }
- else -> {
- com.develop.common.R.drawable.ic_icon6
- }
- }
- binding.ivAvatar.src = icon
- } else {
- binding.ivAvatar.src = com.develop.common.R.drawable.ic_user
- binding.tvUserName.text = getString(com.develop.common.R.string.login)
- }
- }
- private fun showLoading() {
- isShowLoading = true
- loadingDialog.showDialog(supportFragmentManager, "Loading")
- }
- @Subscribe(threadMode = ThreadMode.MAIN)
- fun onDevStateEvent(event: DevStatusEvent) {
- Log.e("TAG devMode", "devMode :$devMode")
- ////devInfo.potStatus 0是有锅 1是没锅
- //当没有锅得时候,默认是汤锅模式 //切当前Fragment可见状态 // 只针对5037的处理
- if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 1) {
- // isDevModes 避免重复刷新
- if (isDevModes && devMode != DevModes.SOUP) {
- isDevModes = false
- CofarSDK.changeDevModeFocus(DevModes.SOUP)
- }
- } else if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 0) {
- /**
- * 由于客户无锅状态下是默认汤锅列表,但是在一进来是空炸锅,拿出来(无锅的时候已经换了汤锅模式),
- * 但重新放空炸锅,onDevModeChange 是不会回调的,固需要用potCoverType 锅盖协议来判断是否需要重新换模式
- * */
- //potCoverType 0 是汤锅 1是空炸
- if (event.devInfo.potCloverType.toInt() == 1 && devMode == DevModes.SOUP) {
- CofarSDK.changeDevModeFocus(DevModes.AIR_FRYER)
- } else if (event.devInfo.potCloverType.toInt() == 0 && devMode == DevModes.AIR_FRYER) {
- CofarSDK.changeDevModeFocus(DevModes.SOUP)
- }
- isDevModes = true
- }
- //处理扭橙问题 扭橙 resetZero ==1 //普通 resetZero ==0
- /**
- * 当扭橙的值不等于初始化的时候,就需要重新跳转ModesDetails
- * */
- if (event.devInfo.resetZero.toInt() == 1&&event.devInfo.resetZero.toInt()!=isResetZero) {
- navigateTo(Screens.Cook.COOK_MODES) {
- val bundle = Bundle()
- bundle.putString(MODE_TYPE, WorkModes.CITRUS_JUICER)
- bundle.putString(
- "mode_name",
- resources.getString(com.develop.common.R.string.citrus_juicer)
- )
- with(bundle)
- }
- }
- //处理扭橙逻辑 一进来是扭橙盖,重新打开,重新闭合 没办法跳转到扭橙页面
- isResetZero = event.devInfo.resetZero.toInt()
- }
- fun addListLocale() {
- //判断是否设置语言,如果重新设置需要重新写入系统语言,将选中放第一位
- if (MMkvUtils.getBool(LANGUAGE_SETTING, false)) {
- //设置语言
- var list = DataFactory.createLanguageDataV2(resources)
- var listStr = mutableListOf<String>()
- listStr.add("en")
- for (i in 1..list.size) {
- if (list[i - 1].value.lowercase() != "en") {
- listStr.add(list[i - 1].value.lowercase())
- }
- }
- //调试键盘问题,但没用
- val condition: (String) -> Boolean = {
- it == (MMkvUtils.getString(CURRENT_LANGUAGE)?.lowercase() ?: "en")
- }
- firstLocale(listStr, condition)
- //获取配置语言,然后设置系统语言,首语言默认英语
- SerialportUtils.getAddLocale(listStr)
- MMkvUtils.save(LANGUAGE_SETTING, false)
- }
- }
- fun firstLocale(list: MutableList<String>, condition: (String) -> Boolean) {
- val index = list.indexOfFirst(condition)
- if (index >= 0) {
- val element = list.removeAt(index)
- list.add(0, element)
- }
- }
- @Subscribe
- fun onDevModeChange(event: DevCommonEvent) {
- //在当前页面,换了模式以后 重新启动
- if (CommonEventTypes.DEV_MODE_CHANGE == event.type) {
- devMode = CofarSDK.devInfo().devMode
- }
- }
- }
|