diff --git a/app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadWorker.kt b/app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadWorker.kt index 329884886c2a..91b2586ef82b 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadWorker.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadWorker.kt @@ -144,7 +144,7 @@ class FileUploadWorker( var currentPage = uploadsStorageManager.getCurrentAndPendingUploadsForAccountPageAscById(-1, accountName) while (currentPage.isNotEmpty() && !isStopped) { - if (preferences.globalUploadPaused) { + if (preferences.isGlobalUploadPaused) { Log_OC.d(TAG, "Upload is paused, skip uploading files!") notificationManager.notifyPaused( intents.notificationStartIntent(null) diff --git a/app/src/main/java/com/nextcloud/client/preferences/AppPreferences.java b/app/src/main/java/com/nextcloud/client/preferences/AppPreferences.java index e11c5bf09b29..febd96c6215d 100644 --- a/app/src/main/java/com/nextcloud/client/preferences/AppPreferences.java +++ b/app/src/main/java/com/nextcloud/client/preferences/AppPreferences.java @@ -387,7 +387,7 @@ default void onDarkThemeModeChanged(DarkMode mode) { void setCalendarLastBackup(long timestamp); - boolean getGlobalUploadPaused(); + boolean isGlobalUploadPaused(); void setGlobalUploadPaused(boolean globalPausedState); diff --git a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java index 79489a321aae..ac69794aafcb 100644 --- a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java +++ b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java @@ -744,7 +744,7 @@ public void setCalendarLastBackup(long timestamp) { } @Override - public boolean getGlobalUploadPaused() { + public boolean isGlobalUploadPaused() { return preferences.getBoolean(PREF__GLOBAL_PAUSE_STATE,false); } diff --git a/app/src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java index b5977d7188f9..aff97bc173f5 100755 --- a/app/src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java @@ -29,9 +29,6 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; @@ -60,16 +57,11 @@ import com.owncloud.android.ui.adapter.UploadListAdapter; import com.owncloud.android.ui.decoration.MediaGridItemDecoration; import com.owncloud.android.utils.DisplayUtils; -import com.owncloud.android.utils.DrawableUtil; import com.owncloud.android.utils.FilesSyncHelper; import com.owncloud.android.utils.theme.ViewThemeUtils; import javax.inject.Inject; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.content.res.AppCompatResources; -import androidx.core.content.res.ResourcesCompat; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.recyclerview.widget.GridLayoutManager; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -289,7 +281,7 @@ private void updateGlobalPauseIcon(MenuItem pauseMenuItem) { int iconId; String title; - if (preferences.getGlobalUploadPaused()) { + if (preferences.isGlobalUploadPaused()) { iconId = R.drawable.ic_play; title = getString(R.string.upload_action_global_upload_resume); } else { @@ -303,7 +295,7 @@ private void updateGlobalPauseIcon(MenuItem pauseMenuItem) { @SuppressLint("NotifyDataSetChanged") private void toggleGlobalPause(MenuItem pauseMenuItem) { - preferences.setGlobalUploadPaused(!preferences.getGlobalUploadPaused()); + preferences.setGlobalUploadPaused(!preferences.isGlobalUploadPaused()); updateGlobalPauseIcon(pauseMenuItem); for (User user : accountManager.getAllUsers()) { diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java index f7d5f8132cff..50168c5b0dc0 100755 --- a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java @@ -29,7 +29,6 @@ import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; -import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.net.Uri; import android.text.format.DateUtils; @@ -643,7 +642,7 @@ private String getStatusText(OCUpload upload) { // really uploading, bind the progress bar to listen for progress updates status = parentActivity.getString(R.string.uploader_upload_in_progress_ticker); } - if (parentActivity.getAppPreferences().getGlobalUploadPaused()) { + if (parentActivity.getAppPreferences().isGlobalUploadPaused()) { status = parentActivity.getString(R.string.upload_global_pause_title); } }