From 1b008490a8c962c30a21ac634807397fc250e262 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 17 Jun 2018 16:08:57 +0200 Subject: [PATCH] handle bottom action button clicks --- .../gallery/activities/ViewPagerActivity.kt | 12 ++++++++---- app/src/main/res/layout/activity_medium.xml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) 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 f681de3e8..784bf8fcd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -275,6 +275,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val currentMedium = getCurrentMedium() ?: return true menu.apply { + findItem(R.id.menu_properties).isVisible = !config.bottomActions + findItem(R.id.menu_delete).isVisible = !config.bottomActions + findItem(R.id.menu_share).isVisible = !config.bottomActions + findItem(R.id.menu_edit).isVisible = !config.bottomActions findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0 findItem(R.id.menu_hide).isVisible = !currentMedium.name.startsWith('.') @@ -742,19 +746,19 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun initBottomActionButtons() { bottom_properties.setOnClickListener { - + showProperties() } bottom_edit.setOnClickListener { - + openEditor(getCurrentPath()) } bottom_share.setOnClickListener { - + shareMedium(getCurrentMedium()!!) } bottom_delete.setOnClickListener { - + checkDeleteConfirmation() } } diff --git a/app/src/main/res/layout/activity_medium.xml b/app/src/main/res/layout/activity_medium.xml index 368540386..0a1dcc508 100644 --- a/app/src/main/res/layout/activity_medium.xml +++ b/app/src/main/res/layout/activity_medium.xml @@ -36,7 +36,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="@dimen/medium_margin" - android:src="@drawable/ic_rename" + android:src="@drawable/ic_edit" app:layout_constraintEnd_toStartOf="@+id/bottom_share" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/bottom_properties"/>