mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
adding a settings toggle for call confirmation dialog
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/settings_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@ -118,7 +119,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/use_english_language"/>
|
||||
android:text="@string/use_english_language"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -141,7 +143,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/avoid_whats_new"/>
|
||||
android:text="@string/avoid_whats_new"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -164,7 +167,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_info_bubble"/>
|
||||
android:text="@string/show_info_bubble"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -187,7 +191,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_contact_thumbnails"/>
|
||||
android:text="@string/show_contact_thumbnails"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -210,7 +215,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_phone_numbers"/>
|
||||
android:text="@string/show_phone_numbers"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -233,7 +239,8 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/start_name_with_surname"/>
|
||||
android:text="@string/start_name_with_surname"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -256,7 +263,32 @@
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/filter_duplicates"/>
|
||||
android:text="@string/filter_duplicates"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_show_call_confirmation_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingLeft="@dimen/normal_margin"
|
||||
android:paddingRight="@dimen/normal_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/settings_show_call_confirmation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_call_confirmation_dialog"
|
||||
app:switchPadding="@dimen/medium_margin"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
Reference in New Issue
Block a user