mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-14 18:40:46 +01:00
do not spend time fetching data for hidden fragments
This commit is contained in:
parent
d8a26a87a6
commit
7b577aa082
@ -86,6 +86,12 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun refreshContacts(contacts: ArrayList<Contact>) {
|
fun refreshContacts(contacts: ArrayList<Contact>) {
|
||||||
|
if ((config.showTabs and CONTACTS_TAB_MASK == 0 && this is ContactsFragment) ||
|
||||||
|
(config.showTabs and FAVORITES_TAB_MASK == 0 && this is FavoritesFragment) ||
|
||||||
|
(config.showTabs and GROUPS_TAB_MASK == 0 && this is GroupsFragment)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (config.lastUsedContactSource.isEmpty()) {
|
if (config.lastUsedContactSource.isEmpty()) {
|
||||||
val grouped = contacts.groupBy { it.source }.maxWith(compareBy { it.value.size })
|
val grouped = contacts.groupBy { it.source }.maxWith(compareBy { it.value.size })
|
||||||
config.lastUsedContactSource = grouped?.key ?: ""
|
config.lastUsedContactSource = grouped?.key ?: ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user