fix #452, properly list all groups after opening and closing one
This commit is contained in:
parent
b6643a5c34
commit
3f4242650b
1 changed files with 6 additions and 7 deletions
|
|
@ -128,19 +128,16 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
|
||||
private fun setupContacts(contacts: ArrayList<Contact>) {
|
||||
if (this is GroupsFragment) {
|
||||
setupGroupsAdapter(contacts)
|
||||
setupGroupsAdapter(contacts) {
|
||||
groupsIgnoringSearch = (fragment_list?.adapter as? GroupsAdapter)?.groups ?: ArrayList()
|
||||
}
|
||||
} else {
|
||||
setupContactsFavoritesAdapter(contacts)
|
||||
}
|
||||
|
||||
if (this is ContactsFragment || this is FavoritesFragment) {
|
||||
contactsIgnoringSearch = (fragment_list?.adapter as? ContactsAdapter)?.contactItems ?: ArrayList()
|
||||
} else if (this is GroupsFragment) {
|
||||
groupsIgnoringSearch = (fragment_list?.adapter as? GroupsAdapter)?.groups ?: ArrayList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupGroupsAdapter(contacts: ArrayList<Contact>) {
|
||||
private fun setupGroupsAdapter(contacts: ArrayList<Contact>, callback: () -> Unit) {
|
||||
ContactsHelper(activity!!).getStoredGroups {
|
||||
var storedGroups = it
|
||||
contacts.forEach {
|
||||
|
|
@ -180,6 +177,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
updateItems(storedGroups)
|
||||
}
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue