Fixes negative progress value due to big sizes
This commit is contained in:
parent
b6e8b49e1c
commit
f21a8221e3
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue