mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
add a new slideshow setup toggle for including photos
This commit is contained in:
parent
3f1cfab633
commit
5b3fa44432
22 changed files with 55 additions and 1 deletions
|
@ -317,6 +317,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
private fun getMediaForSlideshow(): Boolean {
|
||||
mSlideshowMedia = mMedia.toMutableList()
|
||||
if (!config.slideshowIncludePhotos) {
|
||||
mSlideshowMedia = mSlideshowMedia.filter { !it.isImage() && !it.isGif() } as MutableList
|
||||
}
|
||||
|
||||
if (!config.slideshowIncludeVideos) {
|
||||
mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList
|
||||
}
|
||||
|
|
|
@ -32,6 +32,11 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
|
|||
activity.hideKeyboard(v)
|
||||
}
|
||||
|
||||
include_photos_holder.setOnClickListener {
|
||||
interval_value.clearFocus()
|
||||
include_photos.toggle()
|
||||
}
|
||||
|
||||
include_videos_holder.setOnClickListener {
|
||||
interval_value.clearFocus()
|
||||
include_videos.toggle()
|
||||
|
@ -67,6 +72,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
|
|||
val config = activity.config
|
||||
view.apply {
|
||||
interval_value.setText(config.slideshowInterval.toString())
|
||||
include_photos.isChecked = config.slideshowIncludePhotos
|
||||
include_videos.isChecked = config.slideshowIncludeVideos
|
||||
random_order.isChecked = config.slideshowRandomOrder
|
||||
use_fade.isChecked = config.slideshowUseFade
|
||||
|
@ -81,6 +87,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
|
|||
|
||||
activity.config.apply {
|
||||
slideshowInterval = interval.toInt()
|
||||
slideshowIncludePhotos = view.include_photos.isChecked
|
||||
slideshowIncludeVideos = view.include_videos.isChecked
|
||||
slideshowRandomOrder = view.random_order.isChecked
|
||||
slideshowUseFade = view.use_fade.isChecked
|
||||
|
|
|
@ -237,6 +237,10 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL)
|
||||
set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply()
|
||||
|
||||
var slideshowIncludePhotos: Boolean
|
||||
get() = prefs.getBoolean(SLIDESHOW_INCLUDE_PHOTOS, true)
|
||||
set(slideshowIncludePhotos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_PHOTOS, slideshowIncludePhotos).apply()
|
||||
|
||||
var slideshowIncludeVideos: Boolean
|
||||
get() = prefs.getBoolean(SLIDESHOW_INCLUDE_VIDEOS, false)
|
||||
set(slideshowIncludeVideos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_VIDEOS, slideshowIncludeVideos).apply()
|
||||
|
|
|
@ -36,6 +36,7 @@ val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate"
|
|||
|
||||
// slideshow
|
||||
val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||
val SLIDESHOW_INCLUDE_PHOTOS = "slideshow_include_photos"
|
||||
val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos"
|
||||
val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order"
|
||||
val SLIDESHOW_USE_FADE = "slideshow_use_fade"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
android:textCursorDrawable="@null"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/include_videos_holder"
|
||||
android:id="@+id/include_photos_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/interval_label"
|
||||
|
@ -46,6 +46,27 @@
|
|||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/include_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:text="@string/include_photos"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/include_videos_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/include_photos_holder"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/include_videos"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Prezentácia</string>
|
||||
<string name="interval">Interval (sekundy):</string>
|
||||
<string name="include_photos">Zahrnúť fotky a GIF súbory</string>
|
||||
<string name="include_videos">Zahrnúť videá</string>
|
||||
<string name="random_order">Náhodné poradie</string>
|
||||
<string name="use_fade">Používať miznúce animácie</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<!-- Slideshow -->
|
||||
<string name="slideshow">Slideshow</string>
|
||||
<string name="interval">Interval (seconds):</string>
|
||||
<string name="include_photos">Include photos and GIFs</string>
|
||||
<string name="include_videos">Include videos</string>
|
||||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
|
|
Loading…
Reference in a new issue