diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 45badc869..ed4b332a9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -177,10 +177,10 @@ class SettingsActivity : SimpleActivity() { } private fun setupRememberLastVideo() { - settings_remember_last_video.isChecked = config.rememberLastVideo - settings_remember_last_video_holder.setOnClickListener { - settings_remember_last_video.toggle() - config.rememberLastVideo = settings_remember_last_video.isChecked + settings_remember_last_video_position.isChecked = config.rememberLastVideoPosition + settings_remember_last_video_position_holder.setOnClickListener { + settings_remember_last_video_position.toggle() + config.rememberLastVideoPosition = settings_remember_last_video_position.isChecked } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index c60f20c31..842eebf9e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -66,7 +66,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private var mStoredHideExtendedDetails = false private var mStoredBottomActions = true private var mStoredExtendedDetails = 0 - private var mStoredRememberLastVideo = false + private var mStoredRememberLastVideoPosition = false private var mStoredLastVideoPath = "" private var mStoredLastVideoProgress = 0 @@ -170,8 +170,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } setupVideoDuration() - if (mStoredRememberLastVideo) { - setSavedProgress() + if (mStoredRememberLastVideoPosition) { + setLastVideoSavedProgress() } updateInstantSwitchWidths() @@ -208,7 +208,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S override fun onPause() { super.onPause() pauseVideo() - if (mStoredRememberLastVideo) { + if (mStoredRememberLastVideoPosition) { saveVideoProgress() } @@ -248,7 +248,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mStoredHideExtendedDetails = hideExtendedDetails mStoredExtendedDetails = extendedDetails mStoredBottomActions = bottomActions - mStoredRememberLastVideo = rememberLastVideo + mStoredRememberLastVideoPosition = rememberLastVideoPosition mStoredLastVideoPath = lastVideoPath mStoredLastVideoProgress = lastVideoProgress } @@ -342,21 +342,20 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S listener?.fragmentClicked() } - private fun setSavedProgress() { + private fun setLastVideoSavedProgress() { if (mStoredLastVideoPath == medium.path && mStoredLastVideoProgress > 0) { setProgress(mStoredLastVideoProgress) } } private fun initTimeHolder() { - val res = resources val left = 0 val top = 0 var right = 0 var bottom = 0 if (hasNavBar()) { - if (res.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) { + if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) { bottom += context!!.navigationBarHeight } else { right += context!!.navigationBarWidth @@ -466,9 +465,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S setProgress(0) } - if (mStoredRememberLastVideo) { - setSavedProgress() - clearSavedProgress() + if (mStoredRememberLastVideoPosition) { + setLastVideoSavedProgress() + clearLastVideoSavedProgress() } if (!wasEnded || context?.config?.loopVideos == false) { @@ -482,9 +481,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } - private fun clearSavedProgress() { + private fun clearLastVideoSavedProgress() { mStoredLastVideoProgress = 0 - mStoredLastVideoPath = "/" + mStoredLastVideoPath = "" } private fun pauseVideo() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index fbb3a0831..5336f8fb6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -148,10 +148,6 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(AUTOPLAY_VIDEOS, false) set(autoplay) = prefs.edit().putBoolean(AUTOPLAY_VIDEOS, autoplay).apply() - var rememberLastVideo: Boolean - get() = prefs.getBoolean(REMEMBER_LAST_VIDEO, false) - set(rememberVideo) = prefs.edit().putBoolean(REMEMBER_LAST_VIDEO, rememberVideo).apply() - var animateGifs: Boolean get() = prefs.getBoolean(ANIMATE_GIFS, false) set(animateGifs) = prefs.edit().putBoolean(ANIMATE_GIFS, animateGifs).apply() @@ -369,8 +365,12 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(BOTTOM_ACTIONS, true) set(bottomActions) = prefs.edit().putBoolean(BOTTOM_ACTIONS, bottomActions).apply() + var rememberLastVideoPosition: Boolean + get() = prefs.getBoolean(REMEMBER_LAST_VIDEO_POSITION, false) + set(rememberLastVideoPosition) = prefs.edit().putBoolean(REMEMBER_LAST_VIDEO_POSITION, rememberLastVideoPosition).apply() + var lastVideoPath: String - get() = prefs.getString(LAST_VIDEO_PATH, "/") + get() = prefs.getString(LAST_VIDEO_PATH, "") set(lastVideoPath) = prefs.edit().putString(LAST_VIDEO_PATH, lastVideoPath).apply() var lastVideoProgress: Int diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 529eae1c6..2ffde92d2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -10,7 +10,7 @@ const val SHOW_HIDDEN_MEDIA = "show_hidden_media" const val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden" const val IS_THIRD_PARTY_INTENT = "is_third_party_intent" const val AUTOPLAY_VIDEOS = "autoplay_videos" -const val REMEMBER_LAST_VIDEO = "remember_last_video" +const val REMEMBER_LAST_VIDEO_POSITION = "remember_last_video_position" const val LOOP_VIDEOS = "loop_videos" const val ANIMATE_GIFS = "animate_gifs" const val MAX_BRIGHTNESS = "max_brightness" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 7699cd830..06912da55 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -279,7 +279,7 @@ diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 5097a3140..4c97858c1 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -137,7 +137,7 @@ تشغيل الفديوهات تلقائيا - Remember last video playback position + Remember last video playback position تبديل رؤية اسم الملف حلقة الفيديو عرض صور GIF المتحركة في الصور المصغرة diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index f958f3eb4..d2eb21889 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -133,7 +133,7 @@ Play videos automatically - Remember last video playback position + Remember last video playback position Toggle filename visibility Loop videos Animate GIFs at thumbnails diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index c50f3f613..8bf6392b2 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -133,7 +133,7 @@ Reproduir vídeos automàticament - Remember last video playback position + Remember last video playback position Canviar la visibilitat del nom d\'arxiu Reproducció continua de vídeos Animar les miniatures dels GIFs diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index d04c4332d..b08b981a0 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -133,7 +133,7 @@ Automaticky přehrávat videa - Remember last video playback position + Remember last video playback position Přepnout viditelnost názvů souborů Přehrávat videa ve smyčce Animovat náhledy souborů GIF diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 1ab75de23..945387d93 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -133,7 +133,7 @@ Afspil automatisk videoer - Remember last video playback position + Remember last video playback position Toggle filename visibility Kør videoer i sløjfe Animér GIF\'er i miniaturer diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 6f40cef7e..ca0c2ac16 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -133,7 +133,7 @@ Videos automatisch abspielen - Remember last video playback position + Remember last video playback position Beschriftungen ein/aus Videos in Endlosschleife abspielen Kacheln von GIFs animieren diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index bd01a4fae..60e75cf2e 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -133,7 +133,7 @@ Αυτόματη αναπαραγωγή βίντεο - Remember last video playback position + Remember last video playback position Αλλαγή προβολής ονόματος αρχείων Επανάληψη βίντεο Εμφάνιση κινούμενων GIFs στα εικονίδια diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 32544705f..095e6ba66 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -133,7 +133,7 @@ Reproducir vídeos automáticamente - Remember last video playback position + Remember last video playback position Cambiar la visibilidad del nombre de archivo Reproducción continua de vídeos Animar las miniaturas de GIFs diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 83246ed98..c862f51f2 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -133,7 +133,7 @@ Toista videot automaattisesti - Remember last video playback position + Remember last video playback position Tiedostonimien näkyvyys Jatkuvat videot Animoi GIFit pienoiskuvissa diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9e7d19c1e..d7ec4d5c2 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -133,7 +133,7 @@ Lecture automatique des vidéos - Remember last video playback position + Remember last video playback position Permuter la visibilité des noms de fichier Lecture en boucle des vidéos GIFs animés sur les miniatures diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index b11e531bb..0a7f4032f 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -133,7 +133,7 @@ Reproducir vídeos automticamente - Remember last video playback position + Remember last video playback position Mudar a visibilidade do ficheiro videos en bucle Animar os GIFs na icona diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index f0e73dd54..5ac572a6e 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -133,7 +133,7 @@ Automatsko pokretanje videa - Remember last video playback position + Remember last video playback position Uključi prikaz naziva datoteka Ponavljanje videa Prikaz animacije GIF-ova na sličicama diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 9cccd5d2f..d6d5c1f4f 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -133,7 +133,7 @@ Play videos automatically - Remember last video playback position + Remember last video playback position Toggle filename visibility Loop videos Animate GIFs at thumbnails diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index dbf796ed5..21b24254c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -133,7 +133,7 @@ Riproduci i video automaticamente - Remember last video playback position + Remember last video playback position Visibilità nome del file Ripeti i video Anima le GIF in miniatura diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 63f2adf24..96707db26 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -133,7 +133,7 @@ ビデオを自動再生 - Remember last video playback position + Remember last video playback position ファイル名の表示を切り替え ビデオを繰り返し再生 アニメーションGIFを動かす diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index dcb77ea3c..9a69c6c48 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -133,7 +133,7 @@ 비디오 자동재생 - Remember last video playback position + Remember last video playback position 파일이름 보기 비디오 반복 섬네일에서 GIFs 애니메이션 활성화 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 152d534e9..37d2ff2e7 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -133,7 +133,7 @@ Groti vaizdo įrašus automatiškai - Remember last video playback position + Remember last video playback position Perjungti bylos pavadinimo matomumą Klipuoti vaizdo įrašus Animuoti GIF\'us miniatiūrose diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index b20d3af59..fb0887b88 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -133,7 +133,7 @@ Avspill videoer automatisk - Remember last video playback position + Remember last video playback position Vis/skjul filnavn Gjenta videoer Animert GIF i minibildevisning diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 166bdd00f..d08be33b3 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -133,7 +133,7 @@ Video\'s automatisch afspelen - Remember last video playback position + Remember last video playback position Bestandsnamen tonen Video\'s herhalen GIF-bestanden afspelen in overzicht diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e3a9098ce..39b32cbf5 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -133,7 +133,7 @@ Odtwarzaj filmy automatycznie - Remember last video playback position + Remember last video playback position Pokazuj / ukrywaj nazwy plików Zapętlaj odtwarzanie filmów Animowane miniatury GIFów diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index fc7633fe0..dddb7b49f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -133,7 +133,7 @@ Reproduzir vídeos automaticamente - Remember last video playback position + Remember last video playback position Mostrar/ocultar nome do arquivo Reproduzir vídeos em ciclo Animação de GIFs nas miniaturas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index b33623736..6298c9547 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -133,7 +133,7 @@ Reproduzir vídeos automaticamente - Remember last video playback position + Remember last video playback position Mostrar/ocultar nome do ficheiro Vídeos em ciclo Animação de GIF nas miniaturas diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2d360ade9..616e02ea9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -133,7 +133,7 @@ Воспроизводить видео автоматически - Remember last video playback position + Remember last video playback position Переключить отображение имени файла Повтор видео Анимировать эскизы GIF diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 2e93e630d..7d057a389 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -133,7 +133,7 @@ Spúšťať videá automaticky - Remember last video playback position + Zapamätať si pozíciu posledného prehraného videa Prepnúť viditeľnosť názvov súborov Automaticky reštartovať videá Animovať GIF súbory pri náhľade diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 05048a1a1..3137d4210 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -133,7 +133,7 @@ Spela upp videor automatiskt - Remember last video playback position + Remember last video playback position Visa/dölj filnamn Spela upp videor om och om igen Animera GIF-bilders miniatyrer diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index bc8cdbd39..bab52d012 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -133,7 +133,7 @@ Videoları otomatik olarak oynat - Remember last video playback position + Remember last video playback position Dosya adı görünürlüğünü değiştir Videolar döngüsü Küçük resimlerde GIF\'leri canlandırın diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index e4c77e84f..4a0eaa563 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -133,7 +133,7 @@ Відтворювати відео автоматично - Remember last video playback position + Remember last video playback position Перемкнути відображення імені файлу Зациклити відео Анімувати ескізи GIF-файлів diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2ef5c0a83..8087e0103 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -133,7 +133,7 @@ 自动播放 - Remember last video playback position + Remember last video playback position 显示文件名 循环播放视频 GIF 缩略图 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index c417b293c..fadb18f64 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -133,7 +133,7 @@ 自動播放影片 - Remember last video playback position + Remember last video playback position 顯示檔案名稱 影片循環播放 縮圖顯示GIF動畫 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bac1070bc..ef69c4da9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -133,7 +133,7 @@ Play videos automatically - Remember last video playback position + Remember last video playback position Toggle filename visibility Loop videos Animate GIFs at thumbnails