mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
store the last used contact source
This commit is contained in:
@ -222,6 +222,7 @@ class ContactActivity : SimpleActivity() {
|
|||||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
|
||||||
supportActionBar?.title = resources.getString(R.string.new_contact)
|
supportActionBar?.title = resources.getString(R.string.new_contact)
|
||||||
contact = Contact(0, "", "", "", "", ArrayList(), ArrayList(), "")
|
contact = Contact(0, "", "", "", "", ArrayList(), ArrayList(), "")
|
||||||
|
contact_source.text = config.lastUsedContactSource
|
||||||
contact_source.setOnClickListener { showAccountSourcePicker() }
|
contact_source.setOnClickListener { showAccountSourcePicker() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +338,7 @@ class ContactActivity : SimpleActivity() {
|
|||||||
source = contact_source.value
|
source = contact_source.value
|
||||||
|
|
||||||
Thread {
|
Thread {
|
||||||
|
config.lastUsedContactSource = source
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
insertNewContact()
|
insertNewContact()
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,4 +27,8 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
var startNameWithSurname: Boolean
|
var startNameWithSurname: Boolean
|
||||||
get() = prefs.getBoolean(START_NAME_WITH_SURNAME, false)
|
get() = prefs.getBoolean(START_NAME_WITH_SURNAME, false)
|
||||||
set(startNameWithSurname) = prefs.edit().putBoolean(START_NAME_WITH_SURNAME, startNameWithSurname).apply()
|
set(startNameWithSurname) = prefs.edit().putBoolean(START_NAME_WITH_SURNAME, startNameWithSurname).apply()
|
||||||
|
|
||||||
|
var lastUsedContactSource: String
|
||||||
|
get() = prefs.getString(LAST_USED_CONTACT_SOURCE, "")
|
||||||
|
set(lastUsedContactSource) = prefs.edit().putString(LAST_USED_CONTACT_SOURCE, lastUsedContactSource).apply()
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ package com.simplemobiletools.contacts.helpers
|
|||||||
val CALL_CONTACT_ON_CLICK = "call_contact_on_click"
|
val CALL_CONTACT_ON_CLICK = "call_contact_on_click"
|
||||||
val DISPLAY_CONTACT_SOURCES = "display_contact_sources"
|
val DISPLAY_CONTACT_SOURCES = "display_contact_sources"
|
||||||
val START_NAME_WITH_SURNAME = "start_name_with_surname"
|
val START_NAME_WITH_SURNAME = "start_name_with_surname"
|
||||||
|
val LAST_USED_CONTACT_SOURCE = "last_used_contact_source"
|
||||||
|
|
||||||
val CONTACT_ID = "contact_id"
|
val CONTACT_ID = "contact_id"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user