mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
check thumbnail scrolling on resume
This commit is contained in:
parent
6dd4be62d8
commit
1402de7a3d
2 changed files with 18 additions and 0 deletions
|
@ -50,6 +50,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
private var mIsGettingDirs = false
|
||||
private var mStoredAnimateGifs = true
|
||||
private var mStoredCropThumbnails = true
|
||||
private var mStoredScrollHorizontally = true
|
||||
private var mLoadedInitialPhotos = false
|
||||
private var mLastMediaModified = 0
|
||||
private var mLastMediaHandler = Handler()
|
||||
|
@ -73,6 +74,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
mDirs = ArrayList<Directory>()
|
||||
mStoredAnimateGifs = config.animateGifs
|
||||
mStoredCropThumbnails = config.cropThumbnails
|
||||
mStoredScrollHorizontally = config.scrollHorizontally
|
||||
storeStoragePaths()
|
||||
checkWhatsNewDialog()
|
||||
}
|
||||
|
@ -113,6 +115,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
if (mStoredCropThumbnails != config.cropThumbnails) {
|
||||
directories_grid.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
||||
(directories_grid.adapter as DirectoryAdapter).scrollVertically = !config.scrollHorizontally
|
||||
directories_grid.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
tryloadGallery()
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
|
@ -125,6 +133,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
mIsGettingDirs = false
|
||||
mStoredAnimateGifs = config.animateGifs
|
||||
mStoredCropThumbnails = config.cropThumbnails
|
||||
mStoredScrollHorizontally = config.scrollHorizontally
|
||||
MyScalableRecyclerView.mListener = null
|
||||
mLastMediaHandler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
private var mLoadedInitialPhotos = false
|
||||
private var mStoredAnimateGifs = true
|
||||
private var mStoredCropThumbnails = true
|
||||
private var mStoredScrollHorizontally = true
|
||||
private var mLastDrawnHashCode = 0
|
||||
private var mLastMediaModified = 0
|
||||
private var mLastMediaHandler = Handler()
|
||||
|
@ -69,6 +70,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
mPath = intent.getStringExtra(DIRECTORY)
|
||||
mStoredAnimateGifs = config.animateGifs
|
||||
mStoredCropThumbnails = config.cropThumbnails
|
||||
mStoredScrollHorizontally = config.scrollHorizontally
|
||||
mShowAll = config.showAll
|
||||
if (mShowAll)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
||||
|
@ -83,6 +85,12 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
if (mStoredCropThumbnails != config.cropThumbnails) {
|
||||
media_grid.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
||||
(media_grid.adapter as MediaAdapter).scrollVertically = !config.scrollHorizontally
|
||||
media_grid.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
tryloadGallery()
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
|
@ -93,6 +101,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
media_refresh_layout.isRefreshing = false
|
||||
mStoredAnimateGifs = config.animateGifs
|
||||
mStoredCropThumbnails = config.cropThumbnails
|
||||
mStoredScrollHorizontally = config.scrollHorizontally
|
||||
MyScalableRecyclerView.mListener = null
|
||||
mLastMediaHandler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue