From: Damyan Ivanov Date: Sat, 30 Jan 2021 14:36:23 +0000 (+0200) Subject: format account amounts upon focus leave; store in DB X-Git-Tag: v0.17.0~198 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=adf69118b53d51145ad6cd59ffe9a654f1305662;p=mobile-ledger.git format account amounts upon focus leave; store in DB --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternDetailsAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternDetailsAdapter.java index e98a28f7..25083fac 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternDetailsAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternDetailsAdapter.java @@ -42,6 +42,7 @@ import net.ktnx.mobileledger.utils.Misc; import org.jetbrains.annotations.NotNull; +import java.text.ParseException; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -454,6 +455,53 @@ class PatternDetailsAdapter extends RecyclerView.Adapter { + if (hasFocus) + return; + + PatternDetailsItem.AccountRow accRow = getItem(); + if (!accRow.hasLiteralAmount()) + return; + Float amt = accRow.getAmount(); + if (amt == null) + return; + + b.patternDetailsAccountAmount.setText(Data.formatNumber(amt)); + }); } @Override void bind(PatternDetailsItem item) { @@ -488,7 +536,9 @@ class PatternDetailsAdapter extends RecyclerView.Adapter