Add an option to show/hide contact thumbnails

This commit is contained in:
Nikola Trubitsyn
2018-01-27 23:58:49 +03:00
parent 4ffcfcd2f4
commit 0a86ce2856
6 changed files with 55 additions and 8 deletions

View File

@ -24,6 +24,10 @@ class Config(context: Context) : BaseConfig(context) {
fun showAllContacts() = displayContactSources.size == 1 && displayContactSources.first() == "-1"
var showContactThumbnails : Boolean
get() = prefs.getBoolean(SHOW_CONTACT_THUMBNAILS, true)
set(showContactThumbnails) = prefs.edit().putBoolean(SHOW_CONTACT_THUMBNAILS, showContactThumbnails).apply()
var showPhoneNumbers: Boolean
get() = prefs.getBoolean(SHOW_PHONE_NUMBERS, false)
set(showPhoneNumbers) = prefs.edit().putBoolean(SHOW_PHONE_NUMBERS, showPhoneNumbers).apply()

View File

@ -4,6 +4,7 @@ import android.provider.ContactsContract.CommonDataKinds
// shared prefs
val CALL_CONTACT_ON_CLICK = "call_contact_on_click"
val SHOW_CONTACT_THUMBNAILS = "show_contact_thumbnails"
val SHOW_PHONE_NUMBERS = "show_phone_numbers"
val DISPLAY_CONTACT_SOURCES = "display_contact_sources"
val START_NAME_WITH_SURNAME = "start_name_with_surname"