Skip to content

Commit

Permalink
Fix codacy issue
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev authored and alperozturk96 committed Feb 13, 2024
1 parent aee4a6c commit d75227a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ default void onDarkThemeModeChanged(DarkMode mode) {

void setCalendarLastBackup(long timestamp);

boolean getGlobalUploadPaused();
boolean isGlobalUploadPaused();

void setGlobalUploadPaused(boolean globalPausedState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public void setCalendarLastBackup(long timestamp) {
}

@Override
public boolean getGlobalUploadPaused() {
public boolean isGlobalUploadPaused() {
return preferences.getBoolean(PREF__GLOBAL_PAUSE_STATE,false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d75227a

Please sign in to comment.