mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Avoid creating a new Collator and apply same decomposition across codebase.
This commit is contained in:
+5
-1
@@ -49,6 +49,10 @@ class EditDefaultNotificationSettingPresenter(
|
|||||||
fun create(oneToOne: Boolean): EditDefaultNotificationSettingPresenter
|
fun create(oneToOne: Boolean): EditDefaultNotificationSettingPresenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val collator = Collator.getInstance().apply {
|
||||||
|
decomposition = Collator.CANONICAL_DECOMPOSITION
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): EditDefaultNotificationSettingState {
|
override fun present(): EditDefaultNotificationSettingState {
|
||||||
var displayMentionsOnlyDisclaimer by remember { mutableStateOf(false) }
|
var displayMentionsOnlyDisclaimer by remember { mutableStateOf(false) }
|
||||||
@@ -139,7 +143,7 @@ class EditDefaultNotificationSettingPresenter(
|
|||||||
}
|
}
|
||||||
// locale sensitive sorting
|
// locale sensitive sorting
|
||||||
.sortedWith(
|
.sortedWith(
|
||||||
compareBy(Collator.getInstance()) { roomSummary ->
|
compareBy(collator) { roomSummary ->
|
||||||
// Collator does not handle null values, so we provide a fallback
|
// Collator does not handle null values, so we provide a fallback
|
||||||
roomSummary.name ?: roomSummary.roomId.value
|
roomSummary.name ?: roomSummary.roomId.value
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user