[6.5.0]红绿灯兼容处理,当获取到当前黄灯灯态小于3秒时,灯态比例按照3秒计算
This commit is contained in:
@@ -126,12 +126,12 @@ class FusionTrafficLightView @JvmOverloads constructor(
|
||||
maxGreenDuration = currentDuration
|
||||
}
|
||||
TrafficLightEnum.YELLOW -> {
|
||||
proportionList[1] = currentDuration
|
||||
maxYellowDuration = if(currentDuration < 3){
|
||||
3
|
||||
}else{
|
||||
currentDuration
|
||||
}
|
||||
proportionList[1] = maxYellowDuration
|
||||
}
|
||||
else -> {
|
||||
proportionList[2] = currentDuration
|
||||
@@ -144,12 +144,12 @@ class FusionTrafficLightView @JvmOverloads constructor(
|
||||
maxGreenDuration = nextDuration
|
||||
}
|
||||
TrafficLightEnum.YELLOW -> {
|
||||
proportionList[1] = nextDuration
|
||||
maxYellowDuration = if(nextDuration<3){
|
||||
3
|
||||
}else{
|
||||
nextDuration
|
||||
}
|
||||
proportionList[1] = maxYellowDuration
|
||||
}
|
||||
else -> {
|
||||
proportionList[2] = nextDuration
|
||||
@@ -162,12 +162,12 @@ class FusionTrafficLightView @JvmOverloads constructor(
|
||||
maxGreenDuration = nextTwoDuration
|
||||
}
|
||||
TrafficLightEnum.YELLOW -> {
|
||||
proportionList[1] = nextTwoDuration
|
||||
maxYellowDuration = if(nextTwoDuration<3){
|
||||
3
|
||||
}else{
|
||||
nextTwoDuration
|
||||
}
|
||||
proportionList[1] = maxYellowDuration
|
||||
}
|
||||
else -> {
|
||||
proportionList[2] = nextTwoDuration
|
||||
|
||||
Reference in New Issue
Block a user