]> git.ktnx.net Git - mobile-ledger.git/commitdiff
account name auto-complete: convert input to upper case
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 21 Feb 2021 10:13:18 +0000 (12:13 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 1 Mar 2021 06:00:42 +0000 (06:00 +0000)
the database uses case_sensitive_like pragma for other reasons, so
thi lookup query needs to be adapted. this wasn't a problem before
the adoption of Room for database structure migration with all the
connection-level pragmas, used by the account storage part

app/src/main/java/net/ktnx/mobileledger/db/AccountAutocompleteAdapter.java

index 6f18225d7bd7e054be463aae98c7d90823b333c0..ecc21db74e69e624c28d56f02a53bc696a451262 100644 (file)
@@ -24,6 +24,7 @@ import android.widget.Filter;
 import androidx.annotation.NonNull;
 
 import net.ktnx.mobileledger.dao.AccountDAO;
+import net.ktnx.mobileledger.utils.Logger;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -66,10 +67,13 @@ public class AccountAutocompleteAdapter extends ArrayAdapter<String> {
                 return results;
             }
 
+            Logger.debug("acc", String.format("Looking for account '%s'", constraint));
             final List<String> matches = AccountDAO.unbox(
-                    (profileUUID == null) ? dao.lookupByNameSync(String.valueOf(constraint))
+                    (profileUUID == null) ? dao.lookupByNameSync(String.valueOf(constraint)
+                                                                       .toUpperCase())
                                           : dao.lookupInProfileByNameSync(profileUUID,
-                                                  String.valueOf(constraint)));
+                                                  String.valueOf(constraint)
+                                                        .toUpperCase()));
             results.values = matches;
             results.count = matches.size();