[dev_robubus-d_230322_3.0.0]工具箱车速设置调整
This commit is contained in:
@@ -9,7 +9,6 @@ import android.os.Process
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.View.OnTouchListener
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
@@ -101,7 +100,18 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
|
||||
override fun onUpdate(inputContent: String?) {
|
||||
if (inputContent != null) {
|
||||
speedLimit = inputContent.toInt()
|
||||
try {
|
||||
speedLimit = inputContent.toInt()
|
||||
if(speedLimit>60){
|
||||
speedLimit = 60
|
||||
ToastUtils.showShort("最大限速60")
|
||||
}
|
||||
}catch (t: Exception){
|
||||
ToastUtils.showShort("最大限速60")
|
||||
speedLimit = 60
|
||||
|
||||
}
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +180,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
if(speedLimit>=5){
|
||||
speedLimit -= 5
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
}else{
|
||||
}else if(speedLimit in 1..4){
|
||||
speedLimit = 0
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
} else{
|
||||
ToastUtils.showShort("车速不能再减了")
|
||||
}
|
||||
}
|
||||
@@ -179,7 +192,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
if(speedLimit<=55){
|
||||
speedLimit += 5
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
}else{
|
||||
}else if(speedLimit in 56..59){
|
||||
speedLimit = 60
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
} else{
|
||||
ToastUtils.showShort("车速不能再加了")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user