From 23696bff32ab03fa15fe8d3521b6537bcf3365c7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Mar 2017 21:38:26 +0100 Subject: [PATCH] do not show the Edit button at long pressing video --- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index a30d69d2c..0061d429a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -96,8 +96,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean { - menu.findItem(R.id.cab_rename).isVisible = multiSelector.selectedPositions.size <= 1 - menu.findItem(R.id.cab_edit).isVisible = multiSelector.selectedPositions.size <= 1 + val selections = multiSelector.selectedPositions + 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 }