mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +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
|
|
@ -51,7 +51,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:focusable="true"
|
||||
android:text="1 left"
|
||||
android:focusableInTouchMode="true"
|
||||
style="@style/NotificationText"
|
||||
android:layout_marginLeft="8dp"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<string name="upload_progress_notification_title_finishing">Finishing uploading %1$s</string>
|
||||
<string name="upload_failed_notification_title">Uploading %1$s failed</string>
|
||||
<string name="upload_failed_notification_subtitle">Tap to retry</string>
|
||||
<string name="uploads_pending_notification_indicator">%d</string>
|
||||
<string name="uploads_pending_notification_indicator">%d left</string>
|
||||
|
||||
<string name="transcoding_progress_title_start">Starting %1$s Transcoding</string>
|
||||
<string name="transcoding_progress_title_in_progress">Transcoding %1$s</string>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="NotificationText">
|
||||
<style name="NotificationText" parent="android:TextAppearance.DeviceDefault.Small">
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -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