mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
do not show contact phone numbers on the main screen by default
This commit is contained in:
@ -24,6 +24,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
|
||||
fun showAllContacts() = displayContactSources.size == 1 && displayContactSources.first() == "-1"
|
||||
|
||||
var showPhoneNumbers: Boolean
|
||||
get() = prefs.getBoolean(SHOW_PHONE_NUMBERS, false)
|
||||
set(showPhoneNumbers) = prefs.edit().putBoolean(SHOW_PHONE_NUMBERS, showPhoneNumbers).apply()
|
||||
|
||||
var startNameWithSurname: Boolean
|
||||
get() = prefs.getBoolean(START_NAME_WITH_SURNAME, false)
|
||||
set(startNameWithSurname) = prefs.edit().putBoolean(START_NAME_WITH_SURNAME, startNameWithSurname).apply()
|
||||
|
@ -2,6 +2,7 @@ package com.simplemobiletools.contacts.helpers
|
||||
|
||||
// shared prefs
|
||||
val CALL_CONTACT_ON_CLICK = "call_contact_on_click"
|
||||
val SHOW_PHONE_NUMBERS = "show_phone_numbers"
|
||||
val DISPLAY_CONTACT_SOURCES = "display_contact_sources"
|
||||
val START_NAME_WITH_SURNAME = "start_name_with_surname"
|
||||
val LAST_USED_CONTACT_SOURCE = "last_used_contact_source"
|
||||
|
@ -71,11 +71,13 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
||||
cursor?.close()
|
||||
}
|
||||
|
||||
val phoneNumbers = getPhoneNumbers()
|
||||
val size = phoneNumbers.size()
|
||||
for (i in 0 until size) {
|
||||
val key = phoneNumbers.keyAt(i)
|
||||
contacts[key]?.phoneNumbers = phoneNumbers.valueAt(i)
|
||||
if (activity.config.showPhoneNumbers) {
|
||||
val phoneNumbers = getPhoneNumbers()
|
||||
val size = phoneNumbers.size()
|
||||
for (i in 0 until size) {
|
||||
val key = phoneNumbers.keyAt(i)
|
||||
contacts[key]?.phoneNumbers = phoneNumbers.valueAt(i)
|
||||
}
|
||||
}
|
||||
|
||||
val contactsSize = contacts.size()
|
||||
|
Reference in New Issue
Block a user