delay updating media adapter a bit

This commit is contained in:
tibbi 2018-04-12 21:35:18 +02:00
parent 1a3ddab3ca
commit 2a1484f28e

View file

@ -259,10 +259,12 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
fun updateMedia(newMedia: ArrayList<Medium>) { fun updateMedia(newMedia: ArrayList<Medium>) {
if (newMedia.hashCode() != currentMediaHash) { if (newMedia.hashCode() != currentMediaHash) {
currentMediaHash = newMedia.hashCode() currentMediaHash = newMedia.hashCode()
media = newMedia.clone() as ArrayList<Medium> Handler().postDelayed({
enableInstantLoad() media = newMedia.clone() as ArrayList<Medium>
notifyDataSetChanged() enableInstantLoad()
finishActMode() notifyDataSetChanged()
finishActMode()
}, 100L)
} }
} }