[6.5.0]红绿灯提示优化

This commit is contained in:
xuxinchao
2024-07-16 19:46:22 +08:00
parent e2588c815d
commit 9ef829516d
2 changed files with 12 additions and 3 deletions

View File

@@ -60,6 +60,12 @@ class TrafficLightPromptView @JvmOverloads constructor(
}
val endTime = System.nanoTime()
val internal = TimeUnit.NANOSECONDS.toMillis(endTime - startTime)
if(internal > 700){
UiThreadHandler.post {
tvTrafficNum?.text = "0."
tvTrafficNumDecimal?.text = "00"
}
}
if(internal>1500){
UiThreadHandler.post{
this@TrafficLightPromptView.visibility = GONE
@@ -159,7 +165,7 @@ class TrafficLightPromptView @JvmOverloads constructor(
tvTrafficNumDecimal?.text = (currentDuration*100 - currentDuration.toInt()*100).toInt().toString()
}else{
tvTrafficNum?.text = "0."
tvTrafficNumDecimal?.text = "0"
tvTrafficNumDecimal?.text = "00"
this@TrafficLightPromptView.visibility = View.GONE
}
when(nextState){