mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-01-27 14:09:57 +01:00
fix #377, properly export all fields to .vcf files
This commit is contained in:
parent
687f9a0086
commit
99b04843e5
@ -527,13 +527,12 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
viewpager.currentItem = config.lastUsedViewPagerPage
|
||||
}
|
||||
|
||||
ContactsHelper(this).getContacts {
|
||||
ContactsHelper(this).getContacts { contacts ->
|
||||
isGettingContacts = false
|
||||
if (isDestroyed) {
|
||||
return@getContacts
|
||||
}
|
||||
|
||||
val contacts = it
|
||||
if (refreshTabsMask and CONTACTS_TAB_MASK != 0) {
|
||||
contacts_fragment?.refreshContacts(contacts)
|
||||
}
|
||||
|
@ -28,11 +28,11 @@ class ContactsHelper(val context: Context) {
|
||||
private val BATCH_SIZE = 100
|
||||
private var displayContactSources = ArrayList<String>()
|
||||
|
||||
fun getContacts(ignoredContactSources: HashSet<String>? = null, callback: (ArrayList<Contact>) -> Unit) {
|
||||
fun getContacts(ignoredContactSources: HashSet<String> = HashSet(), callback: (ArrayList<Contact>) -> Unit) {
|
||||
Thread {
|
||||
val contacts = SparseArray<Contact>()
|
||||
displayContactSources = context.getVisibleContactSources()
|
||||
if (ignoredContactSources != null) {
|
||||
if (ignoredContactSources.isNotEmpty()) {
|
||||
displayContactSources = context.getAllContactSources().filter {
|
||||
!ignoredContactSources.contains(it.getFullIdentifier())
|
||||
}.map { it.getFullIdentifier() }.toMutableList() as ArrayList
|
||||
@ -52,7 +52,7 @@ class ContactsHelper(val context: Context) {
|
||||
val resultContacts = ArrayList<Contact>(contactsSize)
|
||||
|
||||
(0 until contactsSize).filter {
|
||||
if (ignoredContactSources == null && showOnlyContactsWithNumbers) {
|
||||
if (ignoredContactSources.isEmpty() && showOnlyContactsWithNumbers) {
|
||||
contacts.valueAt(it).phoneNumbers.isNotEmpty()
|
||||
} else {
|
||||
true
|
||||
@ -61,7 +61,7 @@ class ContactsHelper(val context: Context) {
|
||||
contacts.valueAt(it)
|
||||
}
|
||||
|
||||
if (ignoredContactSources == null && context.config.filterDuplicates) {
|
||||
if (ignoredContactSources.isEmpty() && context.config.filterDuplicates) {
|
||||
tempContacts = tempContacts.distinctBy {
|
||||
it.getHashToCompare()
|
||||
} as ArrayList<Contact>
|
||||
|
Loading…
x
Reference in New Issue
Block a user