show hidden items at SelectFolderDialog when selected so

This commit is contained in:
tibbi 2016-10-11 22:04:40 +02:00
parent 4785692dd7
commit 6d230260d8
2 changed files with 6 additions and 4 deletions

View File

@ -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");
}

View File

@ -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<FileDirItem> {
val showHidden = false//Config.newInstance(context).showHidden
val items = ArrayList<FileDirItem>()
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