mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-27 16:55:03 +01:00
use the helper function for checking if only one item is selected
This commit is contained in:
parent
d0c80a8cd0
commit
ae7d3e3f18
@ -61,8 +61,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList<Direc
|
||||
|
||||
override fun prepareActionMode(menu: Menu) {
|
||||
menu.apply {
|
||||
findItem(R.id.cab_rename).isVisible = selectedPositions.size == 1
|
||||
findItem(R.id.cab_change_cover_image).isVisible = selectedPositions.size == 1
|
||||
findItem(R.id.cab_rename).isVisible = isOneItemSelected()
|
||||
findItem(R.id.cab_change_cover_image).isVisible = isOneItemSelected()
|
||||
|
||||
checkHideBtnVisibility(this)
|
||||
checkPinBtnVisibility(this)
|
||||
|
@ -61,8 +61,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
|
||||
|
||||
override fun prepareActionMode(menu: Menu) {
|
||||
menu.apply {
|
||||
findItem(R.id.cab_rename).isVisible = selectedPositions.size == 1
|
||||
findItem(R.id.cab_open_with).isVisible = selectedPositions.size == 1
|
||||
findItem(R.id.cab_rename).isVisible = isOneItemSelected()
|
||||
findItem(R.id.cab_open_with).isVisible = isOneItemSelected()
|
||||
findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedPositions.size > 0
|
||||
|
||||
checkHideBtnVisibility(this)
|
||||
|
Loading…
Reference in New Issue
Block a user