From 19818443ffa7a32a2f3d8b22a3e35c462e80333d Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Thu, 9 Dec 2021 14:57:45 -0500 Subject: [PATCH] Sort profiles by created at descending when shown in a list. --- .../manual/NotificationProfileSelectionFragment.kt | 2 +- .../app/notifications/profiles/NotificationProfilesFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/manual/NotificationProfileSelectionFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/manual/NotificationProfileSelectionFragment.kt index a00b6ed363..bef69a3256 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/manual/NotificationProfileSelectionFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/manual/NotificationProfileSelectionFragment.kt @@ -42,7 +42,7 @@ class NotificationProfileSelectionFragment : DSLSettingsBottomSheetFragment() { return configure { - state.notificationProfiles.forEach { profile -> + state.notificationProfiles.sortedDescending().forEach { profile -> customPref( NotificationProfileSelection.Entry( isOn = profile == activeProfile, diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/profiles/NotificationProfilesFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/profiles/NotificationProfilesFragment.kt index e756b69f18..d1e2db961f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/profiles/NotificationProfilesFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/notifications/profiles/NotificationProfilesFragment.kt @@ -90,7 +90,7 @@ class NotificationProfilesFragment : DSLSettingsFragment() { ) val activeProfile: NotificationProfile? = NotificationProfiles.getActiveProfile(profiles) - for (profile: NotificationProfile in profiles) { + profiles.sortedDescending().forEach { profile -> customPref( NotificationProfilePreference.Model( title = DSLSettingsText.from(profile.name),