Added view pager for scrolling image previews with horizontal swipe
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / FileDataStorageManager.java
index 568ecbc..0cea0e0 100644 (file)
@@ -488,9 +488,9 @@ public class FileDataStorageManager implements DataStorageManager {
                         }
                     }
                 }
-                if (removeDBData) {
-                    removeFile(dir, true);
-                }
+            }
+            if (removeDBData) {
+                removeFile(dir, true);
             }
         }
     }
@@ -566,4 +566,21 @@ public class FileDataStorageManager implements DataStorageManager {
         }
     }
 
+    @Override
+    public Vector<OCFile> getDirectoryImages(OCFile directory) {
+        Vector<OCFile> ret = new Vector<OCFile>(); 
+        if (directory != null) {
+            // TODO better implementation, filtering in the access to database (if possible) instead of here 
+            Vector<OCFile> tmp = getDirectoryContent(directory);
+            OCFile current = null; 
+            for (int i=0; i<tmp.size(); i++) {
+                current = tmp.get(i);
+                if (current.isImage()) {
+                    ret.add(current);
+                }
+            }
+        }
+        return ret;
+    }
+
 }