From 3a7e93f0951787e4b354328efa4b67cf818efae3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 26 Jun 2018 14:43:39 +0200 Subject: [PATCH] do not allow clicking bottom actions if faded away --- .../gallery/activities/PhotoVideoActivity.kt | 4 ++-- .../gallery/activities/ViewPagerActivity.kt | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 912f7541b..3d49e28c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -182,13 +182,13 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList bottom_delete.beGone() bottom_edit.setOnClickListener { - if (mUri != null) { + if (mUri != null && bottom_actions.alpha == 1f) { openEditor(mUri!!.toString()) } } bottom_share.setOnClickListener { - if (mUri != null) { + if (mUri != null && bottom_actions.alpha == 1f) { sharePath(mUri!!.toString()) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 015eafa9a..71fae94f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -762,19 +762,27 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun initBottomActionButtons() { bottom_favorite.setOnClickListener { - toggleFavorite() + if (bottom_actions.alpha == 1f) { + toggleFavorite() + } } bottom_edit.setOnClickListener { - openEditor(getCurrentPath()) + if (bottom_actions.alpha == 1f) { + openEditor(getCurrentPath()) + } } bottom_share.setOnClickListener { - shareMediumPath(getCurrentPath()) + if (bottom_actions.alpha == 1f) { + shareMediumPath(getCurrentPath()) + } } bottom_delete.setOnClickListener { - checkDeleteConfirmation() + if (bottom_actions.alpha == 1f) { + checkDeleteConfirmation() + } } }