sort contacts only after filtering

This commit is contained in:
tibbi 2018-01-02 15:42:07 +01:00
parent 4000641022
commit b57884ab8e
1 changed files with 3 additions and 3 deletions

View File

@ -88,9 +88,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
config.lastUsedContactSource = grouped?.key ?: ""
}
Contact.sorting = config.sorting
contacts.sort()
contacts = if (this is FavoritesFragment) {
val favorites = config.favorites
contacts.filter { favorites.contains(it.id.toString()) } as ArrayList<Contact>
@ -103,6 +100,9 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
}
}
Contact.sorting = config.sorting
contacts.sort()
if (contacts.hashCode() != lastHashCode) {
lastHashCode = contacts.hashCode()
activity!!.runOnUiThread {