From 38f4ee21c4b727dcb20f32c82a561c22001f46a2 Mon Sep 17 00:00:00 2001 From: Jonas Kalderstam Date: Sat, 30 May 2015 13:50:56 +0200 Subject: [PATCH] Make createdir depend only on CREATE_DIR argument Fixes #25 Signed-off-by: Jonas Kalderstam --- .../nononsenseapps/filepicker/AbstractFilePickerFragment.java | 4 ++-- .../src/main/res/layout/activity_no_nonsense_file_picker.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java index e2309bc2..b2b3d213 100644 --- a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java +++ b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java @@ -64,7 +64,7 @@ public abstract class AbstractFilePickerFragment extends Fragment public static final String KEY_START_PATH = "KEY_START_PATH"; // See MODE_XXX constants above for possible values public static final String KEY_MODE = "KEY_MODE"; - // If it should be possible to create directories. Only valid with MODE_DIR + // If it should be possible to create directories. public static final String KEY_ALLOW_DIR_CREATE = "KEY_ALLOW_DIR_CREATE"; // Allow multiple items to be selected. public static final String KEY_ALLOW_MULTIPLE = "KEY_ALLOW_MULTIPLE"; @@ -296,7 +296,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.picker_actions, menu); MenuItem item = menu.findItem(R.id.action_createdir); - item.setVisible(allowCreateDir && (mode == MODE_DIR)); + item.setVisible(allowCreateDir); } @Override diff --git a/sample/src/main/res/layout/activity_no_nonsense_file_picker.xml b/sample/src/main/res/layout/activity_no_nonsense_file_picker.xml index 60bb264b..8fbb51f7 100644 --- a/sample/src/main/res/layout/activity_no_nonsense_file_picker.xml +++ b/sample/src/main/res/layout/activity_no_nonsense_file_picker.xml @@ -92,7 +92,7 @@