always try filtering out duplicate contacts, remove the setting

This commit is contained in:
tibbi 2019-09-14 21:50:56 +02:00
parent 523dfc039b
commit 28ae1eabd3
6 changed files with 1 additions and 45 deletions

View File

@ -58,7 +58,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private var storedShowContactThumbnails = false
private var storedShowPhoneNumbers = false
private var storedStartNameWithSurname = false
private var storedFilterDuplicates = true
private var storedShowTabs = 0
override fun onCreate(savedInstanceState: Bundle?) {
@ -137,10 +136,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
favorites_fragment?.startNameWithSurnameChanged(configStartNameWithSurname)
}
if (storedFilterDuplicates != config.filterDuplicates) {
refreshContacts(ALL_TABS_MASK)
}
if (werePermissionsHandled && !isFirstResume) {
if (viewpager.adapter == null) {
initFragments()
@ -213,7 +208,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
storedShowContactThumbnails = showContactThumbnails
storedShowPhoneNumbers = showPhoneNumbers
storedStartNameWithSurname = startNameWithSurname
storedFilterDuplicates = filterDuplicates
storedShowTabs = showTabs
}
}

View File

@ -39,7 +39,6 @@ class SettingsActivity : SimpleActivity() {
setupShowPhoneNumbers()
setupShowContactsWithNumbers()
setupStartNameWithSurname()
setupFilterDuplicates()
setupShowCallConfirmation()
setupShowDialpadButton()
setupShowDialpadLetters()
@ -130,14 +129,6 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupFilterDuplicates() {
settings_filter_duplicates.isChecked = config.filterDuplicates
settings_filter_duplicates_holder.setOnClickListener {
settings_filter_duplicates.toggle()
config.filterDuplicates = settings_filter_duplicates.isChecked
}
}
private fun setupShowDialpadButton() {
settings_show_dialpad_button.isChecked = config.showDialpadButton
settings_show_dialpad_button_holder.setOnClickListener {

View File

@ -41,10 +41,6 @@ class Config(context: Context) : BaseConfig(context) {
SHOW_ADDRESSES_FIELD or SHOW_EVENTS_FIELD or SHOW_NOTES_FIELD or SHOW_GROUPS_FIELD or SHOW_CONTACT_SOURCE_FIELD)
set(showContactFields) = prefs.edit().putInt(SHOW_CONTACT_FIELDS, showContactFields).apply()
var filterDuplicates: Boolean
get() = prefs.getBoolean(FILTER_DUPLICATES, true)
set(filterDuplicates) = prefs.edit().putBoolean(FILTER_DUPLICATES, filterDuplicates).apply()
var showTabs: Int
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)
set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply()

View File

@ -13,7 +13,6 @@ const val LAST_USED_CONTACT_SOURCE = "last_used_contact_source"
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 SHOW_DIALPAD_BUTTON = "show_dialpad_button"
const val SHOW_DIALPAD_LETTERS = "show_dialpad_letters"

View File

@ -66,7 +66,7 @@ class ContactsHelper(val context: Context) {
contacts.valueAt(it)
}
if (ignoredContactSources.isEmpty() && context.config.filterDuplicates && !getAll) {
if (ignoredContactSources.isEmpty() && !getAll) {
tempContacts = tempContacts.distinctBy {
it.getHashToCompare()
} as ArrayList<Contact>

View File

@ -244,30 +244,6 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_filter_duplicates_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_filter_duplicates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
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"