Browse Source

Count hidden files in footer files counter

When "show hidden files" option is enabled, count hidden files
in footer counter the same way folders are counted.

fixes #3597

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
Chris Narkiewicz 6 years ago
parent
commit
8671252285

+ 3 - 1
src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -456,17 +456,19 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         int foldersCount = 0;
         int count = mFiles.size();
         OCFile file;
+        final boolean showHiddenFiles = PreferenceManager.showHiddenFilesEnabled(mContext);
         for (int i = 0; i < count; i++) {
             file = getItem(i);
             if (file.isFolder()) {
                 foldersCount++;
             } else {
-                if (!file.isHidden()) {
+                if (!file.isHidden() || showHiddenFiles) {
                     filesCount++;
                 }
             }
         }
 
+
         return generateFooterText(filesCount, foldersCount);
     }