From c60e321278346f379fb057025d883f7a1bc48497 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Jun 2019 15:40:33 +0200 Subject: [PATCH] adding an Animation field at the slideshow config dialog --- .../gallery/pro/dialogs/SlideshowDialog.kt | 15 ++++++++ app/src/main/res/layout/activity_settings.xml | 4 ++- app/src/main/res/layout/dialog_slideshow.xml | 35 ++++++++++++++++++- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt index 7e97fec57..44a818665 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SlideshowDialog.kt @@ -7,6 +7,8 @@ import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.config +import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_ANIMATION_FADE +import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_ANIMATION_SLIDE import com.simplemobiletools.gallery.pro.helpers.SLIDESHOW_DEFAULT_INTERVAL import kotlinx.android.synthetic.main.dialog_slideshow.view.* @@ -28,6 +30,10 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit activity.hideKeyboard(v) } + animation_holder.setOnClickListener { + + } + include_videos_holder.setOnClickListener { interval_value.clearFocus() include_videos.toggle() @@ -74,6 +80,7 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit val config = activity.config view.apply { interval_value.setText(config.slideshowInterval.toString()) + animation_value.text = getAnimationText() include_videos.isChecked = config.slideshowIncludeVideos include_gifs.isChecked = config.slideshowIncludeGIFs random_order.isChecked = config.slideshowRandomOrder @@ -96,4 +103,12 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit loopSlideshow = view.loop_slideshow.isChecked } } + + private fun getAnimationText(): String { + return when (activity.config.slideshowAnimation) { + SLIDESHOW_ANIMATION_SLIDE -> activity.getString(R.string.slide) + SLIDESHOW_ANIMATION_FADE -> activity.getString(R.string.fade) + else -> activity.getString(R.string.no_animation) + } + } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 9331be83c..4a8c5a1c1 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -2,6 +2,7 @@ @@ -105,7 +106,8 @@ android:layout_alignParentEnd="true" android:layout_marginEnd="@dimen/small_margin" android:background="@null" - android:clickable="false"/> + android:clickable="false" + tools:text="@string/compromise"/> diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index b78daf699..86120da2c 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -1,6 +1,7 @@ @@ -35,10 +36,42 @@ android:textSize="@dimen/normal_text_size"/> + + + + + + + +