hide the menu buttons for changing column count at list views

This commit is contained in:
tibbi 2017-09-28 21:55:33 +02:00
parent 5e733a44c3
commit 2eabff531b
2 changed files with 6 additions and 4 deletions

View file

@ -95,8 +95,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
menuInflater.inflate(R.menu.menu_main_intent, menu) menuInflater.inflate(R.menu.menu_main_intent, menu)
} else { } else {
menuInflater.inflate(R.menu.menu_main, menu) menuInflater.inflate(R.menu.menu_main, menu)
menu.findItem(R.id.increase_column_count).isVisible = config.dirColumnCnt < 10 menu.findItem(R.id.increase_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt < 10
menu.findItem(R.id.reduce_column_count).isVisible = config.dirColumnCnt > 1 menu.findItem(R.id.reduce_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt > 1
} }
menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
@ -255,6 +255,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
RadioGroupDialog(this, items, config.viewTypeFolders) { RadioGroupDialog(this, items, config.viewTypeFolders) {
config.viewTypeFolders = it as Int config.viewTypeFolders = it as Int
invalidateOptionsMenu()
} }
} }

View file

@ -210,8 +210,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10 findItem(R.id.increase_column_count).isVisible = config.viewTypeFiles == VIEW_TYPE_GRID && config.mediaColumnCnt < 10
findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1 findItem(R.id.reduce_column_count).isVisible = config.viewTypeFiles == VIEW_TYPE_GRID && config.mediaColumnCnt > 1
} }
return true return true
@ -271,6 +271,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
RadioGroupDialog(this, items, config.viewTypeFiles) { RadioGroupDialog(this, items, config.viewTypeFiles) {
config.viewTypeFiles = it as Int config.viewTypeFiles = it as Int
invalidateOptionsMenu()
} }
} }