From 7e31a3eff061f26e5fc783c01bc9385bc4991bfc Mon Sep 17 00:00:00 2001 From: Isabelle Date: Fri, 19 Oct 2018 16:50:34 -0300 Subject: [PATCH] Ignore case to sort note list When SQLite compares two strings, it uses a collating sequence to determine which string is greater. The NOCASE collating functions is the same as BYNARY (default), except the 26 upper case characters of ASCII are folded to their lower case equivalents. Issue #542 --- .../src/main/java/it/feio/android/omninotes/db/DbHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/db/DbHelper.java b/omniNotes/src/main/java/it/feio/android/omninotes/db/DbHelper.java index 186a0fe974..54e053157f 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/db/DbHelper.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/db/DbHelper.java @@ -412,7 +412,7 @@ public List getNotes(String whereCondition, boolean order) { + " FROM " + TABLE_NOTES + " LEFT JOIN " + TABLE_CATEGORY + " USING( " + KEY_CATEGORY + ") " + whereCondition - + (order ? " ORDER BY " + sort_column + sort_order : ""); + + (order ? " ORDER BY " + sort_column + " COLLATE NOCASE " + sort_order : ""); Log.v(Constants.TAG, "Query: " + query);