adding a settings toggle for call confirmation dialog

This commit is contained in:
tibbi
2018-08-02 23:42:52 +02:00
parent 39b0171bc2
commit 096b3888c2
4 changed files with 53 additions and 7 deletions

View File

@ -37,6 +37,7 @@ class SettingsActivity : SimpleActivity() {
setupShowPhoneNumbers()
setupStartNameWithSurname()
setupFilterDuplicates()
setupShowCallConfirmation()
setupOnContactClick()
updateTextColors(settings_holder)
}
@ -144,4 +145,12 @@ class SettingsActivity : SimpleActivity() {
ON_CLICK_VIEW_CONTACT -> R.string.view_contact
else -> R.string.edit_contact
})
private fun setupShowCallConfirmation() {
settings_show_call_confirmation.isChecked = config.showCallConfirmation
settings_show_call_confirmation_holder.setOnClickListener {
settings_show_call_confirmation.toggle()
config.showCallConfirmation = settings_show_call_confirmation.isChecked
}
}
}

View File

@ -52,4 +52,8 @@ class Config(context: Context) : BaseConfig(context) {
var showTabs: Int
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)
set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply()
var showCallConfirmation: Boolean
get() = prefs.getBoolean(SHOW_CALL_CONFIRMATION, false)
set(showCallConfirmation) = prefs.edit().putBoolean(SHOW_CALL_CONFIRMATION, showCallConfirmation).apply()
}

View File

@ -14,6 +14,7 @@ const val ON_CONTACT_CLICK = "on_contact_click"
const val SHOW_CONTACT_FIELDS = "show_contact_fields"
const val SHOW_TABS = "show_tabs"
const val FILTER_DUPLICATES = "filter_duplicates"
const val SHOW_CALL_CONFIRMATION = "show_call_confirmation"
const val CONTACT_ID = "contact_id"
const val SMT_PRIVATE = "smt_private" // used at the contact source of local contacts hidden from other apps