From 8b23c3a7a693d3ab7f8a6ca721b24a80011fb13c Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Sun, 2 Aug 2015 08:19:28 +0200 Subject: [PATCH] ignore hidden files also if they are images for counting --- src/com/owncloud/android/datamodel/OCFile.java | 7 +++++++ .../owncloud/android/ui/fragment/OCFileListFragment.java | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index d1821b44e4..2aa5dbc07f 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -543,6 +543,13 @@ public class OCFile implements Parcelable, Comparable { FileStorageUtils.getMimeTypeFromName(mRemotePath).startsWith("image/")); } + /** + * @return 'True' if the file is hidden + */ + public boolean isHidden() { + return getFileName().startsWith("."); + } + public String getPermissions() { return mPermissions; } diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 47d9992576..9bcd1bc6aa 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -428,9 +428,12 @@ public class OCFileListFragment extends ExtendedListFragment { if (file.isFolder()) { foldersCount++; } else { - filesCount++; - if (file.isImage()){ - imagesCount++; + if (!file.isHidden()) { + filesCount++; + + if (file.isImage()) { + imagesCount++; + } } } }