properly refresh Contacts and Favorites fragments at delete via Search

This commit is contained in:
tibbi 2018-08-11 21:30:15 +02:00
parent 67d0b02280
commit 32dd6aac80
2 changed files with 5 additions and 1 deletions

View File

@ -160,7 +160,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
finishActMode() finishActMode()
} else { } else {
removeSelectedItems() removeSelectedItems()
refreshListener?.refreshContacts(FAVORITES_TAB_MASK) refreshListener?.refreshContacts(CONTACTS_TAB_MASK or FAVORITES_TAB_MASK)
} }
} }

View File

@ -138,6 +138,10 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
} else if (this !is RecentsFragment) { } else if (this !is RecentsFragment) {
setupContactsFavoritesAdapter(contacts) setupContactsFavoritesAdapter(contacts)
} }
if (this is ContactsFragment || this is FavoritesFragment) {
contactsIgnoringSearch = (fragment_list?.adapter as? ContactsAdapter)?.contactItems ?: ArrayList()
}
} }
private fun setupGroupsAdapter(contacts: ArrayList<Contact>) { private fun setupGroupsAdapter(contacts: ArrayList<Contact>) {