remember scroll position when going from media to fullscreen mode

This commit is contained in:
tibbi 2017-01-15 11:51:18 +01:00
parent c6c945eb36
commit 40ec71c5c2

View file

@ -41,6 +41,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mIsGetAnyIntent = false private var mIsGetAnyIntent = false
private var mIsGettingMedia = false private var mIsGettingMedia = false
private var mShowAll = false private var mShowAll = false
private var mLoadedInitialPhotos = false
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -172,8 +173,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
if (media.size == 0) { if (media.size == 0) {
media_holder.isRefreshing = true media_holder.isRefreshing = true
} else { } else {
gotMedia(media) if (!mLoadedInitialPhotos)
gotMedia(media)
} }
mLoadedInitialPhotos = true
GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) { GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) {
gotMedia(it) gotMedia(it)