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>) { fun gotDirectories(dirs: ArrayList<Directory>) {
directories_holder.isRefreshing = false directories_holder.isRefreshing = false
mIsGettingDirs = false mIsGettingDirs = false
if (dirs == mDirs) {
if (dirs.hashCode() == mDirs.hashCode())
return return
}
mDirs = dirs mDirs = dirs
setupAdapter() setupAdapter()

View file

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