speed up checking if directories or images changed

This commit is contained in:
tibbi 2017-02-07 00:14:51 +01:00
parent 9a7361795f
commit 77e32c2790
2 changed files with 5 additions and 4 deletions

View file

@ -297,9 +297,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
fun gotDirectories(dirs: ArrayList<Directory>) {
directories_holder.isRefreshing = false
mIsGettingDirs = false
if (dirs == mDirs) {
if (dirs.hashCode() == mDirs.hashCode())
return
}
mDirs = dirs
setupAdapter()

View file

@ -285,9 +285,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
fun gotMedia(media: ArrayList<Medium>) {
mIsGettingMedia = false
media_holder.isRefreshing = false
if (media == mMedia) {
if (media.hashCode() == mMedia.hashCode())
return
}
mMedia = media
initializeGallery()