|
@@ -13,6 +13,9 @@ import android.view.View
|
|
|
import android.view.inputmethod.InputMethodManager
|
|
|
import android.widget.EditText
|
|
|
import android.widget.Toast
|
|
|
+import androidx.fragment.app.DialogFragment
|
|
|
+import androidx.fragment.app.Fragment
|
|
|
+import androidx.fragment.app.FragmentManager
|
|
|
import androidx.viewbinding.ViewBinding
|
|
|
import com.develop.base.ext.getModelNum
|
|
|
import com.develop.base.ext.getSN
|
|
@@ -36,17 +39,14 @@ import com.develop.common.food_sdk.GlobalDevEvent
|
|
|
import com.develop.common.router.Screens
|
|
|
import com.develop.common.tag.CURRENT_USER_ID
|
|
|
import com.develop.common.tag.SCREENSAVER
|
|
|
-import com.develop.common.tag.TURN_UP_KEY_CODE
|
|
|
import com.develop.common.utils.NoScreenEvent
|
|
|
import com.develop.common.utils.TimeDownUtil
|
|
|
-import com.develop.common.utils.TuyaSoEvent
|
|
|
import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus
|
|
|
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 org.greenrobot.eventbus.EventBus
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
-import org.greenrobot.eventbus.ThreadMode
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -345,7 +345,7 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
|
|
|
}
|
|
|
|
|
|
// E7报错 5037 设备不显示
|
|
|
- if ( CofarSDK.devInfo().errCode.toInt() == 7 && isModelNum == "5037" ) {
|
|
|
+ if (CofarSDK.devInfo().errCode.toInt() == 7 && isModelNum == "5037") {
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -522,7 +522,7 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
|
|
|
|
|
|
@Subscribe
|
|
|
fun onBaseDevStateEvent(event: DevStatusEvent) {
|
|
|
- if (baseSn.startsWith("063") && event.devInfo.status == DevStatus.RUNNING.toInt() ) {
|
|
|
+ if (baseSn.startsWith("063") && event.devInfo.status == DevStatus.RUNNING.toInt()) {
|
|
|
// if (event.devInfo.potCloverEleStatus.toInt() == 0 && basePotCloverEleStatus != 0){
|
|
|
// basePotCloverEleStatus = 0
|
|
|
// }else if (event.devInfo.potCloverEleStatus.toInt() == 1 && basePotCloverEleStatus != 1){
|
|
@@ -534,7 +534,7 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
|
|
|
}
|
|
|
|
|
|
// Log.d("TAG Base DevStateEvent", "event:" + event.devInfo.toString())
|
|
|
- if (baseSn.startsWith("063") && (event.devInfo.potCloverEleStatus.toInt() == 0 && (event.devInfo.status == DevStatus.STOP.toInt()||event.devInfo.status == DevStatus.PAUSE.toInt()))&& isRunning && !isShowSolenoidDilaog) {
|
|
|
+ if (baseSn.startsWith("063") && (event.devInfo.potCloverEleStatus.toInt() == 0 && (event.devInfo.status == DevStatus.STOP.toInt() || event.devInfo.status == DevStatus.PAUSE.toInt())) && isRunning && !isShowSolenoidDilaog) {
|
|
|
showSolenoidValveDialog()
|
|
|
}
|
|
|
}
|
|
@@ -762,4 +762,16 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
|
|
|
isKeyLong = false
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ open fun isDialogFragmentVisible(fragmentManager: FragmentManager, tag: String): Boolean {
|
|
|
+ val fragments: List<Fragment> = fragmentManager.getFragments()
|
|
|
+ for (fragment in fragments) {
|
|
|
+ if (fragment is DialogFragment && fragment.isVisible() && tag == fragment.getTag()) {
|
|
|
+ (fragment as DialogFragment).dismissAllowingStateLoss()
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|