properly handle exporting/importing local private contacts
This commit is contained in:
parent
0651a49cd1
commit
192658c0d3
|
@ -8,6 +8,7 @@ import com.simplemobiletools.contacts.activities.SimpleActivity
|
|||
import com.simplemobiletools.contacts.adapters.FilterContactSourcesAdapter
|
||||
import com.simplemobiletools.contacts.extensions.config
|
||||
import com.simplemobiletools.contacts.helpers.ContactsHelper
|
||||
import com.simplemobiletools.contacts.helpers.SMT_PRIVATE
|
||||
import com.simplemobiletools.contacts.models.ContactSource
|
||||
import kotlinx.android.synthetic.main.dialog_export_contacts.view.*
|
||||
import java.io.File
|
||||
|
@ -48,7 +49,7 @@ class ExportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
|||
val selectedIndexes = (view.export_contacts_list.adapter as FilterContactSourcesAdapter).getSelectedItemsSet()
|
||||
val selectedContactSources = HashSet<String>()
|
||||
selectedIndexes.forEach {
|
||||
selectedContactSources.add(contactSources[it].name)
|
||||
selectedContactSources.add(if (contactSources[it].type == SMT_PRIVATE) SMT_PRIVATE else contactSources[it].name)
|
||||
}
|
||||
callback(file, selectedContactSources)
|
||||
dismiss()
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.simplemobiletools.contacts.activities.SimpleActivity
|
|||
import com.simplemobiletools.contacts.extensions.config
|
||||
import com.simplemobiletools.contacts.extensions.getPublicContactSource
|
||||
import com.simplemobiletools.contacts.extensions.showContactSourcePicker
|
||||
import com.simplemobiletools.contacts.helpers.SMT_PRIVATE
|
||||
import com.simplemobiletools.contacts.helpers.VcfImporter
|
||||
import com.simplemobiletools.contacts.helpers.VcfImporter.ImportResult.IMPORT_FAIL
|
||||
import kotlinx.android.synthetic.main.dialog_import_contacts.view.*
|
||||
|
@ -22,7 +23,7 @@ class ImportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
|||
import_contacts_title.text = activity.getPublicContactSource(targetContactSource)
|
||||
import_contacts_title.setOnClickListener {
|
||||
activity.showContactSourcePicker(targetContactSource) {
|
||||
targetContactSource = it
|
||||
targetContactSource = if (it == activity.getString(R.string.phone_storage_hidden)) SMT_PRIVATE else it
|
||||
import_contacts_title.text = activity.getPublicContactSource(it)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue