From d0c7376f092d1778ec8bab43cd2017eab723d521 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 21 Feb 2021 12:13:18 +0200 Subject: [PATCH] account name auto-complete: convert input to upper case 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 --- .../ktnx/mobileledger/db/AccountAutocompleteAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/db/AccountAutocompleteAdapter.java b/app/src/main/java/net/ktnx/mobileledger/db/AccountAutocompleteAdapter.java index 6f18225d..ecc21db7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/AccountAutocompleteAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/AccountAutocompleteAdapter.java @@ -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 { return results; } + Logger.debug("acc", String.format("Looking for account '%s'", constraint)); final List 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(); -- 2.39.5