From 62bf7935520157ef58bc940b05b9cc63ff9bb192 Mon Sep 17 00:00:00 2001 From: xhon-pelushi Date: Thu, 13 Aug 2026 00:58:58 -0400 Subject: [PATCH] Fix: toggling "Start name with surname" no longer changes sort order The display-order setting was forcing config.sorting to match, silently overriding the user's chosen sort criteria. Update the adapter's display flag and redraw instead, keeping display order and sort order independent. Fixes #583 --- .../org/fossify/contacts/fragments/MyViewPagerFragment.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/org/fossify/contacts/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/org/fossify/contacts/fragments/MyViewPagerFragment.kt index bef154ebc..767107125 100644 --- a/app/src/main/kotlin/org/fossify/contacts/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/org/fossify/contacts/fragments/MyViewPagerFragment.kt @@ -21,7 +21,6 @@ import org.fossify.commons.views.MyTextView import org.fossify.contacts.R import org.fossify.contacts.activities.GroupContactsActivity import org.fossify.contacts.activities.InsertOrEditContactActivity -import org.fossify.contacts.activities.MainActivity import org.fossify.contacts.activities.SimpleActivity import org.fossify.contacts.adapters.ContactsAdapter import org.fossify.contacts.adapters.GroupsAdapter @@ -106,8 +105,8 @@ abstract class MyViewPagerFragment(c fun startNameWithSurnameChanged(startNameWithSurname: Boolean) { if (this !is GroupsFragment) { (innerBinding.fragmentList.adapter as? ContactsAdapter)?.apply { - config.sorting = if (startNameWithSurname) SORT_BY_SURNAME else SORT_BY_FIRST_NAME - (this@MyViewPagerFragment.activity!! as MainActivity).refreshContacts(TAB_CONTACTS or TAB_FAVORITES) + this.startNameWithSurname = startNameWithSurname + notifyDataSetChanged() } } }