sort notes properly, including accents

This commit is contained in:
tibbi
2023-08-02 15:42:54 +02:00
parent 16229704ea
commit 63e75ec2d8
2 changed files with 4 additions and 2 deletions

View File

@ -64,10 +64,12 @@ class CollatorBasedComparator: Comparator<String> {
chunk.append(c)
current++
}
return chunk.toString()
}
private fun isDigit(ch: Char) = ch in '0'..'9'
private fun coerceResult(compareToResult: Int) = compareToResult.coerceIn(-1, 1)
private fun getCollator(): Collator {

View File

@ -5,7 +5,7 @@ import com.simplemobiletools.notes.pro.models.Note
@Dao
interface NotesDao {
@Query("SELECT * FROM notes ORDER BY title COLLATE NOCASE ASC")
@Query("SELECT * FROM notes ORDER BY title COLLATE UNICODE ASC ")
fun getNotes(): List<Note>
@Query("SELECT * FROM notes WHERE id = :id")