|
@@ -89,6 +89,10 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
hasShowScreenSaver = true
|
|
|
modeType = intent.extras?.getString(MODE_TYPE, ModesType.FERMENT.name) ?: ""
|
|
|
+ if (modeType == ModesType.TURBO.name) {
|
|
|
+ binding.btnStart.setGone()
|
|
|
+ binding.btnConfirm.setGone()
|
|
|
+ }
|
|
|
lastModeType = modeType
|
|
|
if (isNightTheme()) {
|
|
|
val param = binding.ivBack.layoutParams as LinearLayout.LayoutParams
|
|
@@ -464,27 +468,27 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
@Subscribe
|
|
|
- fun onTuyaEvent(event: TuyaEvent){
|
|
|
+ fun onTuyaEvent(event: TuyaEvent) {
|
|
|
|
|
|
- if("start" == event.type){
|
|
|
- if(DevStatus.PAUSE.toInt() == CofarSDK.devInfo().status){
|
|
|
+ if ("start" == event.type) {
|
|
|
+ if (DevStatus.PAUSE.toInt() == CofarSDK.devInfo().status) {
|
|
|
CofarSDK.confirm()
|
|
|
resumeClick()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
startClick(false)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if("stop" == event.type){
|
|
|
+ if ("stop" == event.type) {
|
|
|
stopClick(false)
|
|
|
}
|
|
|
|
|
|
- if("pause" == event.type){
|
|
|
+ if ("pause" == event.type) {
|
|
|
pauseClick()
|
|
|
}
|
|
|
|
|
|
|
|
|
- if("change_time" == event.type){
|
|
|
+ if ("change_time" == event.type) {
|
|
|
|
|
|
ThreadUtils.runOnMainThread {
|
|
|
//当前调节时间
|
|
@@ -557,24 +561,23 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
|
|
|
|
|
|
- if("change_temp" == event.type){
|
|
|
+ if ("change_temp" == event.type) {
|
|
|
|
|
|
- ThreadUtils.runOnMainThread ({
|
|
|
+ ThreadUtils.runOnMainThread({
|
|
|
updateTempUI(
|
|
|
minTemp.toFloat(),
|
|
|
maxTemp.toFloat(),
|
|
|
if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt()
|
|
|
else currDevInfo.temp.toInt(),
|
|
|
- if (currDevInfo.targetTempBuffer.toInt() != -1 ) currDevInfo.targetTempBuffer.toString() else currDevInfo.targetTemp.toString(),
|
|
|
+ if (currDevInfo.targetTempBuffer.toInt() != -1) currDevInfo.targetTempBuffer.toString() else currDevInfo.targetTemp.toString(),
|
|
|
isTempChange,
|
|
|
focusUpdate = true
|
|
|
)
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1021,6 +1024,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
handleRotateTimeChange(false)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.DIRECTION_SETTING -> {
|
|
|
motorGearDirectionClick(DirectionView.Direction.LEFT)
|
|
|
|
|
@@ -1137,7 +1141,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
|
|
if (keyCode == PRESS_DOWN_KEY_CODE) {
|
|
|
|
|
|
- Log.d("======","down")
|
|
|
+ Log.d("======", "down")
|
|
|
|
|
|
//当前是turbo模式下
|
|
|
if (modeType == ModesType.TURBO.name) {
|
|
@@ -1182,7 +1186,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 物理键离开事件
|
|
|
*/
|
|
|
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
|
|
|
- Log.d("======","up")
|
|
|
+ Log.d("======", "up")
|
|
|
if (modeType == ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE) {
|
|
|
//当前是turbo模式下,并且是物理键按下
|
|
|
turboUpEvent()
|
|
@@ -1455,7 +1459,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
/**
|
|
|
* 点击开始操作
|
|
|
*/
|
|
|
- private fun startClick(showStopTips:Boolean=true) {
|
|
|
+ private fun startClick(showStopTips: Boolean = true) {
|
|
|
if (mRunningInstId != mSettingInstId) {
|
|
|
overrideModeDialog.showDialog(supportFragmentManager, "overrideModeDialog")
|
|
|
} else {
|
|
@@ -1463,8 +1467,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
CofarSDK.cancel()
|
|
|
CofarSDK.devInfo().runningRecipeId = null
|
|
|
var startConfig = HashMap<String, Any>()
|
|
|
- startConfig.put("stopTips",showStopTips)
|
|
|
- CofarSDK.startWithConfig(modeType,startConfig)
|
|
|
+ startConfig.put("stopTips", showStopTips)
|
|
|
+ CofarSDK.startWithConfig(modeType, startConfig)
|
|
|
whereIndex = -1
|
|
|
binding.clSetTime.stopAlphaAnim()
|
|
|
}
|
|
@@ -1506,7 +1510,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
/**
|
|
|
* 点击停止操作
|
|
|
*/
|
|
|
- private fun stopClick(tips:Boolean = true) {
|
|
|
+ private fun stopClick(tips: Boolean = true) {
|
|
|
userChanging = false
|
|
|
//结束
|
|
|
CofarSDK.stop(tips)
|
|
@@ -1639,7 +1643,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 点击电机方向事件
|
|
|
*/
|
|
|
private fun motorGearDirectionClick(direction: DirectionView.Direction) {
|
|
|
- if (isMotorDirectionGearChange){
|
|
|
+ if (isMotorDirectionGearChange) {
|
|
|
userChanging = true
|
|
|
binding.clCookDirection.updateChangeValue(
|
|
|
getDirectionStr(direction == DirectionView.Direction.LEFT)
|