From e05e12bccedd42de3bb818808ea71ab6110050e7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 May 2019 20:25:58 +0200 Subject: [PATCH] allow creating new folders from the file thumbnails screen too --- .../gallery/pro/activities/MediaActivity.kt | 9 +++++++++ app/src/main/res/menu/menu_media.xml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index dff45ff8f..e2043f87d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -22,6 +22,7 @@ import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.transition.Transition import com.simplemobiletools.commons.dialogs.ConfirmationDialog +import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE @@ -220,6 +221,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { findItem(R.id.folder_view).isVisible = mShowAll findItem(R.id.open_camera).isVisible = mShowAll findItem(R.id.about).isVisible = mShowAll + findItem(R.id.create_new_folder).isVisible = !mShowAll && mPath != RECYCLE_BIN && mPath != FAVORITES findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden @@ -249,6 +251,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { R.id.hide_folder -> tryHideFolder() R.id.unhide_folder -> unhideFolder() R.id.exclude_folder -> tryExcludeFolder() + R.id.create_new_folder -> createNewFolder() R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() R.id.increase_column_count -> increaseColumnCount() @@ -625,6 +628,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { }.start() } + private fun createNewFolder() { + CreateNewFolderDialog(this, mPath) { + config.tempFolderPath = it + } + } + private fun tryToggleTemporarilyShowHidden() { if (config.temporarilyShowHidden) { toggleTemporarilyShowHidden(false) diff --git a/app/src/main/res/menu/menu_media.xml b/app/src/main/res/menu/menu_media.xml index 4693f03f1..1db3d9709 100644 --- a/app/src/main/res/menu/menu_media.xml +++ b/app/src/main/res/menu/menu_media.xml @@ -63,6 +63,10 @@ android:id="@+id/exclude_folder" android:title="@string/exclude" app:showAsAction="never"/> +