mirror of
https://github.com/ev-map/EVMap.git
synced 2026-06-10 23:38:25 -04:00
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
This commit is contained in:
committed by
Johan von Forstner
parent
abb00f144b
commit
0cbb2d82c0
@@ -654,7 +654,7 @@ class MapFragment : Fragment(), OnMapReadyCallback, MenuProvider {
|
||||
binding.progressBar2.isIndeterminate = res.progress == null
|
||||
binding.progressBar2.progress = ((res.progress ?: 0f) * 100f).toInt().coerceIn(0, 100)
|
||||
binding.search.hint = if (res.progress != null) {
|
||||
getString(R.string.downloading_chargers_percent, (res.progress * 100f))
|
||||
getString(R.string.downloading_chargers_percent, (res.progress * 100f).coerceIn(0f, 100f))
|
||||
} else {
|
||||
getString(R.string.search)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user