File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
app/src/main/kotlin/com/simplemobiletools/notes/pro Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import java.text.Collator
77 *
88 * Adapted from AlphanumericComparator to support numerical collation.
99 */
10- class CollatorBasedComparator : Comparator <String > {
10+ class CollatorBasedComparator : Comparator <String > {
1111 override fun compare (string1 : String , string2 : String ): Int {
1212 val collator = getCollator()
1313
@@ -64,10 +64,12 @@ class CollatorBasedComparator: Comparator<String> {
6464 chunk.append(c)
6565 current++
6666 }
67+
6768 return chunk.toString()
6869 }
6970
7071 private fun isDigit (ch : Char ) = ch in ' 0' .. ' 9'
72+
7173 private fun coerceResult (compareToResult : Int ) = compareToResult.coerceIn(- 1 , 1 )
7274
7375 private fun getCollator (): Collator {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.simplemobiletools.notes.pro.models.Note
55
66@Dao
77interface NotesDao {
8- @Query(" SELECT * FROM notes ORDER BY title COLLATE NOCASE ASC" )
8+ @Query(" SELECT * FROM notes ORDER BY title COLLATE UNICODE ASC " )
99 fun getNotes (): List <Note >
1010
1111 @Query(" SELECT * FROM notes WHERE id = :id" )
You can’t perform that action at this time.
0 commit comments