hide hidden files and folders if set so

This commit is contained in:
tibbi
2016-09-04 22:57:52 +02:00
parent 40a41bcff6
commit a904a76bd8

View File

@ -12,6 +12,7 @@ import android.widget.AdapterView;
import android.widget.ListView;
import com.simplemobiletools.filemanager.Breadcrumbs;
import com.simplemobiletools.filemanager.Config;
import com.simplemobiletools.filemanager.R;
import com.simplemobiletools.filemanager.Utils;
import com.simplemobiletools.filemanager.adapters.ItemsAdapter;
@ -99,6 +100,7 @@ public class SelectFolderDialog extends DialogFragment {
}
private List<FileDirItem> getItems(String path) {
final boolean showHidden = Config.newInstance(getContext()).getShowHidden();
final List<FileDirItem> items = new ArrayList<>();
final File base = new File(path);
File[] files = base.listFiles();
@ -107,6 +109,9 @@ public class SelectFolderDialog extends DialogFragment {
if (!file.isDirectory())
continue;
if (file.isHidden() && !showHidden)
continue;
final String curPath = file.getAbsolutePath();
final String curName = Utils.getFilename(curPath);
int children = getChildren(file);