diff --git a/app/build.gradle b/app/build.gradle
index 7d977f0d0..3753ab9c3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -32,7 +32,7 @@ android {
}
dependencies {
- compile 'com.simplemobiletools:commons:2.22.0'
+ compile 'com.simplemobiletools:commons:2.22.1'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
index f38eb9b82..f734026bc 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -87,7 +87,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
menu.findItem(R.id.increase_column_count).isVisible = config.dirColumnCnt < 10
menu.findItem(R.id.reduce_column_count).isVisible = config.dirColumnCnt > 1
}
- menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia
+ menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
+ menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
return true
}
@@ -96,7 +97,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
R.id.sort -> showSortingDialog()
R.id.open_camera -> launchCamera()
R.id.show_all -> showAllMedia()
- R.id.temporarily_show_hidden -> temporarilyShowHidden()
+ R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true)
+ R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false)
R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount()
R.id.settings -> launchSettings()
@@ -208,9 +210,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
finish()
}
- private fun temporarilyShowHidden() {
- config.temporarilyShowHidden = true
+ private fun toggleTemporarilyShowHidden(show: Boolean) {
+ config.temporarilyShowHidden = show
getDirectories()
+ invalidateOptionsMenu()
}
private fun checkIfColorChanged() {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
index 0a5a34bab..5b5cb89a4 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
@@ -197,7 +197,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
findItem(R.id.open_camera).isVisible = mShowAll
findItem(R.id.about).isVisible = mShowAll
- findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia
+ findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
+ findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10
findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1
@@ -215,7 +216,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
R.id.hide_folder -> tryHideFolder()
R.id.unhide_folder -> unhideFolder()
R.id.exclude_folder -> tryExcludeFolder()
- R.id.temporarily_show_hidden -> temporarilyShowHidden()
+ R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true)
+ R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false)
R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount()
R.id.settings -> launchSettings()
@@ -314,9 +316,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
false
}
- private fun temporarilyShowHidden() {
- config.temporarilyShowHidden = true
+ private fun toggleTemporarilyShowHidden(show: Boolean) {
+ config.temporarilyShowHidden = show
getMedia()
+ invalidateOptionsMenu()
}
private fun getRecyclerAdapter() = (media_grid.adapter as MediaAdapter)
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
index 01937ceb9..c32d48135 100644
--- a/app/src/main/res/menu/menu_main.xml
+++ b/app/src/main/res/menu/menu_main.xml
@@ -19,6 +19,10 @@
android:id="@+id/temporarily_show_hidden"
android:title="@string/temporarily_show_hidden"
app:showAsAction="never"/>
+
+
diff --git a/app/src/main/res/menu/menu_media.xml b/app/src/main/res/menu/menu_media.xml
index 8a0cc4b29..b8b9b53c5 100644
--- a/app/src/main/res/menu/menu_media.xml
+++ b/app/src/main/res/menu/menu_media.xml
@@ -36,6 +36,10 @@
android:id="@+id/temporarily_show_hidden"
android:title="@string/temporarily_show_hidden"
app:showAsAction="never"/>
+