From 40ec71c5c2cebd15d5986f4b6d948880b1e305b6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 15 Jan 2017 11:51:18 +0100 Subject: [PATCH] remember scroll position when going from media to fullscreen mode --- .../simplemobiletools/gallery/activities/MediaActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 1af5cfc4f..0fb0dfcba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -41,6 +41,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private var mIsGetAnyIntent = false private var mIsGettingMedia = false private var mShowAll = false + private var mLoadedInitialPhotos = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -172,8 +173,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (media.size == 0) { media_holder.isRefreshing = true } else { - gotMedia(media) + if (!mLoadedInitialPhotos) + gotMedia(media) } + mLoadedInitialPhotos = true GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) { gotMedia(it)