mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-04 09:47:58 +01:00
allow hiding the path at the exporting destination dialog
This commit is contained in:
parent
39b432bf4b
commit
fbfe7133ca
@ -520,7 +520,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
}
|
||||
|
||||
private fun exportContacts() {
|
||||
ExportContactsDialog(this, config.lastExportPath) { file, ignoredContactSources ->
|
||||
ExportContactsDialog(this, config.lastExportPath, false) { file, ignoredContactSources ->
|
||||
config.lastExportPath = file.absolutePath.getParentPath()
|
||||
ContactsHelper(this).getContacts(true, ignoredContactSources) { contacts ->
|
||||
if (contacts.isEmpty()) {
|
||||
|
@ -15,7 +15,8 @@ import kotlinx.android.synthetic.main.dialog_export_contacts.view.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class ExportContactsDialog(val activity: SimpleActivity, val path: String, private val callback: (file: File, ignoredContactSources: HashSet<String>) -> Unit) {
|
||||
class ExportContactsDialog(val activity: SimpleActivity, val path: String, val hidePath: Boolean,
|
||||
private val callback: (file: File, ignoredContactSources: HashSet<String>) -> Unit) {
|
||||
private var contactSources = ArrayList<ContactSource>()
|
||||
private var ignoreClicks = false
|
||||
private var realPath = if (path.isEmpty()) activity.internalStoragePath else path
|
||||
@ -25,6 +26,10 @@ class ExportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
||||
export_contacts_folder.text = activity.humanizePath(realPath)
|
||||
export_contacts_filename.setText("contacts_${activity.getCurrentFormattedDateTime()}")
|
||||
|
||||
if (hidePath) {
|
||||
export_contacts_folder_label.beGone()
|
||||
export_contacts_folder.beGone()
|
||||
} else {
|
||||
export_contacts_folder.setOnClickListener {
|
||||
activity.hideKeyboard(export_contacts_filename)
|
||||
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
||||
@ -32,6 +37,7 @@ class ExportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
||||
realPath = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContactsHelper(activity).getContactSources {
|
||||
it.mapTo(contactSources) { it.copy() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user