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() {
|
private fun exportContacts() {
|
||||||
ExportContactsDialog(this, config.lastExportPath) { file, ignoredContactSources ->
|
ExportContactsDialog(this, config.lastExportPath, false) { file, ignoredContactSources ->
|
||||||
config.lastExportPath = file.absolutePath.getParentPath()
|
config.lastExportPath = file.absolutePath.getParentPath()
|
||||||
ContactsHelper(this).getContacts(true, ignoredContactSources) { contacts ->
|
ContactsHelper(this).getContacts(true, ignoredContactSources) { contacts ->
|
||||||
if (contacts.isEmpty()) {
|
if (contacts.isEmpty()) {
|
||||||
|
@ -15,7 +15,8 @@ import kotlinx.android.synthetic.main.dialog_export_contacts.view.*
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
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 contactSources = ArrayList<ContactSource>()
|
||||||
private var ignoreClicks = false
|
private var ignoreClicks = false
|
||||||
private var realPath = if (path.isEmpty()) activity.internalStoragePath else path
|
private var realPath = if (path.isEmpty()) activity.internalStoragePath else path
|
||||||
@ -25,11 +26,16 @@ class ExportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
|||||||
export_contacts_folder.text = activity.humanizePath(realPath)
|
export_contacts_folder.text = activity.humanizePath(realPath)
|
||||||
export_contacts_filename.setText("contacts_${activity.getCurrentFormattedDateTime()}")
|
export_contacts_filename.setText("contacts_${activity.getCurrentFormattedDateTime()}")
|
||||||
|
|
||||||
export_contacts_folder.setOnClickListener {
|
if (hidePath) {
|
||||||
activity.hideKeyboard(export_contacts_filename)
|
export_contacts_folder_label.beGone()
|
||||||
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
export_contacts_folder.beGone()
|
||||||
export_contacts_folder.text = activity.humanizePath(it)
|
} else {
|
||||||
realPath = it
|
export_contacts_folder.setOnClickListener {
|
||||||
|
activity.hideKeyboard(export_contacts_filename)
|
||||||
|
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
||||||
|
export_contacts_folder.text = activity.humanizePath(it)
|
||||||
|
realPath = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user