From 6d230260d8f6a2b49c0ebf339522da890c2b56a0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Oct 2016 22:04:40 +0200 Subject: [PATCH] show hidden items at SelectFolderDialog when selected so --- .../filemanager/fragments/ItemsFragment.java | 3 ++- .../filepicker/dialogs/SelectFolderDialog.kt | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java index f1cb2b4d..02175786 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java @@ -548,7 +548,8 @@ public class ItemsFragment extends android.support.v4.app.Fragment private View.OnClickListener destinationPicker = new View.OnClickListener() { @Override public void onClick(final View view) { - SelectFolderDialog dialog = SelectFolderDialog.Companion.newInstance(mCopyDestinationPath); + final boolean showHiddenItems = Config.newInstance(getContext()).getShowHidden(); + SelectFolderDialog dialog = SelectFolderDialog.Companion.newInstance(mCopyDestinationPath, showHiddenItems); dialog.setTargetFragment(ItemsFragment.this, SELECT_FOLDER_REQUEST); dialog.show(getFragmentManager(), "selectFolder"); } diff --git a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt index b1168fe9..ec934522 100644 --- a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt +++ b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt @@ -24,10 +24,12 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { companion object { lateinit var mPath: String var mFirstUpdate: Boolean = true + var mShowHidden: Boolean = false - fun newInstance(path: String): SelectFolderDialog { + fun newInstance(path: String, showHidden: Boolean): SelectFolderDialog { mPath = path mFirstUpdate = true + mShowHidden = showHidden return SelectFolderDialog() } } @@ -83,7 +85,6 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { } private fun getItems(path: String): List { - val showHidden = false//Config.newInstance(context).showHidden val items = ArrayList() val base = File(path) val files = base.listFiles() @@ -92,7 +93,7 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { if (!file.isDirectory) continue - if (!showHidden && file.isHidden) + if (!mShowHidden && file.isHidden) continue val curPath = file.absolutePath