|
@@ -6,6 +6,7 @@ import android.os.Bundle
|
|
|
import android.util.Log
|
|
|
import android.view.*
|
|
|
import android.view.animation.LinearInterpolator
|
|
|
+import android.widget.LinearLayout
|
|
|
import androidx.activity.viewModels
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
import com.develop.food.base.common.MODE_TYPE
|
|
@@ -15,11 +16,15 @@ import com.develop.food.base.common.TURN_UP_KEY_CODE
|
|
|
import com.develop.food.base.data.ModesType
|
|
|
import com.develop.food.base.data.model.CookSettingType
|
|
|
import com.develop.food.base.event.CookStepEvent
|
|
|
+import com.develop.food.base.ext.background_drawable
|
|
|
import com.develop.food.base.manager.FloatWindowManager
|
|
|
import com.develop.food.base.router.Screens
|
|
|
import com.develop.food.base.ui.BaseActivity
|
|
|
import com.develop.food.base.utils.CofarUtils
|
|
|
+import com.develop.food.base.utils.GlobalApp
|
|
|
import com.develop.food.base.utils.ThreadUtils
|
|
|
+import com.develop.food.base.utils.isNightTheme
|
|
|
+import com.develop.food.base.utils.resId2Dimension
|
|
|
import com.develop.food.base.widgets.CancelConfirmDialog
|
|
|
import com.develop.food.base.widgets.DirectionView
|
|
|
import com.develop.food.base.widgets.TimePickerView
|
|
@@ -41,7 +46,7 @@ import java.util.*
|
|
|
|
|
|
@Route(path = Screens.Cook.COOK_MODES)
|
|
|
class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
- private var modeType = ModesType.CHOP.name
|
|
|
+ private var modeType = ModesType.FERMENT.name
|
|
|
override fun createViewBinding(inflater: LayoutInflater): ActivityModeDetailBinding {
|
|
|
return ActivityModeDetailBinding.inflate(layoutInflater)
|
|
|
}
|
|
@@ -49,7 +54,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
private val viewModel by viewModels<CookModesViewModel>()
|
|
|
private var userChanging = false //当前是否用户在操作
|
|
|
private var currDevInfo = DevInfo()
|
|
|
- private var lastModeType = ModesType.CHOP.name
|
|
|
+ private var lastModeType = ModesType.FERMENT.name
|
|
|
private var modeChange = false
|
|
|
private var turboTimer: Timer? = null
|
|
|
private var mSettingInstId = ""
|
|
@@ -80,19 +85,29 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
private var rotateAnimator: ObjectAnimator? = null
|
|
|
private var rotateAnimDir = -1
|
|
|
+ private var whereIndex = -1
|
|
|
+ private var isMotorDirectionGearChange = false
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
configLock = true
|
|
|
super.onCreate(savedInstanceState)
|
|
|
hasShowScreenSaver = true
|
|
|
- modeType = intent.extras?.getString(MODE_TYPE, ModesType.CHOP.name) ?: ""
|
|
|
+ modeType = intent.extras?.getString(MODE_TYPE, ModesType.FERMENT.name) ?: ""
|
|
|
lastModeType = modeType
|
|
|
+ if (isNightTheme()) {
|
|
|
+ val param = binding.ivBack.layoutParams as LinearLayout.LayoutParams
|
|
|
+ param.width = dp83
|
|
|
+ param.height = dp83
|
|
|
+ param.gravity = Gravity.CENTER_VERTICAL
|
|
|
+ param.marginStart = dp25
|
|
|
+ binding.ivBack.layoutParams = param
|
|
|
+ }
|
|
|
//初始化模式数据
|
|
|
initModeData(modeType)
|
|
|
initData()
|
|
|
initListener()
|
|
|
CofarSDK.resetLastPotStatus()
|
|
|
- ThreadUtils.runOnMainThread({configLock = false},500)
|
|
|
+ ThreadUtils.runOnMainThread({ configLock = false }, 500)
|
|
|
}
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
@@ -159,7 +174,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
|
|
|
backRequestDialog.apply {
|
|
|
- title = "Keep cooking in the background?"
|
|
|
+ title = GlobalApp().getString(R.string.keep_cooking_in_the_background)
|
|
|
onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
|
|
|
override fun onConfirm() {
|
|
|
val cookStepEvent = CookStepEvent(
|
|
@@ -195,9 +210,11 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
CofarSDK.stop(false)
|
|
|
CofarSDK.startWeight()
|
|
|
}
|
|
|
+
|
|
|
ModesType.TURBO.name -> {
|
|
|
CofarSDK.stop(false)
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
userChanging = false
|
|
|
CofarSDK.startRunning(modeType)
|
|
@@ -227,12 +244,13 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
setByUser: Boolean
|
|
|
) {
|
|
|
if (setByUser) {
|
|
|
- // currTime = time.toLong()
|
|
|
+ // currTime = time.toLong()
|
|
|
}
|
|
|
rollTimeEvent(hours, minute, second, time, setByUser)
|
|
|
}
|
|
|
|
|
|
- override fun onTimePickerTouchFirst() {
|
|
|
+ override fun onTimePickerTouchFirst(where: Int) {
|
|
|
+ whereIndex = where
|
|
|
userChanging = true
|
|
|
}
|
|
|
}
|
|
@@ -252,6 +270,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
MotionEvent.ACTION_DOWN -> {
|
|
|
turboDownEvent()
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP -> {
|
|
|
turboUpEvent()
|
|
|
}
|
|
@@ -276,7 +295,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
private fun initData() {
|
|
|
binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
|
|
|
- binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
|
|
|
+ binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
|
|
|
viewModel.currentStep.observe(this) {
|
|
|
if (it == null) {
|
|
|
return@observe
|
|
@@ -288,15 +307,19 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
CookSettingType.WEIGHT -> {
|
|
|
changeWeightStep()
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.TEMP_SETTING -> {
|
|
|
changeTempSettingStep()
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.TIME_SETTING -> {
|
|
|
changeTimeSettingStep()
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.SPEED_SETTING -> {
|
|
|
changeSpeedSettingStep()
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.DIRECTION_SETTING -> {
|
|
|
changeDirectionSettingStep()
|
|
|
}
|
|
@@ -305,6 +328,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
|
|
|
private fun changeWeightStep() {
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
binding.ivWeight.visibility = View.GONE
|
|
|
binding.ivTurbo.visibility = View.GONE
|
|
|
binding.functionLayout.visibility = View.GONE
|
|
@@ -314,6 +339,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
|
|
|
private fun changeCommonStep() {
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
binding.functionLayout.visibility = View.VISIBLE
|
|
|
binding.llWeightView.visibility = View.GONE
|
|
|
if (modeType == ModesType.WIGHT.name || modeType == ModesType.TURBO.name) {
|
|
@@ -343,11 +370,11 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
//处理蒸汽模式
|
|
|
- if(modeType == ModesType.STEAM.name){
|
|
|
+ if (modeType == ModesType.STEAM.name) {
|
|
|
binding.tempRingText.visibility = View.GONE;
|
|
|
binding.clCookTemp.turnSteamMode();
|
|
|
binding.steamFire.visibility = View.VISIBLE
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
binding.clCookTemp.turnCommonMode();
|
|
|
}
|
|
|
|
|
@@ -369,6 +396,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
}
|
|
|
|
|
|
private fun changeSpeedSettingStep() {
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
binding.steamFire.visibility = View.GONE
|
|
|
binding.llWeightView.visibility = View.GONE
|
|
|
binding.functionLayout.visibility = View.VISIBLE
|
|
@@ -384,7 +413,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
private fun changeDirectionSettingStep() {
|
|
|
binding.steamFire.visibility = View.GONE
|
|
|
-
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
binding.llWeightView.visibility = View.GONE
|
|
|
binding.functionLayout.visibility = View.VISIBLE
|
|
|
binding.tempRingView.visibility = View.INVISIBLE
|
|
@@ -407,15 +437,19 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
CookSettingType.TEMP_SETTING -> {
|
|
|
clCookTemp.upSelectedView(true)
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.TIME_SETTING -> {
|
|
|
clCookTime.upSelectedView(true)
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.SPEED_SETTING -> {
|
|
|
clCookSpeed.upSelectedView(true)
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.DIRECTION_SETTING -> {
|
|
|
clCookDirection.upSelectedView(true)
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.WEIGHT -> {
|
|
|
// do nothing
|
|
|
}
|
|
@@ -434,21 +468,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
@Subscribe
|
|
|
- fun onDevCommonEvent(event:DevCommonEvent){
|
|
|
+ fun onDevCommonEvent(event: DevCommonEvent) {
|
|
|
|
|
|
- if(configLock){
|
|
|
+ if (configLock) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
ThreadUtils.runOnMainThread({
|
|
|
- if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type){
|
|
|
+ if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type) {
|
|
|
CofarSDK.cfgTime((10 * 60).toInt())
|
|
|
currDevInfo.mode.apply {
|
|
|
updateTimeUI(
|
|
|
minTime,
|
|
|
maxTime,
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
true,
|
|
|
true
|
|
|
)
|
|
@@ -459,21 +493,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
|
|
|
- if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type){
|
|
|
+ if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_7 == event.type) {
|
|
|
CofarSDK.cfgTime((10 * 60).toInt())
|
|
|
currDevInfo.mode.apply {
|
|
|
updateTimeUI(
|
|
|
minTime,
|
|
|
maxTime,
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else currDevInfo.targetTime.toInt(),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
true,
|
|
|
true
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type || CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type){
|
|
|
+ if (CommonEventTypes.MOTOR_GEAR_RATHER_THEN_3_WITH_TEMP == event.type || CommonEventTypes.MOTOR_REVERSE_CAN_NOT_RATHER_THEN_3 == event.type) {
|
|
|
CofarSDK.cfgMotorGear(3);
|
|
|
currDevInfo.mode.apply {
|
|
|
updateMotorGearUI(
|
|
@@ -485,15 +519,14 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
- },500)
|
|
|
-
|
|
|
+ }, 500)
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
@Subscribe
|
|
|
fun onDevStateEvent(event: DevStatusEvent) {
|
|
|
- if(!initModeData || turboLock){
|
|
|
+ if (!initModeData || turboLock) {
|
|
|
return
|
|
|
}
|
|
|
ThreadUtils.runOnMainThread {
|
|
@@ -512,21 +545,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
updateTempUI(
|
|
|
minTemp.toFloat(),
|
|
|
maxTemp.toFloat(),
|
|
|
- if(currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt() else currDevInfo.temp.toInt(),
|
|
|
+ if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt() else currDevInfo.temp.toInt(),
|
|
|
currDevInfo.targetTemp.toString(),
|
|
|
isTempChange
|
|
|
)
|
|
|
updateTimeUI(
|
|
|
- if(currDevInfo.status == DevStatus.STOP.toInt() || userChanging) minTime else 0,
|
|
|
+ if (currDevInfo.status == DevStatus.STOP.toInt() || userChanging) minTime else 0,
|
|
|
maxTime,
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else (if(currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTime.toInt() else currDevInfo.remainTime.toInt()),
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toInt() else (if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTime.toInt() else currDevInfo.remainTime.toInt()),
|
|
|
+ if (currDevInfo.targetTimeBuffer.toInt() != -1) currDevInfo.targetTimeBuffer.toLong() else currDevInfo.targetTime.toLong(),
|
|
|
isTimeChange
|
|
|
)
|
|
|
|
|
|
var motorGear = currDevInfo.motorGear.toInt()
|
|
|
- if(currDevInfo.motorGearBuffer.toInt() != -1){
|
|
|
- motorGear = currDevInfo.motorGearBuffer.toInt()
|
|
|
+ if (currDevInfo.motorGearBuffer.toInt() != -1) {
|
|
|
+ motorGear = currDevInfo.motorGearBuffer.toInt()
|
|
|
}
|
|
|
|
|
|
updateMotorGearUI(
|
|
@@ -549,7 +582,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
//初始化模式数据
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
- private fun initModeData(type: String,keep:Boolean = false) {
|
|
|
+ private fun initModeData(type: String, keep: Boolean = false) {
|
|
|
|
|
|
userChanging = false
|
|
|
val baseMode = CofarSDK.devMode(type)
|
|
@@ -563,16 +596,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
} else {
|
|
|
this.window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
|
|
//其他模式
|
|
|
- changeCommonStep()
|
|
|
+ changeCommonStep()
|
|
|
|
|
|
- if(CofarSDK.devInfo().status != DevStatus.PAUSE.toInt() && CofarSDK.devInfo().status != DevStatus.RUNNING.toInt()){
|
|
|
+ if (CofarSDK.devInfo().status != DevStatus.PAUSE.toInt() && CofarSDK.devInfo().status != DevStatus.RUNNING.toInt()) {
|
|
|
|
|
|
var targetTemp = baseMode.defaultTemp.toShort()
|
|
|
var motorDirection = baseMode.motorDirection.toByte()
|
|
|
var motorGear = baseMode.defaultMotorGear.toByte()
|
|
|
var targetTime = baseMode.defaultTime.toInt()
|
|
|
|
|
|
- var restoreConfig:DevInfo ?= null
|
|
|
+ var restoreConfig: DevInfo? = null
|
|
|
|
|
|
if (modeType == ModesType.TURBO.name) {
|
|
|
|
|
@@ -581,27 +614,27 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
changeSpeedSettingStep()
|
|
|
|
|
|
} else {
|
|
|
- turboLock=false;
|
|
|
+ turboLock = false;
|
|
|
viewModel.changeStep(CookSettingType.TEMP_SETTING)
|
|
|
- if(keep){
|
|
|
+ if (keep) {
|
|
|
configLock = true;
|
|
|
- restoreConfig = CofarSDK.changeMode(type, baseMode,true)
|
|
|
+ restoreConfig = CofarSDK.changeMode(type, baseMode, true)
|
|
|
ThreadUtils.runOnMainThread({
|
|
|
- configLock = false;
|
|
|
- },500);
|
|
|
- if(restoreConfig != null){
|
|
|
+ configLock = false;
|
|
|
+ }, 500);
|
|
|
+ if (restoreConfig != null) {
|
|
|
targetTemp = restoreConfig.targetTemp;
|
|
|
motorDirection = restoreConfig.motorDirection;
|
|
|
motorGear = restoreConfig.motorGear;
|
|
|
targetTime = restoreConfig.targetTime;
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CofarSDK.changeMode(type, baseMode)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(restoreConfig == null){
|
|
|
+ if (restoreConfig == null) {
|
|
|
currDevInfo.apply {
|
|
|
targetTemp = baseMode.defaultTemp.toShort()
|
|
|
motorDirection = baseMode.motorDirection.toByte()
|
|
@@ -637,6 +670,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
)
|
|
|
|
|
|
currentMotorGer = defaultMotorGear
|
|
|
+ this@ModesDetailActivity.isMotorDirectionGearChange =
|
|
|
+ isMotorDirectionChange
|
|
|
updateMotorGearUI(
|
|
|
minMotorGear.toFloat(),
|
|
|
maxMotorGear.toFloat(),
|
|
@@ -664,16 +699,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
private fun getTimeStr(time: Long): String {
|
|
|
|
|
|
- if(time >= 91*60){
|
|
|
+ if (time >= 91 * 60) {
|
|
|
var h = time / 3600;
|
|
|
var m = time % 3600 / 60;
|
|
|
- return "${if(h < 10) "0${h}" else h}:${if(m < 10) "0${m}" else m}";
|
|
|
- }else{
|
|
|
+ return "${if (h < 10) "0${h}" else h}:${if (m < 10) "0${m}" else m}";
|
|
|
+ } else {
|
|
|
|
|
|
var m = time / 60;
|
|
|
var s = time % 60;
|
|
|
|
|
|
- return "${if(m < 10) "0${m}" else m}:${if(s < 10) "0${s}" else s}";
|
|
|
+ return "${if (m < 10) "0${m}" else m}:${if (s < 10) "0${s}" else s}";
|
|
|
|
|
|
}
|
|
|
|
|
@@ -725,12 +760,12 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
private fun rotateStep(): Int {
|
|
|
- if(currDevInfo.targetTime >= 60){
|
|
|
- return 10;
|
|
|
+ if (currDevInfo.targetTime >= 60) {
|
|
|
+ return 10;
|
|
|
}
|
|
|
|
|
|
- if(currDevInfo.targetTime >= 10 * 60){
|
|
|
- return 30;
|
|
|
+ if (currDevInfo.targetTime >= 10 * 60) {
|
|
|
+ return 30;
|
|
|
}
|
|
|
|
|
|
return 1
|
|
@@ -739,15 +774,16 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
var lastKeyTime = 0L
|
|
|
var lastKeyCode = 0;
|
|
|
+
|
|
|
/**
|
|
|
* 旋转物理键
|
|
|
*/
|
|
|
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
|
|
var spend = (System.currentTimeMillis() - lastKeyTime);
|
|
|
- if( spend < 10){
|
|
|
+ if (spend < 10) {
|
|
|
return super.dispatchKeyEvent(event);
|
|
|
}
|
|
|
- lastKeyTime = System.currentTimeMillis();
|
|
|
+ lastKeyTime = System.currentTimeMillis();
|
|
|
val currentStep = viewModel.currentStep.value
|
|
|
Log.d("aaaaaa", "${event.keyCode}")
|
|
|
|
|
@@ -755,7 +791,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
if (event.action != KeyEvent.ACTION_UP) {
|
|
|
|
|
|
- when ( event.keyCode) {
|
|
|
+ when (event.keyCode) {
|
|
|
//旋转+
|
|
|
TURN_UP_KEY_CODE -> {
|
|
|
when (currentStep) {
|
|
@@ -772,6 +808,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
tempRingEvent(currentTemp)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.SPEED_SETTING -> {
|
|
|
if (isMotorGearChange) {
|
|
|
//当前调节转速
|
|
@@ -783,14 +820,20 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
motorGearSpeedEvent(currentMotorGer)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.TIME_SETTING -> {
|
|
|
- if (isTimeChange){
|
|
|
+ if (isTimeChange) {
|
|
|
//当前调节时间
|
|
|
//dealWithTimeByOperation(true)
|
|
|
- handleRotateTimeChange(rotateStep())
|
|
|
+ handleRotateTimeChange(true)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ CookSettingType.DIRECTION_SETTING -> {
|
|
|
+ motorGearDirectionClick(DirectionView.Direction.RIGHT)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
else -> {}
|
|
|
}
|
|
|
}
|
|
@@ -806,8 +849,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
currentTemp = minTemp
|
|
|
}
|
|
|
|
|
|
- if(currentTemp < 37){ //小于37度置0
|
|
|
- currentTemp=0
|
|
|
+ if (currentTemp < 37) { //小于37度置0
|
|
|
+ currentTemp = 0
|
|
|
}
|
|
|
|
|
|
currentTemp = CofarUtils.parseTemp(currentTemp.toShort()).toInt();
|
|
@@ -817,8 +860,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
tempRingEvent(currentTemp)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.SPEED_SETTING -> {
|
|
|
- if (isMotorGearChange){
|
|
|
+ if (isMotorGearChange) {
|
|
|
//当前调节转速
|
|
|
currentMotorGer -= 1
|
|
|
if (currentMotorGer < minMotorGear) {
|
|
@@ -828,13 +872,18 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
motorGearSpeedEvent(currentMotorGer)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
CookSettingType.TIME_SETTING -> {
|
|
|
if (isTimeChange) {
|
|
|
//当前调节时间
|
|
|
//dealWithTimeByOperation(false)
|
|
|
- handleRotateTimeChange(-rotateStep())
|
|
|
+ handleRotateTimeChange(false)
|
|
|
}
|
|
|
}
|
|
|
+ CookSettingType.DIRECTION_SETTING -> {
|
|
|
+ motorGearDirectionClick(DirectionView.Direction.LEFT)
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
else -> {}
|
|
|
}
|
|
@@ -847,80 +896,95 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
private var timeBuffer = 0;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 旋转按钮切换时间
|
|
|
*/
|
|
|
- private fun handleRotateTimeChange(c:Int){
|
|
|
+ private fun handleRotateTimeChange(increase: Boolean) {
|
|
|
|
|
|
- ThreadUtils.runOnMainThread({
|
|
|
+ ThreadUtils.runOnMainThread {
|
|
|
//当前调节时间
|
|
|
- var targetTime = currDevInfo.targetTime.toInt()
|
|
|
- if(currDevInfo.remainTime.toInt() != 0){
|
|
|
- targetTime = currDevInfo.remainTime.toInt()
|
|
|
+ var targetTime = currDevInfo.targetTime
|
|
|
+ if (currDevInfo.remainTime != 0) {
|
|
|
+ targetTime = currDevInfo.remainTime
|
|
|
}
|
|
|
- if(currDevInfo.targetTimeBuffer.toInt() != -1){
|
|
|
- targetTime = currDevInfo.targetTimeBuffer.toInt()
|
|
|
+ if (currDevInfo.targetTimeBuffer != -1) {
|
|
|
+ targetTime = currDevInfo.targetTimeBuffer
|
|
|
+ }
|
|
|
+ var step = 0
|
|
|
+ if (whereIndex == 1) {
|
|
|
+ step += 60
|
|
|
+ } else {
|
|
|
+ step = rotateStep()
|
|
|
+ }
|
|
|
+ if (increase) {
|
|
|
+ targetTime += step
|
|
|
+ } else {
|
|
|
+ targetTime -= step
|
|
|
}
|
|
|
- targetTime+=c
|
|
|
|
|
|
|
|
|
- if(targetTime < currDevInfo.mode.minTime){ //处理边界
|
|
|
- targetTime = currDevInfo.mode.minTime
|
|
|
+ Log.d("kkkkkkk", "$whereIndex===$step===$targetTime")
|
|
|
+ if (targetTime < 0) {
|
|
|
+ targetTime = 0;
|
|
|
}
|
|
|
-
|
|
|
- if( targetTime > currDevInfo.mode.maxTime){ //处理边界
|
|
|
+ if (targetTime > currDevInfo.mode.maxTime) {
|
|
|
targetTime = currDevInfo.mode.maxTime
|
|
|
}
|
|
|
-
|
|
|
- if(targetTime < 0){
|
|
|
- targetTime = 0;
|
|
|
+ if (targetTime < currDevInfo.mode.minTime) {
|
|
|
+ targetTime = currDevInfo.mode.minTime
|
|
|
}
|
|
|
val sec = targetTime % 60
|
|
|
- val min = ((targetTime / 60) % 60 )
|
|
|
+ val min = ((targetTime / 60) % 60)
|
|
|
val hour = (targetTime / 3600)
|
|
|
var time = ""
|
|
|
- if(hour > 0){
|
|
|
- time += if(hour < 10){
|
|
|
+ if (hour > 0) {
|
|
|
+ time += if (hour < 10) {
|
|
|
"0${hour}"
|
|
|
- }else{
|
|
|
- "${hour}"
|
|
|
+ } else {
|
|
|
+ "$hour"
|
|
|
}
|
|
|
|
|
|
- time += if(min < 10){
|
|
|
+ time += if (min < 10) {
|
|
|
":0${min}"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
":${min}"
|
|
|
}
|
|
|
- }else{
|
|
|
- time += if(min < 10){
|
|
|
+ } else {
|
|
|
+ time += if (min < 10) {
|
|
|
"0${min}"
|
|
|
- }else{
|
|
|
- "${min}"
|
|
|
+ } else {
|
|
|
+ "$min"
|
|
|
}
|
|
|
|
|
|
- time += if(sec < 10){
|
|
|
+ time += if (sec < 10) {
|
|
|
":0${sec}"
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
":${sec}"
|
|
|
}
|
|
|
}
|
|
|
- rollTimeEvent(hour,min,sec,time, setByUser = true)
|
|
|
-
|
|
|
+ rollTimeEvent(hour, min, sec, time, setByUser = true)
|
|
|
currDevInfo.apply {
|
|
|
- updateTimeUI(mode.minTime, mode.maxTime,remainTime.toInt(),targetTime.toLong(),true)
|
|
|
- binding.apply {
|
|
|
- clSetTime.setTimeInternal(hour,min,sec,true,true)
|
|
|
- }
|
|
|
-
|
|
|
+ updateTimeUI(
|
|
|
+ mode.minTime,
|
|
|
+ mode.maxTime,
|
|
|
+ remainTime,
|
|
|
+ targetTime.toLong(),
|
|
|
+ true
|
|
|
+ )
|
|
|
}
|
|
|
- })
|
|
|
+ binding.clSetTime.setTimeInternal(
|
|
|
+ hour,
|
|
|
+ min,
|
|
|
+ sec,
|
|
|
+ changeSetting = true,
|
|
|
+ setByUser = true
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
private var pressStartTime = -1L;
|
|
|
|
|
|
|
|
@@ -932,21 +996,22 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
|
|
if (keyCode == PRESS_DOWN_KEY_CODE) {
|
|
|
|
|
|
+ Log.d("======","down")
|
|
|
|
|
|
//当前是turbo模式下
|
|
|
if (modeType == ModesType.TURBO.name) {
|
|
|
turboDownEvent()
|
|
|
- }else{
|
|
|
- if(pressStartTime == -1L){
|
|
|
+ } else {
|
|
|
+ if (pressStartTime == -1L) {
|
|
|
pressStartTime = System.currentTimeMillis()
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(pressStartTime != -1L && (System.currentTimeMillis() - pressStartTime ) > 1000 && event.keyCode == PRESS_DOWN_KEY_CODE){
|
|
|
- this.onKeyLongPress(keyCode,event);
|
|
|
+ if (pressStartTime != -1L && (System.currentTimeMillis() - pressStartTime) > 1000 && event.keyCode == PRESS_DOWN_KEY_CODE) {
|
|
|
+ this.onKeyLongPress(keyCode, event);
|
|
|
event.startTracking()
|
|
|
pressStartTime = -1L
|
|
|
- canStart=false;
|
|
|
+ canStart = false;
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -957,9 +1022,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {
|
|
|
|
|
|
- if( modeType == ModesType.WIGHT.name){
|
|
|
+ if (modeType == ModesType.WIGHT.name) {
|
|
|
backClick()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (mRunningState == DevStatus.RUNNING.toInt() || currDevInfo.status == DevStatus.PAUSE.toInt()) {
|
|
|
stopClick()
|
|
|
} else if (mRunningState == DevStatus.STOP.toInt()) {
|
|
@@ -976,7 +1041,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 物理键离开事件
|
|
|
*/
|
|
|
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
|
|
|
-
|
|
|
+ Log.d("======","up")
|
|
|
if (modeType == ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE) {
|
|
|
//当前是turbo模式下,并且是物理键按下
|
|
|
turboUpEvent()
|
|
@@ -987,7 +1052,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
|
|
|
- if (modeType != ModesType.WIGHT.name && modeType != ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
|
|
|
+ if (modeType != ModesType.WIGHT.name && modeType != ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
|
|
|
//非turbo模式
|
|
|
if (userChanging && currDevInfo.status.toByte() != DevStatus.STOP) {
|
|
|
//用户调节中
|
|
@@ -995,21 +1060,20 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
} else {
|
|
|
if (mRunningState == DevStatus.RUNNING.toInt()) {
|
|
|
pauseClick()
|
|
|
- } else if(currDevInfo.status == DevStatus.PAUSE.toInt()){
|
|
|
+ } else if (currDevInfo.status == DevStatus.PAUSE.toInt()) {
|
|
|
resumeClick();
|
|
|
- }
|
|
|
- else if (mRunningState == DevStatus.STOP.toInt()) {
|
|
|
+ } else if (mRunningState == DevStatus.STOP.toInt()) {
|
|
|
startClick()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(modeType == ModesType.WIGHT.name){
|
|
|
+ if (modeType == ModesType.WIGHT.name) {
|
|
|
weightClearClick();
|
|
|
}
|
|
|
|
|
|
- canStart=true;
|
|
|
+ canStart = true;
|
|
|
return super.onKeyUp(keyCode, event)
|
|
|
}
|
|
|
|
|
@@ -1039,8 +1103,14 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
tempRingView.setRange(minTemp, maxTemp)
|
|
|
tempRingView.setCanTouch(isTempChange)
|
|
|
var tempBuffer = CofarSDK.devInfo().targetTempBuffer;
|
|
|
- steamFire.configNum(CofarUtils.parseTemp( if(tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort()).toInt())
|
|
|
- clCookTemp.configSteamFire(CofarUtils.parseTemp(if(tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort()).toInt())
|
|
|
+ steamFire.configNum(
|
|
|
+ CofarUtils.parseTemp(if (tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort())
|
|
|
+ .toInt()
|
|
|
+ )
|
|
|
+ clCookTemp.configSteamFire(
|
|
|
+ CofarUtils.parseTemp(if (tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort())
|
|
|
+ .toInt()
|
|
|
+ )
|
|
|
|
|
|
if (!userChanging || focusUpdate) {
|
|
|
clCookTemp.setConfigValue("--${CofarUtils.parseTemp(targetTemp.toShort())}°C--")
|
|
@@ -1075,9 +1145,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
var hours = 0
|
|
|
var minute = 0
|
|
|
var sec = 0
|
|
|
- if (remainTime > ( 91 * 60)) {
|
|
|
+ if (remainTime > (91 * 60)) {
|
|
|
hours = remainTime / 3600
|
|
|
- minute = remainTime % 3600 / 60
|
|
|
+ minute = remainTime % 3600 / 60
|
|
|
} else {
|
|
|
minute = remainTime / 60
|
|
|
sec = remainTime % 60
|
|
@@ -1160,7 +1230,6 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
private fun updateStatusBtn(status: Byte) {
|
|
|
|
|
|
|
|
|
-
|
|
|
//当前用户正在修改不更新按钮状态
|
|
|
if (userChanging) return
|
|
|
//切碎功能隐藏按钮
|
|
@@ -1234,7 +1303,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 显示/隐藏 确认取消按钮
|
|
|
*/
|
|
|
private fun showConfirmAndCancelBtn() {
|
|
|
- if (currDevInfo.status.toByte() != DevStatus.STOP ) {
|
|
|
+ if (currDevInfo.status.toByte() != DevStatus.STOP) {
|
|
|
binding.btnCancel.visibility = View.VISIBLE
|
|
|
binding.btnConfirm.visibility = View.VISIBLE
|
|
|
}
|
|
@@ -1253,6 +1322,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
CofarSDK.cancel()
|
|
|
CofarSDK.devInfo().runningRecipeId = null
|
|
|
CofarSDK.start(modeType)
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1279,6 +1350,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 点击确认操作
|
|
|
*/
|
|
|
private fun confirmClick() {
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
//确认
|
|
|
userChanging = false
|
|
|
//配置
|
|
@@ -1297,7 +1370,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
//TODO 崩溃?
|
|
|
try {
|
|
|
FloatWindowManager.hideStepFlowWindow()
|
|
|
- }catch (e:Exception) {
|
|
|
+ } catch (e: Exception) {
|
|
|
print(e)
|
|
|
}
|
|
|
}
|
|
@@ -1315,6 +1388,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
*/
|
|
|
private fun weightClick() {
|
|
|
// CofarSDK.stop(false)
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
modeChange = true
|
|
|
modeType = ModesType.WIGHT.name
|
|
|
initModeData(modeType)
|
|
@@ -1322,7 +1397,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
binding.ivTurbo.visibility = View.GONE
|
|
|
binding.ivWeight.visibility = View.GONE
|
|
|
binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
|
|
|
- binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
|
|
|
+ binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1330,6 +1405,8 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
*/
|
|
|
private fun turboClick() {
|
|
|
CofarSDK.stop(false)
|
|
|
+ whereIndex = -1
|
|
|
+ binding.clSetTime.stopAlphaAnim()
|
|
|
modeChange = true
|
|
|
modeType = ModesType.TURBO.name
|
|
|
viewModel.changeStep(CookSettingType.TEMP_SETTING)
|
|
@@ -1338,7 +1415,7 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
binding.ivTurbo.visibility = View.GONE
|
|
|
binding.ivWeight.visibility = View.GONE
|
|
|
binding.ivTurboView.visibility = View.VISIBLE
|
|
|
- binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
|
|
|
+ binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1362,9 +1439,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
if (modeChange) {
|
|
|
|
|
|
- if(modeType == ModesType.TURBO.name){ //TURBO未停止之前不能退出
|
|
|
- CofarSDK.stop(false)
|
|
|
- if(DevStatus.STOP != devInfo.status.toByte()){
|
|
|
+ if (modeType == ModesType.TURBO.name) { //TURBO未停止之前不能退出
|
|
|
+ CofarSDK.stop(false)
|
|
|
+ if (DevStatus.STOP != devInfo.status.toByte()) {
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1375,15 +1452,18 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
var cm = modeType;
|
|
|
modeType = lastModeType
|
|
|
binding.tvModeName.text = viewModel.getModeTitle(resources, modeType)
|
|
|
- binding.ivBanner.setBackgroundResource(viewModel.getBanner(modeType))
|
|
|
+ binding.ivBanner.background_drawable = viewModel.getBanner(modeType)
|
|
|
modeChange = false
|
|
|
binding.ivTurboView.visibility = View.GONE
|
|
|
- initModeData(modeType,cm == ModesType.WIGHT.name || cm == ModesType.TURBO.name)
|
|
|
+ initModeData(modeType, cm == ModesType.WIGHT.name || cm == ModesType.TURBO.name)
|
|
|
changeCommonStep()
|
|
|
} else if (devInfo.status != DevStatus.STOP.toInt() && modeType != ModesType.WIGHT.name
|
|
|
&& modeType != ModesType.TURBO.name
|
|
|
) {
|
|
|
- if(CofarSDK.devInfo().runningInstId == modeType) backRequestDialog.showDialog(supportFragmentManager, "backRequestDialog")
|
|
|
+ if (CofarSDK.devInfo().runningInstId == modeType) backRequestDialog.showDialog(
|
|
|
+ supportFragmentManager,
|
|
|
+ "backRequestDialog"
|
|
|
+ )
|
|
|
else finish()
|
|
|
} else {
|
|
|
finish()
|
|
@@ -1416,17 +1496,21 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
* 点击电机方向事件
|
|
|
*/
|
|
|
private fun motorGearDirectionClick(direction: DirectionView.Direction) {
|
|
|
- userChanging = true
|
|
|
- binding.clCookDirection.updateChangeValue(
|
|
|
- getDirectionStr(direction == DirectionView.Direction.LEFT)
|
|
|
- )
|
|
|
- if (direction != DirectionView.Direction.RIGHT) {
|
|
|
- CofarSDK.cfgMotorDirection(MotorDirections.REVERSE);
|
|
|
+ if (isMotorDirectionGearChange){
|
|
|
+ userChanging = true
|
|
|
+ binding.clCookDirection.updateChangeValue(
|
|
|
+ getDirectionStr(direction == DirectionView.Direction.LEFT)
|
|
|
+ )
|
|
|
|
|
|
- } else {
|
|
|
- CofarSDK.cfgMotorDirection(MotorDirections.FORWARD);
|
|
|
+ if (direction != DirectionView.Direction.RIGHT) {
|
|
|
+ CofarSDK.cfgMotorDirection(MotorDirections.REVERSE);
|
|
|
+ updateMotorDirectionUI(MotorDirections.REVERSE.toInt(), true);
|
|
|
+ } else {
|
|
|
+ CofarSDK.cfgMotorDirection(MotorDirections.FORWARD);
|
|
|
+ updateMotorDirectionUI(MotorDirections.FORWARD.toInt(), true);
|
|
|
+ }
|
|
|
+ showConfirmAndCancelBtn()
|
|
|
}
|
|
|
- showConfirmAndCancelBtn()
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1467,4 +1551,9 @@ class ModesDetailActivity : BaseActivity<ActivityModeDetailBinding>() {
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ companion object {
|
|
|
+ var dp83 = (R.dimen.convert_83px).resId2Dimension().toInt()
|
|
|
+ var dp25 = (R.dimen.convert_25px).resId2Dimension().toInt()
|
|
|
+ }
|
|
|
}
|