Fixes negative progress value due to big sizes

This commit is contained in:
stom79 2018-05-16 07:52:01 +02:00
parent b6e8b49e1c
commit f21a8221e3
1 changed files with 4 additions and 4 deletions

View File

@ -429,7 +429,7 @@ public class HttpsConnection {
final int currentProgress = (downloadedFileSize * 100) / contentSize;
((MediaActivity) context).runOnUiThread(new Runnable() {
public void run() {
listener.onUpdateProgress(currentProgress);
listener.onUpdateProgress(currentProgress>0?currentProgress:0);
}
});
}
@ -519,7 +519,7 @@ public class HttpsConnection {
final int currentProgress = (downloadedFileSize * 100) / contentSize;
((MediaActivity) context).runOnUiThread(new Runnable() {
public void run() {
listener.onUpdateProgress(currentProgress);
listener.onUpdateProgress(currentProgress>0?currentProgress:0);
}
});
}
@ -1068,7 +1068,7 @@ public class HttpsConnection {
final int progress = 100 * bytesTransferred / totalSize;
((TootActivity) context).runOnUiThread(new Runnable() {
public void run() {
listener.onUpdateProgress(progress);
listener.onUpdateProgress(progress>0?progress:0);
}
});
request.flush();
@ -1214,7 +1214,7 @@ public class HttpsConnection {
final int progress = 100 * bytesTransferred / totalSize;
((TootActivity)context).runOnUiThread(new Runnable() {
public void run() {
listener.onUpdateProgress(progress);
listener.onUpdateProgress(progress>0?progress:0);
}});
request.flush();
}