mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-24 20:40:09 +01:00
sort notes properly, including accents
This commit is contained in:
parent
16229704ea
commit
63e75ec2d8
@ -64,10 +64,12 @@ class CollatorBasedComparator: Comparator<String> {
|
|||||||
chunk.append(c)
|
chunk.append(c)
|
||||||
current++
|
current++
|
||||||
}
|
}
|
||||||
|
|
||||||
return chunk.toString()
|
return chunk.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isDigit(ch: Char) = ch in '0'..'9'
|
private fun isDigit(ch: Char) = ch in '0'..'9'
|
||||||
|
|
||||||
private fun coerceResult(compareToResult: Int) = compareToResult.coerceIn(-1, 1)
|
private fun coerceResult(compareToResult: Int) = compareToResult.coerceIn(-1, 1)
|
||||||
|
|
||||||
private fun getCollator(): Collator {
|
private fun getCollator(): Collator {
|
||||||
|
@ -5,7 +5,7 @@ import com.simplemobiletools.notes.pro.models.Note
|
|||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
interface NotesDao {
|
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>
|
fun getNotes(): List<Note>
|
||||||
|
|
||||||
@Query("SELECT * FROM notes WHERE id = :id")
|
@Query("SELECT * FROM notes WHERE id = :id")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user