Using a float on the progress on app updates
Not sure if needed but I saw some funny behavior with the progress bar (cherry picked from commit 830a834ea6cd9f3015f6c5a6af03cedffe1265c5)
This commit is contained in:
parent
0de42b6654
commit
4122af491c
@ -96,7 +96,7 @@ class UpdaterService : Service() {
|
||||
var lastTick = 0L
|
||||
|
||||
override fun update(bytesRead: Long, contentLength: Long, done: Boolean) {
|
||||
val progress = (100 * bytesRead / contentLength).toInt()
|
||||
val progress = (100 * (bytesRead.toFloat() / contentLength)).toInt()
|
||||
val currentTime = System.currentTimeMillis()
|
||||
if (progress > savedProgress && currentTime - 200 > lastTick) {
|
||||
savedProgress = progress
|
||||
|
Loading…
x
Reference in New Issue
Block a user