From: Damyan Ivanov Date: Sun, 21 Feb 2021 10:13:18 +0000 (+0200) Subject: account name auto-complete: convert input to upper case X-Git-Tag: v0.17.0~71 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=d0c7376f092d1778ec8bab43cd2017eab723d521;p=mobile-ledger.git 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 --- 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();