Skip to content

Commit 0cbb2d8

Browse files
robhojohan12345
authored andcommitted
Limit download progress percentage to range 0-100
For nobil the percentage reaches 101. I haven't figured out why nobil's data is out of sync. When querying nobil for the total number of chargers we get: Norway: 4957 Sweden: 9108 ------------ 14065 .. but the data dump we download has: Norway: 5168 Sweden: 9059 ------------ 14227
1 parent abb00f1 commit 0cbb2d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/java/net/vonforst/evmap/fragment/MapFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ class MapFragment : Fragment(), OnMapReadyCallback, MenuProvider {
654654
binding.progressBar2.isIndeterminate = res.progress == null
655655
binding.progressBar2.progress = ((res.progress ?: 0f) * 100f).toInt().coerceIn(0, 100)
656656
binding.search.hint = if (res.progress != null) {
657-
getString(R.string.downloading_chargers_percent, (res.progress * 100f))
657+
getString(R.string.downloading_chargers_percent, (res.progress * 100f).coerceIn(0f, 100f))
658658
} else {
659659
getString(R.string.search)
660660
}

0 commit comments

Comments
 (0)