Skip to content

Commit

Permalink
allow to go further up than default ext.dir (gsantner#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Mar 17, 2018
1 parent 9c54d4b commit 3bf25ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class FilesystemDialogCreator {
opts.selectedItemImage = R.drawable.ic_check_black_24dp;
opts.upButtonEnable = true;
opts.homeButtonEnable = true;
opts.mustStartWithRootFolder = false;

opts.primaryTextColor = darkTheme ? R.color.dark__primary_text : R.color.light__primary_text;
opts.secondaryTextColor = darkTheme ? R.color.dark__secondary_text : R.color.light__secondary_text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onClick(View view) {
case R.id.ui__filesystem_dialog__dir_up: {
_currentSelection.clear();
File parent = _currentFolder.getParentFile();
if (parent != null && parent.getAbsolutePath().startsWith(_dopt.rootFolder.getAbsolutePath())) {
if (parent != null && (!_dopt.mustStartWithRootFolder || parent.getAbsolutePath().startsWith(_dopt.rootFolder.getAbsolutePath()))) {
loadFolder(parent);
}
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static class Options {
doSelectFile = false,
doSelectMultiple = false;

public boolean mustStartWithRootFolder = true;

// Visibility of elements
public boolean
titleTextEnable = true,
Expand Down

0 comments on commit 3bf25ef

Please sign in to comment.