mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
reuse the same list of media at thumbnails and fullscreen view
This commit is contained in:
parent
d2713635d5
commit
6248f0db76
2 changed files with 9 additions and 4 deletions
|
@ -46,6 +46,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
private var mLoadedInitialPhotos = false
|
||||
private var mStoredAnimateGifs = true
|
||||
private var mStoredCropThumbnails = true
|
||||
private var mLastDrawnHashCode = 0
|
||||
private var mLastMediaModified = 0
|
||||
private var mLastMediaHandler = Handler()
|
||||
|
||||
|
@ -393,9 +394,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
media_refresh_layout.isRefreshing = false
|
||||
|
||||
checkLastMediaChanged()
|
||||
if (media.hashCode() == mMedia.hashCode())
|
||||
if (mLastDrawnHashCode == 0)
|
||||
mLastDrawnHashCode = media.hashCode()
|
||||
|
||||
if (media.hashCode() == mMedia.hashCode() && media.hashCode() == mLastDrawnHashCode)
|
||||
return
|
||||
|
||||
mLastDrawnHashCode = media.hashCode()
|
||||
mMedia = media
|
||||
setupAdapter()
|
||||
storeFolder()
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.simplemobiletools.commons.dialogs.PropertiesDialog
|
|||
import com.simplemobiletools.commons.dialogs.RenameItemDialog
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia
|
||||
import com.simplemobiletools.gallery.adapters.MyPagerAdapter
|
||||
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
|
||||
import com.simplemobiletools.gallery.dialogs.SaveAsDialog
|
||||
|
@ -42,7 +43,6 @@ import java.util.*
|
|||
|
||||
class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, ViewPagerFragment.FragmentListener {
|
||||
lateinit var mOrientationEventListener: OrientationEventListener
|
||||
private var mMedia = ArrayList<Medium>()
|
||||
private var mPath = ""
|
||||
private var mDirectory = ""
|
||||
|
||||
|
@ -98,8 +98,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
mDirectory = File(mPath).parent
|
||||
title = mPath.getFilenameFromPath()
|
||||
|
||||
if (MediaActivity.mMedia.isNotEmpty())
|
||||
gotMedia(MediaActivity.mMedia)
|
||||
if (mMedia.isNotEmpty())
|
||||
gotMedia(mMedia)
|
||||
|
||||
reloadViewPager()
|
||||
scanPath(mPath) {}
|
||||
|
|
Loading…
Reference in a new issue