add a "Temporarily show hidden" menu button to media view

This commit is contained in:
tibbi 2017-04-26 19:58:50 +02:00
parent f137f3db06
commit 2b95a7f529
2 changed files with 15 additions and 0 deletions

View File

@ -88,6 +88,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
MyScalableRecyclerView.mListener = null MyScalableRecyclerView.mListener = null
} }
override fun onStop() {
super.onStop()
config.temporarilyShowHidden = false
}
private fun tryloadGallery() { private fun tryloadGallery() {
if (hasWriteStoragePermission()) { if (hasWriteStoragePermission()) {
val dirName = getHumanizedFilename(mPath) val dirName = getHumanizedFilename(mPath)
@ -144,6 +149,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
R.id.hide_folder -> tryHideFolder() R.id.hide_folder -> tryHideFolder()
R.id.unhide_folder -> unhideFolder() R.id.unhide_folder -> unhideFolder()
R.id.exclude_folder -> tryExcludeFolder() R.id.exclude_folder -> tryExcludeFolder()
R.id.temporarily_show_hidden -> temporarilyShowHidden()
R.id.increase_column_count -> increaseColumnCount() R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount() R.id.reduce_column_count -> reduceColumnCount()
R.id.settings -> launchSettings() R.id.settings -> launchSettings()
@ -243,6 +249,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
false false
} }
private fun temporarilyShowHidden() {
config.temporarilyShowHidden = true
getMedia()
}
private fun handleZooming() { private fun handleZooming() {
val layoutManager = media_grid.layoutManager as GridLayoutManager val layoutManager = media_grid.layoutManager as GridLayoutManager
layoutManager.spanCount = config.mediaColumnCnt layoutManager.spanCount = config.mediaColumnCnt

View File

@ -32,6 +32,10 @@
android:id="@+id/exclude_folder" android:id="@+id/exclude_folder"
android:title="@string/exclude" android:title="@string/exclude"
app:showAsAction="never"/> app:showAsAction="never"/>
<item
android:id="@+id/temporarily_show_hidden"
android:title="@string/temporarily_show_hidden"
app:showAsAction="never"/>
<item <item
android:id="@+id/increase_column_count" android:id="@+id/increase_column_count"
android:title="@string/increase_column_count" android:title="@string/increase_column_count"