lets ignore photos at comparing if a contact details changed, to avoid redraws

This commit is contained in:
tibbi
2021-11-19 18:56:49 +01:00
parent 3d4708946e
commit 77e07d405e
2 changed files with 47 additions and 11 deletions

View File

@ -127,9 +127,14 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
}
}
if (filtered.hashCode() != lastHashCode || skipHashComparing) {
var currentHash = 0
filtered.forEach {
currentHash += it.getHashWithoutPrivatePhoto()
}
if (currentHash != lastHashCode || skipHashComparing) {
skipHashComparing = false
lastHashCode = filtered.hashCode()
lastHashCode = currentHash
activity?.runOnUiThread {
setupContacts(filtered)
}