mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-25 23:33:53 +00:00
[Android] fix speed limit indicator activating when driving exactly at speed limit
the displayed speed is rounded, but the speedLimitExceeded check isn't, resulting in what appears to be incorrect activations. Fixed by rounding in speedLimitExceeded also. fixes #544 Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
committed by
Konstantin Pastbin
parent
142759c4d0
commit
a830e4b444
@@ -266,7 +266,8 @@ public class NavigationController implements TrafficManager.TrafficCallback,
|
||||
mSpeedLimit.setSpeedLimit(0, false);
|
||||
return;
|
||||
}
|
||||
final boolean speedLimitExceeded = info.speedLimitMps < location.getSpeed();
|
||||
mSpeedLimit.setSpeedLimit(StringUtils.nativeFormatSpeed(info.speedLimitMps), speedLimitExceeded);
|
||||
final int fSpeedLimit = StringUtils.nativeFormatSpeed(info.speedLimitMps);
|
||||
final boolean speedLimitExceeded = fSpeedLimit < StringUtils.nativeFormatSpeed(location.getSpeed());
|
||||
mSpeedLimit.setSpeedLimit(fSpeedLimit, speedLimitExceeded);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user