X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fnew_transaction%2FNewTransactionModel.java;h=23a4ef73cafcd6eddefcfa9ff59b1e832e5187ec;hp=ba2903c1d3bf3d6ea363f64b411bd1116d89e29b;hb=94dd025cb41a089504314a48ba2f99d4c5d911c5;hpb=ad1487422eb36c06d1910a382de6dac90d9d30f4 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index ba2903c1..23a4ef73 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -688,7 +688,7 @@ public class NewTransactionModel extends ViewModel { if (item == receiver) { final String hint = String.format("%1.2f", -currencyBalance); if (!acc.isAmountHintSet() || - !TextUtils.equals(acc.getAmountHint(), hint)) + !Misc.equalStrings(acc.getAmountHint(), hint)) { Logger.debug("submittable", String.format("Setting amount hint of {%s} to %s [%s]", @@ -1007,8 +1007,8 @@ public class NewTransactionModel extends ViewModel { return false; return Objects.equals(date, other.date) && - TextUtils.equals(description, other.description) && - TextUtils.equals(comment, other.comment); + Misc.equalStrings(description, other.description) && + Misc.equalStrings(comment, other.comment); } } @@ -1150,16 +1150,16 @@ public class NewTransactionModel extends ViewModel { if (other == null) return false; - boolean equal = TextUtils.equals(accountName, other.accountName); - equal = equal && TextUtils.equals(comment, other.comment) && + boolean equal = Misc.equalStrings(accountName, other.accountName); + equal = equal && Misc.equalStrings(comment, other.comment) && (amountSet ? other.amountSet && amount == other.amount : !other.amountSet); // compare amount hint only if there is no amount if (!amountSet) equal = equal && (amountHintIsSet ? other.amountHintIsSet && - TextUtils.equals(amountHint, other.amountHint) + Misc.equalStrings(amountHint, other.amountHint) : !other.amountHintIsSet); - equal = equal && TextUtils.equals(currency, other.currency) && isLast == other.isLast; + equal = equal && Misc.equalStrings(currency, other.currency) && isLast == other.isLast; Logger.debug("new-trans", String.format("Comparing {%s} and {%s}: %s", this.toString(), other.toString(),