adding an Animation field at the slideshow config dialog

This commit is contained in:
tibbi
2019-06-20 15:40:33 +02:00
parent ecb1557bd7
commit c60e321278
3 changed files with 52 additions and 2 deletions

View File

@ -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)
}
}
}