mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-19 04:58:47 -04:00
Notification : Do not show negative progress
https://gitlab.com/AuroraOSS/AuroraStore/issues/141
This commit is contained in:
@@ -354,8 +354,6 @@ public class ActionButton extends AbstractHelper {
|
||||
public void onResumed(int groupId, @NotNull Download download, @NotNull FetchGroup fetchGroup) {
|
||||
if (groupId == hashCode) {
|
||||
int progress = fetchGroup.getGroupDownloadProgress();
|
||||
if (progress < 0)
|
||||
progress = 0;
|
||||
notification.notifyProgress(progress, 0, hashCode);
|
||||
ContextUtil.runOnUiThread(() -> {
|
||||
progressStatus.setText(R.string.download_progress);
|
||||
|
||||
@@ -62,6 +62,8 @@ public class GeneralNotification extends NotificationBase {
|
||||
public void notifyProgress(int progress, long downloadedBytesPerSecond, int requestId) {
|
||||
if (NotificationUtil.shouldNotify(context, app.getPackageName())) {
|
||||
builder = getBuilder();
|
||||
if (progress < 0)
|
||||
progress = 0;
|
||||
builder.setProgress(100, progress, false);
|
||||
builder.setSubText(new StringBuilder().append(Util.humanReadableByteSpeed(downloadedBytesPerSecond, true)));
|
||||
builder.setContentText(new StringBuilder().append(progress).append("%"));
|
||||
|
||||
@@ -83,8 +83,6 @@ public class LiveUpdate extends BaseTask {
|
||||
public void onResumed(int groupId, @NotNull Download download, @NotNull FetchGroup fetchGroup) {
|
||||
if (groupId == hashCode) {
|
||||
int progress = fetchGroup.getGroupDownloadProgress();
|
||||
if (progress < 0)
|
||||
progress = 0;
|
||||
notification.notifyProgress(progress, 0, hashCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user