show the "Temporarily show hidden" menu item only when hidden media arent shown

This commit is contained in:
tibbi 2017-04-26 20:09:08 +02:00
parent 2b95a7f529
commit 0ee20b4604
2 changed files with 5 additions and 0 deletions

View file

@ -78,6 +78,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
menu.findItem(R.id.increase_column_count).isVisible = config.dirColumnCnt < 10 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.reduce_column_count).isVisible = config.dirColumnCnt > 1
} }
menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia
return true return true
} }
@ -106,6 +107,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mDirs.clear() mDirs.clear()
} }
tryloadGallery() tryloadGallery()
invalidateOptionsMenu()
} }
override fun onPause() { override fun onPause() {

View file

@ -76,6 +76,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mMedia.clear() mMedia.clear()
} }
tryloadGallery() tryloadGallery()
invalidateOptionsMenu()
} }
override fun onPause() { override fun onPause() {
@ -133,6 +134,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
findItem(R.id.open_camera).isVisible = mShowAll findItem(R.id.open_camera).isVisible = mShowAll
findItem(R.id.about).isVisible = mShowAll findItem(R.id.about).isVisible = mShowAll
findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia
findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10 findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10
findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1 findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1
} }