From adc5b9b856d2e7255b98c658cbbe3908e5dc83bb Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 29 Jun 2018 23:25:27 +0200 Subject: [PATCH] make sure the proper bottom actions are shown at third party intent handling --- .../gallery/activities/PhotoVideoActivity.kt | 8 ++++++-- .../gallery/activities/ViewPagerActivity.kt | 2 +- 2 files changed, 7 insertions(+), 3 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 764f3ff82..c6ccf3a6c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -178,15 +178,19 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } private fun initBottomActionButtons() { - bottom_favorite.beGone() - bottom_delete.beGone() + arrayListOf(bottom_favorite, bottom_delete, bottom_rotate, bottom_properties, bottom_lock_orientation, bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility).forEach { + it.beGone() + } + val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0 + bottom_edit.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_EDIT != 0) bottom_edit.setOnClickListener { if (mUri != null && bottom_actions.alpha == 1f) { openEditor(mUri!!.toString()) } } + bottom_share.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SHARE != 0) bottom_share.setOnClickListener { 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 757be841e..0df7a7f4e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -768,7 +768,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun initBottomActionButtons() { - val visibleBottomActions = config.visibleBottomActions + val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0 bottom_favorite.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_TOGGLE_FAVORITE != 0) bottom_favorite.setOnClickListener { if (bottom_actions.alpha == 1f) {