do not show the Edit button at long pressing video

This commit is contained in:
tibbi 2017-03-08 21:38:26 +01:00
parent fd59d0d9aa
commit 23696bff32
1 changed files with 3 additions and 2 deletions

View File

@ -96,8 +96,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
} }
override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean { override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
menu.findItem(R.id.cab_rename).isVisible = multiSelector.selectedPositions.size <= 1 val selections = multiSelector.selectedPositions
menu.findItem(R.id.cab_edit).isVisible = multiSelector.selectedPositions.size <= 1 menu.findItem(R.id.cab_rename).isVisible = selections.size <= 1
menu.findItem(R.id.cab_edit).isVisible = selections.size == 1 && media[selections[0]].isImage()
return true return true
} }