mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
show a toast if the slideshow ended + implement moving backwards
This commit is contained in:
parent
e3a5b9356e
commit
c47ddc536d
18 changed files with 26 additions and 1 deletions
|
@ -52,8 +52,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private var mRotationDegrees = 0f
|
||||
private var mLastHandledOrientation = 0
|
||||
private var mPrevHashcode = 0
|
||||
|
||||
private var mSlideshowHandler = Handler()
|
||||
private var mSlideshowInterval = SLIDESHOW_DEFAULT_INTERVAL
|
||||
private var mSlideshowMoveBackwards = false
|
||||
|
||||
companion object {
|
||||
var screenWidth = 0
|
||||
|
@ -261,6 +263,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private fun startSlideshow() {
|
||||
hideSystemUI()
|
||||
mSlideshowInterval = config.slideshowInterval
|
||||
mSlideshowMoveBackwards = config.slideshowMoveBackwards
|
||||
mIsSlideshowActive = true
|
||||
scheduleSwipe()
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
|
@ -280,7 +283,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
if (mIsSlideshowActive) {
|
||||
mSlideshowHandler.postDelayed({
|
||||
if (mIsSlideshowActive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) {
|
||||
view_pager.currentItem = ++view_pager.currentItem
|
||||
val before = view_pager.currentItem
|
||||
view_pager.currentItem = if (mSlideshowMoveBackwards) --view_pager.currentItem else ++view_pager.currentItem
|
||||
if (before == view_pager.currentItem) {
|
||||
stopSlideshow()
|
||||
toast(R.string.slideshow_ended)
|
||||
}
|
||||
}
|
||||
}, mSlideshowInterval * 1000L)
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Zobrazit skryté média</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Versteckte Ordner zeigen</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Mostrar carpetas ocultas</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Afficher les dossiers cachés</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Show hidden media</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Mostra cartelle nascoste</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">非表示フォルダーを表示</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Pokazuj ukryte foldery</string>
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Mostrar pastas ocultas</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Mostrar pastas ocultas</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Показать скрытые папки</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Náhodné poradie</string>
|
||||
<string name="use_fade">Používať miznúce animácie</string>
|
||||
<string name="move_backwards">Ísť opačným smerom</string>
|
||||
<string name="slideshow_ended">Prezentácia skončila</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Zobraziť skryté médiá</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Visa dolda mappar</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Gizli klasörleri göster</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">显示所有</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">秀出隱藏資料夾</string>
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<string name="random_order">Random order</string>
|
||||
<string name="use_fade">Use fade animations</string>
|
||||
<string name="move_backwards">Move backwards</string>
|
||||
<string name="slideshow_ended">The slideshow ended</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="show_hidden_media">Show hidden media</string>
|
||||
|
|
Loading…
Reference in a new issue