mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
make adapters nullable at resume too
This commit is contained in:
parent
f14d34a3e4
commit
19a2aa71bf
2 changed files with 12 additions and 8 deletions
|
@ -109,16 +109,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
if (mStoredAnimateGifs != config.animateGifs) {
|
if (mStoredAnimateGifs != config.animateGifs) {
|
||||||
directories_grid.adapter.notifyDataSetChanged()
|
directories_grid.adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredCropThumbnails != config.cropThumbnails) {
|
if (mStoredCropThumbnails != config.cropThumbnails) {
|
||||||
directories_grid.adapter.notifyDataSetChanged()
|
directories_grid.adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
||||||
(directories_grid.adapter as DirectoryAdapter).scrollVertically = !config.scrollHorizontally
|
directories_grid.adapter?.let {
|
||||||
directories_grid.adapter.notifyDataSetChanged()
|
(it as DirectoryAdapter).scrollVertically = !config.scrollHorizontally
|
||||||
|
it.notifyDataSetChanged()
|
||||||
|
}
|
||||||
setupScrollDirection()
|
setupScrollDirection()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,16 +79,18 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
if (mShowAll && mStoredAnimateGifs != config.animateGifs) {
|
if (mShowAll && mStoredAnimateGifs != config.animateGifs) {
|
||||||
media_grid.adapter.notifyDataSetChanged()
|
media_grid.adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredCropThumbnails != config.cropThumbnails) {
|
if (mStoredCropThumbnails != config.cropThumbnails) {
|
||||||
media_grid.adapter.notifyDataSetChanged()
|
media_grid.adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
||||||
(media_grid.adapter as MediaAdapter).scrollVertically = !config.scrollHorizontally
|
media_grid.adapter?.let {
|
||||||
media_grid.adapter.notifyDataSetChanged()
|
(it as MediaAdapter).scrollVertically = !config.scrollHorizontally
|
||||||
|
it.notifyDataSetChanged()
|
||||||
|
}
|
||||||
setupScrollDirection()
|
setupScrollDirection()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue