New alphabetical chapter sort (#10073)

* added alphabetical chapter sorting

* Deleted sort_by_alphabet and re-utilized action_sort_alpha

* Accidentally deleted wrong string. Now solved

* Accidentally deleted wrong string. Now solved

Deleted sort_by_source instead of sort_by_alphabet in strings.xml.
Now reverted.

* Alphabetical sorting now uses Collator

* Clean up repeated Collator instances

---------

Co-authored-by: arkon <eugcheung94@gmail.com>
This commit is contained in:
Ota
2023-11-05 04:47:32 +09:00
committed by GitHub
parent 5d91b77c93
commit f30ab56fd0
6 changed files with 26 additions and 14 deletions

View File

@ -0,0 +1,15 @@
package tachiyomi.core.util.lang
import java.text.Collator
import java.util.Locale
private val collator by lazy {
val locale = Locale.getDefault()
Collator.getInstance(locale).apply {
strength = Collator.PRIMARY
}
}
fun String.compareToWithCollator(other: String): Int {
return collator.compare(this, other)
}