diff --git a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java index e08509a480..c30115c0f4 100644 --- a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -455,7 +455,7 @@ public class FileDataStorageManager { cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink()); cv.put(ProviderTableMeta.FILE_PERMISSIONS, folder.getPermissions()); cv.put(ProviderTableMeta.FILE_REMOTE_ID, folder.getRemoteId()); - cv.put(ProviderTableMeta.FILE_FAVORITE, folder.getIsFavorite()); + cv.put(ProviderTableMeta.FILE_FAVORITE, folder.isFavorite()); cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, folder.isEncrypted()); return cv; } @@ -487,7 +487,7 @@ public class FileDataStorageManager { cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail()); cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading()); cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict()); - cv.put(ProviderTableMeta.FILE_FAVORITE, file.getIsFavorite()); + cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite()); cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, file.isEncrypted()); cv.put(ProviderTableMeta.FILE_MOUNT_TYPE, file.getMountType().ordinal()); return cv; @@ -1399,7 +1399,7 @@ public class FileDataStorageManager { cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink()); cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions()); cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId()); - cv.put(ProviderTableMeta.FILE_FAVORITE, file.getIsFavorite()); + cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite()); cv.put( ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail() ? 1 : 0 diff --git a/src/main/java/com/owncloud/android/datamodel/OCFile.java b/src/main/java/com/owncloud/android/datamodel/OCFile.java index cdb15fd2fd..8b558bebe6 100644 --- a/src/main/java/com/owncloud/android/datamodel/OCFile.java +++ b/src/main/java/com/owncloud/android/datamodel/OCFile.java @@ -198,7 +198,7 @@ public class OCFile implements Parcelable, Comparable, ServerFileInterfa dest.writeSerializable(mMountType); } - public boolean getIsFavorite() { + public boolean isFavorite() { return mIsFavorite; } diff --git a/src/main/java/com/owncloud/android/files/FileMenuFilter.java b/src/main/java/com/owncloud/android/files/FileMenuFilter.java index ea5ca6ea71..405a0ef57a 100644 --- a/src/main/java/com/owncloud/android/files/FileMenuFilter.java +++ b/src/main/java/com/owncloud/android/files/FileMenuFilter.java @@ -495,7 +495,7 @@ public class FileMenuFilter { private boolean allFavorites() { for (OCFile file : mFiles) { - if (!file.getIsFavorite()) { + if (!file.isFavorite()) { return false; } } @@ -504,7 +504,7 @@ public class FileMenuFilter { private boolean allNotFavorites() { for (OCFile file : mFiles) { - if (file.getIsFavorite()) { + if (file.isFavorite()) { return false; } } diff --git a/src/main/java/com/owncloud/android/files/services/FileUploader.java b/src/main/java/com/owncloud/android/files/services/FileUploader.java index d4c3481cbb..4a9409eca7 100644 --- a/src/main/java/com/owncloud/android/files/services/FileUploader.java +++ b/src/main/java/com/owncloud/android/files/services/FileUploader.java @@ -961,15 +961,15 @@ public class FileUploader extends Service totalToTransfer, fileName); if (MainApp.getAppContext() != null) { - if (mCurrentUpload.getIsWifiRequired() && !Device.getNetworkType(MainApp.getAppContext()). + if (mCurrentUpload.isWifiRequired() && !Device.getNetworkType(MainApp.getAppContext()). equals(JobRequest.NetworkType.UNMETERED)) { cancel(mCurrentUpload.getAccount().name, mCurrentUpload.getFile().getRemotePath() , ResultCode.DELAYED_FOR_WIFI); - } else if (mCurrentUpload.getIsChargingRequired() && + } else if (mCurrentUpload.isChargingRequired() && !Device.getBatteryStatus(MainApp.getAppContext()).isCharging()) { cancel(mCurrentUpload.getAccount().name, mCurrentUpload.getFile().getRemotePath() , ResultCode.DELAYED_FOR_CHARGING); - } else if (!mCurrentUpload.getIsIgnoringPowerSaveMode() && + } else if (!mCurrentUpload.isIgnoringPowerSaveMode() && PowerUtils.isPowerSaveMode(MainApp.getAppContext())) { cancel(mCurrentUpload.getAccount().name, mCurrentUpload.getFile().getRemotePath() , ResultCode.DELAYED_IN_POWER_SAVE_MODE); diff --git a/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java b/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java index 8fbcfc6154..9f773e386b 100644 --- a/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java +++ b/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java @@ -144,8 +144,7 @@ public class DownloadFileOperation extends RemoteOperation { } public long getModificationTimestamp() { - return (mModificationTimestamp > 0) ? mModificationTimestamp : - mFile.getModificationTimestamp(); + return mModificationTimestamp > 0 ? mModificationTimestamp : mFile.getModificationTimestamp(); } public String getEtag() { diff --git a/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java b/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java index 578fb0e7ea..79465b16f2 100644 --- a/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java +++ b/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java @@ -245,7 +245,7 @@ public class SynchronizeFileOperation extends SyncOperation { // service when the upload finishes } else { // TODO CHECK: is this really useful in some point in the code? - mServerFile.setFavorite(mLocalFile.getIsFavorite()); + mServerFile.setFavorite(mLocalFile.isFavorite()); mServerFile.setAvailableOffline(mLocalFile.isAvailableOffline()); mServerFile.setLastSyncDateForData(mLocalFile.getLastSyncDateForData()); mServerFile.setStoragePath(mLocalFile.getStoragePath()); diff --git a/src/main/java/com/owncloud/android/operations/UploadFileOperation.java b/src/main/java/com/owncloud/android/operations/UploadFileOperation.java index 568a204d08..4f2d5b6d25 100644 --- a/src/main/java/com/owncloud/android/operations/UploadFileOperation.java +++ b/src/main/java/com/owncloud/android/operations/UploadFileOperation.java @@ -219,15 +219,15 @@ public class UploadFileOperation extends SyncOperation { mFolderUnlockToken = upload.getFolderUnlockToken(); } - public boolean getIsWifiRequired() { + public boolean isWifiRequired() { return mOnWifiOnly; } - public boolean getIsChargingRequired() { + public boolean isChargingRequired() { return mWhileChargingOnly; } - public boolean getIsIgnoringPowerSaveMode() { return mIgnoringPowerSaveMode; } + public boolean isIgnoringPowerSaveMode() { return mIgnoringPowerSaveMode; } public Account getAccount() { return mAccount; diff --git a/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java index 5369cb7d61..b994b76a87 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java @@ -338,7 +338,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter files, boolean shouldBeFavorite) { List alreadyRightStateList = new ArrayList<>(); for (OCFile file : files) { - if (file.getIsFavorite() == shouldBeFavorite) { + if (file.isFavorite() == shouldBeFavorite) { alreadyRightStateList.add(file); } } @@ -793,7 +793,7 @@ public class FileOperationsHelper { } public void toggleFavoriteFile(OCFile file, boolean shouldBeFavorite) { - if (file.getIsFavorite() != shouldBeFavorite) { + if (file.isFavorite() != shouldBeFavorite) { EventBus.getDefault().post(new FavoriteEvent(file.getRemotePath(), shouldBeFavorite, file.getRemoteId())); } } diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java b/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java index cd5cb923a7..bf58458b00 100644 --- a/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java +++ b/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java @@ -167,7 +167,7 @@ public class PreviewImageActivity extends FileActivity implements protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_WAITING_FOR_BINDER, mRequestWaitingForBinder); - outState.putBoolean(KEY_SYSTEM_VISIBLE, getSystemUIVisible()); + outState.putBoolean(KEY_SYSTEM_VISIBLE, isSystemUIVisible()); } @Override @@ -426,7 +426,7 @@ public class PreviewImageActivity extends FileActivity implements } } - public boolean getSystemUIVisible() { + public boolean isSystemUIVisible() { return getSupportActionBar() == null || getSupportActionBar().isShowing(); } diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java index 56135f4546..b4b7dc6b7b 100644 --- a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -728,7 +728,7 @@ public class PreviewImageFragment extends FileFragment { LayerDrawable layerDrawable = (LayerDrawable) mImageView.getDrawable(); Drawable layerOne; - if (previewImageActivity.getSystemUIVisible()) { + if (previewImageActivity.isSystemUIVisible()) { layerOne = getResources().getDrawable(R.color.white); } else { layerOne = getResources().getDrawable(R.drawable.backrepeat); diff --git a/src/main/java/com/owncloud/android/utils/FileSortOrder.java b/src/main/java/com/owncloud/android/utils/FileSortOrder.java index 2acc15a63f..993f73683e 100644 --- a/src/main/java/com/owncloud/android/utils/FileSortOrder.java +++ b/src/main/java/com/owncloud/android/utils/FileSortOrder.java @@ -79,11 +79,11 @@ public class FileSortOrder { */ public static List sortCloudFilesByFavourite(List files) { Collections.sort(files, (o1, o2) -> { - if (o1.getIsFavorite() && o2.getIsFavorite()) { + if (o1.isFavorite() && o2.isFavorite()) { return 0; - } else if (o1.getIsFavorite()) { + } else if (o1.isFavorite()) { return -1; - } else if (o2.getIsFavorite()) { + } else if (o2.isFavorite()) { return 1; } return 0; diff --git a/src/main/java/com/owncloud/android/utils/FileStorageUtils.java b/src/main/java/com/owncloud/android/utils/FileStorageUtils.java index 4f60432783..608279a317 100644 --- a/src/main/java/com/owncloud/android/utils/FileStorageUtils.java +++ b/src/main/java/com/owncloud/android/utils/FileStorageUtils.java @@ -195,7 +195,7 @@ public final class FileStorageUtils { file.setEtag(ocFile.getEtag()); file.setPermissions(ocFile.getPermissions()); file.setRemoteId(ocFile.getRemoteId()); - file.setFavorite(ocFile.getIsFavorite()); + file.setFavorite(ocFile.isFavorite()); return file; }