mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Show queued upload count only when it is > 1
This commit is contained in:
parent
31f8aa4888
commit
420ec8061c
4 changed files with 7 additions and 6 deletions
|
|
@ -77,8 +77,10 @@ public class UploadService extends IntentService {
|
|||
RemoteViews curView = curNotification.contentView;
|
||||
if(!notificationTitleChanged) {
|
||||
curView.setTextViewText(R.id.uploadNotificationTitle, notificationProgressTitle);
|
||||
curView.setTextViewText(R.id.uploadNotificationsCount, String.format(getString(R.string.uploads_pending_notification_indicator), toUpload));
|
||||
Log.d("Commons", String.format("%d uploads left", toUpload));
|
||||
if(toUpload != 1) {
|
||||
curView.setTextViewText(R.id.uploadNotificationsCount, String.format(getString(R.string.uploads_pending_notification_indicator), toUpload));
|
||||
Log.d("Commons", String.format("%d uploads left", toUpload));
|
||||
}
|
||||
notificationTitleChanged = true;
|
||||
Intent mediaUploadStartedEvent = new Intent(INTENT_UPLOAD_STARTED);
|
||||
mediaUploadStartedEvent.putExtra(EXTRA_MEDIA, media);
|
||||
|
|
@ -156,7 +158,7 @@ public class UploadService extends IntentService {
|
|||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
toUpload++;
|
||||
if(curProgressNotification != null) {
|
||||
if(curProgressNotification != null && toUpload != 1) {
|
||||
curProgressNotification.contentView.setTextViewText(R.id.uploadNotificationsCount, String.format(getString(R.string.uploads_pending_notification_indicator), toUpload));
|
||||
Log.d("Commons", String.format("%d uploads left", toUpload));
|
||||
notificationManager.notify(NOTIFICATION_DOWNLOAD_IN_PROGRESS, curProgressNotification);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue