From 60494b0cfdd6def6b003222b9051e21a19f7b551 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Oct 2016 14:59:16 +0200 Subject: [PATCH] hide hidden folders if set so --- .../gallery/activities/MainActivity.java | 9 ++++++--- .../gallery/activities/MediaActivity.java | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java index 642b07f51..00358092c 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java @@ -16,6 +16,7 @@ import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AlertDialog; +import android.util.Log; import android.util.SparseBooleanArray; import android.view.ActionMode; import android.view.Menu; @@ -229,7 +230,7 @@ public class MainActivity extends SimpleActivity } final List dirs = new ArrayList<>(directories.values()); - filderDirectories(dirs); + filterDirectories(dirs); Directory.mSorting = mConfig.getDirectorySorting(); Collections.sort(dirs); @@ -239,8 +240,10 @@ public class MainActivity extends SimpleActivity return dirs; } - private void filderDirectories(List dirs) { - removeHiddenFolders(dirs); + private void filterDirectories(List dirs) { + if (!mConfig.getShowHiddenFolders()) + removeHiddenFolders(dirs); + removeNoMediaFolders(dirs); } diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java index cc54c8385..065f34c64 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java @@ -166,6 +166,7 @@ public class MediaActivity extends SimpleActivity private void hideDirectory() { mConfig.addHiddenDirectory(mPath); + finish(); } private void deleteDirectoryIfEmpty() {