Sfoglia il codice sorgente

Reduce spotbugs

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 anno fa
parent
commit
ae5df18ea4

+ 0 - 18
app/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -260,24 +260,6 @@ public final class ThumbnailsCacheManager {
         return null;
     }
 
-    public static class GalleryImageGenerationTaskObject {
-        private final OCFile file;
-        private final String imageKey;
-
-        public GalleryImageGenerationTaskObject(OCFile file, String imageKey) {
-            this.file = file;
-            this.imageKey = imageKey;
-        }
-
-        private OCFile getFile() {
-            return file;
-        }
-
-        private String getImageKey() {
-            return imageKey;
-        }
-    }
-
     public static class GalleryImageGenerationTask extends AsyncTask<Object, Void, Bitmap> {
         private final User user;
         private final FileDataStorageManager storageManager;

+ 17 - 16
app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -313,6 +313,21 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         return mFiles.size() + (shouldShowHeader() ? 2 : 1);
     }
 
+    @Nullable
+    public OCFile getItem(int position) {
+        int newPosition = position;
+
+        if (shouldShowHeader() && position > 0) {
+            newPosition = position - 1;
+        }
+
+        if (newPosition >= mFiles.size()) {
+            return null;
+        }
+
+        return mFiles.get(newPosition);
+    }
+
     @Override
     public int getItemViewType(int position) {
         if (shouldShowHeader() && position == 0) {
@@ -636,21 +651,6 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         return output;
     }
 
-    public @Nullable
-    OCFile getItem(int position) {
-        int newPosition = position;
-
-        if (shouldShowHeader() && position > 0) {
-            newPosition = position - 1;
-        }
-
-        if (newPosition >= mFiles.size()) {
-            return null;
-        }
-
-        return mFiles.get(newPosition);
-    }
-
     public boolean shouldShowHeader() {
         if (currentDirectory == null) {
             return false;
@@ -679,7 +679,8 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         @NonNull User account,
         @NonNull OCFile directory,
         @NonNull FileDataStorageManager updatedStorageManager,
-        boolean onlyOnDevice, @NonNull String limitToMimeType) {
+        boolean onlyOnDevice,
+        @NonNull String limitToMimeType) {
         this.onlyOnDevice = onlyOnDevice;
 
         if (!updatedStorageManager.equals(mStorageManager)) {