From 45c0edc177d8b79a2abe84ceaad8d40bf13ffa4e Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Mar 2018 21:39:10 +0100 Subject: [PATCH] get a list of contacts belonging to the clicked group --- .../contacts/fragments/GroupsFragment.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt index 2f50bb54..746bebad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt @@ -38,8 +38,10 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator } override fun primaryColorChanged(color: Int) { - groups_fastscroller.updatePrimaryColor() - groups_fastscroller.updateBubblePrimaryColor() + groups_fastscroller.apply { + updatePrimaryColor() + updateBubblePrimaryColor() + } } override fun refreshContacts(contacts: ArrayList) { @@ -61,7 +63,8 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator val currAdapter = groups_list.adapter if (currAdapter == null) { GroupsAdapter(activity as SimpleActivity, storedGroups, groups_list, groups_fastscroller) { - + val group = it as Group + val groupContacts = contacts.filter { it.groups.map { it.id }.contains(group.id) } }.apply { setupDragListener(true) addVerticalDividers(true)