properly show the public contact source on all visible places

This commit is contained in:
tibbi
2018-02-02 13:57:24 +01:00
parent 996a9ead0a
commit b72c6cb787
3 changed files with 24 additions and 12 deletions

View File

@ -54,7 +54,12 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new
val sources = it.map { it.name }
var currentSourceIndex = -1
sources.forEachIndexed { index, account ->
items.add(RadioItem(index, account))
var publicAccount = account
if (account == config.localAccountName) {
publicAccount = getString(com.simplemobiletools.contacts.R.string.phone_storage)
}
items.add(RadioItem(index, publicAccount))
if (account == currentSource) {
currentSourceIndex = index
}
@ -68,6 +73,8 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new
}
}
fun SimpleActivity.getPublicContactSource(source: String) = if (source == config.localAccountName) getString(com.simplemobiletools.contacts.R.string.phone_storage) else source
fun BaseSimpleActivity.shareContacts(contacts: ArrayList<Contact>) {
val file = getTempFile()
if (file == null) {