removing the Show Dialpad Letters settings item

This commit is contained in:
tibbi 2020-05-23 20:28:11 +02:00
parent 27920116ce
commit dda49b2967
6 changed files with 1 additions and 45 deletions

View file

@ -77,11 +77,6 @@ class DialpadActivity : SimpleActivity() {
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_vector, if (isBlackAndWhiteTheme()) Color.BLACK else config.primaryColor.getContrastColor())
dialpad_call_button.setImageDrawable(callIcon)
dialpad_call_button.background.applyColorFilter(getAdjustedPrimaryColor())
val showLetters = config.showDialpadLetters
arrayOf(dialpad_2_letters, dialpad_3_letters, dialpad_4_letters, dialpad_5_letters, dialpad_6_letters, dialpad_7_letters, dialpad_8_letters, dialpad_9_letters).forEach {
it.beVisibleIf(showLetters)
}
}
override fun onResume() {
@ -171,7 +166,7 @@ class DialpadActivity : SimpleActivity() {
return
}
val showLetters = config.showDialpadLetters
val showLetters = true
(dialpad_list.adapter as? ContactsAdapter)?.finishActMode()
val filtered = contacts.filter {
val convertedName = PhoneNumberUtils.convertKeypadLettersToDigits(it.getNameToDisplay().normalizeString())

View file

@ -41,7 +41,6 @@ class SettingsActivity : SimpleActivity() {
setupStartNameWithSurname()
setupShowCallConfirmation()
setupShowDialpadButton()
setupShowDialpadLetters()
setupShowPrivateContacts()
setupOnContactClick()
updateTextColors(settings_holder)
@ -137,14 +136,6 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupShowDialpadLetters() {
settings_show_dialpad_letters.isChecked = config.showDialpadLetters
settings_show_dialpad_letters_holder.setOnClickListener {
settings_show_dialpad_letters.toggle()
config.showDialpadLetters = settings_show_dialpad_letters.isChecked
}
}
private fun setupShowPrivateContacts() {
settings_show_private_contacts.isChecked = config.showPrivateContacts
settings_show_private_contacts_holder.setOnClickListener {

View file

@ -294,11 +294,9 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
val adapter = fragment_list.adapter
if (adapter is ContactsAdapter) {
val shouldNormalize = text.normalizeString() == text
val convertLetters = config.showDialpadLetters
val filtered = contactsIgnoringSearch.filter {
getProperText(it.getNameToDisplay(), shouldNormalize).contains(text, true) ||
getProperText(it.nickname, shouldNormalize).contains(text, true) ||
it.doesContainPhoneNumber(text, convertLetters) ||
it.emails.any { it.value.contains(text, true) } ||
it.addresses.any { getProperText(it.value, shouldNormalize).contains(text, true) } ||
it.IMs.any { it.value.contains(text, true) } ||

View file

@ -57,10 +57,6 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(SHOW_DIALPAD_BUTTON, true)
set(showDialpadButton) = prefs.edit().putBoolean(SHOW_DIALPAD_BUTTON, showDialpadButton).apply()
var showDialpadLetters: Boolean
get() = prefs.getBoolean(SHOW_DIALPAD_LETTERS, true)
set(showDialpadLetters) = prefs.edit().putBoolean(SHOW_DIALPAD_LETTERS, showDialpadLetters).apply()
var wasLocalAccountInitialized: Boolean
get() = prefs.getBoolean(WAS_LOCAL_ACCOUNT_INITIALIZED, false)
set(wasLocalAccountInitialized) = prefs.edit().putBoolean(WAS_LOCAL_ACCOUNT_INITIALIZED, wasLocalAccountInitialized).apply()

View file

@ -19,7 +19,6 @@ const val SHOW_CONTACT_FIELDS = "show_contact_fields"
const val SHOW_TABS = "show_tabs"
const val SHOW_CALL_CONFIRMATION = "show_call_confirmation"
const val SHOW_DIALPAD_BUTTON = "show_dialpad_button"
const val SHOW_DIALPAD_LETTERS = "show_dialpad_letters"
const val SPEED_DIAL = "speed_dial"
const val LAST_EXPORT_PATH = "last_export_path"
const val WAS_LOCAL_ACCOUNT_INITIALIZED = "was_local_account_initialized"

View file

@ -267,29 +267,6 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_dialpad_letters_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_show_dialpad_letters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:text="@string/show_dialpad_letters"
app:switchPadding="@dimen/medium_margin" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_private_contacts_holder"
android:layout_width="match_parent"