From ae7d3e3f18e4c9f89f9bb362353859874f669f5f Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 13 Dec 2017 19:47:58 +0100 Subject: [PATCH] use the helper function for checking if only one item is selected --- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 4 ++-- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 25a95566a..a8ee3f75f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -61,8 +61,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList, 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)