Change DOWNLOAD to UPLOAD appropriately in constants

I am a geraffe
This commit is contained in:
YuviPanda 2013-02-06 17:07:42 +05:30
parent b4bdff5fc1
commit b4c1c2a06c

View file

@ -51,8 +51,8 @@ public class UploadService extends IntentService {
// DO NOT HAVE NOTIFICATION ID OF 0 FOR ANYTHING // DO NOT HAVE NOTIFICATION ID OF 0 FOR ANYTHING
// See http://stackoverflow.com/questions/8725909/startforeground-does-not-show-my-notification // See http://stackoverflow.com/questions/8725909/startforeground-does-not-show-my-notification
// Seriously, Android? // Seriously, Android?
public static final int NOTIFICATION_DOWNLOAD_IN_PROGRESS = 1; public static final int NOTIFICATION_UPLOAD_IN_PROGRESS = 1;
public static final int NOTIFICATION_DOWNLOAD_COMPLETE = 2; public static final int NOTIFICATION_UPLOAD_COMPLETE = 2;
public static final int NOTIFICATION_UPLOAD_FAILED = 3; public static final int NOTIFICATION_UPLOAD_FAILED = 3;
private class NotificationUpdateProgressListener implements ProgressListener { private class NotificationUpdateProgressListener implements ProgressListener {
@ -89,10 +89,10 @@ public class UploadService extends IntentService {
if(transferred == total) { if(transferred == total) {
// Completed! // Completed!
curView.setTextViewText(R.id.uploadNotificationTitle, notificationFinishingTitle); curView.setTextViewText(R.id.uploadNotificationTitle, notificationFinishingTitle);
notificationManager.notify(NOTIFICATION_DOWNLOAD_IN_PROGRESS, curNotification); notificationManager.notify(NOTIFICATION_UPLOAD_IN_PROGRESS, curNotification);
} else { } else {
curNotification.contentView.setProgressBar(R.id.uploadNotificationProgress, 100, (int) (((double) transferred / (double) total) * 100), false); curNotification.contentView.setProgressBar(R.id.uploadNotificationProgress, 100, (int) (((double) transferred / (double) total) * 100), false);
notificationManager.notify(NOTIFICATION_DOWNLOAD_IN_PROGRESS, curNotification); notificationManager.notify(NOTIFICATION_UPLOAD_IN_PROGRESS, curNotification);
} }
contribution.setTransferred(transferred); contribution.setTransferred(transferred);
contribution.save(); contribution.save();
@ -175,7 +175,7 @@ public class UploadService extends IntentService {
if(curProgressNotification != null && toUpload != 1) { if(curProgressNotification != null && toUpload != 1) {
curProgressNotification.contentView.setTextViewText(R.id.uploadNotificationsCount, String.format(getString(R.string.uploads_pending_notification_indicator), toUpload)); 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)); Log.d("Commons", String.format("%d uploads left", toUpload));
notificationManager.notify(NOTIFICATION_DOWNLOAD_IN_PROGRESS, curProgressNotification); notificationManager.notify(NOTIFICATION_UPLOAD_IN_PROGRESS, curProgressNotification);
} }
Contribution contribution = mediaFromIntent(intent); Contribution contribution = mediaFromIntent(intent);
@ -222,7 +222,7 @@ public class UploadService extends IntentService {
.setTicker(String.format(getString(R.string.upload_progress_notification_title_in_progress), contribution.getFilename())) .setTicker(String.format(getString(R.string.upload_progress_notification_title_in_progress), contribution.getFilename()))
.getNotification(); .getNotification();
this.startForeground(NOTIFICATION_DOWNLOAD_IN_PROGRESS, curProgressNotification); this.startForeground(NOTIFICATION_UPLOAD_IN_PROGRESS, curProgressNotification);
Log.d("Commons", "Just before"); Log.d("Commons", "Just before");