From: Damyan Ivanov Date: Sat, 13 Feb 2021 18:53:37 +0000 (+0200) Subject: self-explanatory amount reversal switch X-Git-Tag: v0.17.0~130 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=1f7142d161a181be9781bf9b9ad34797fa6a6067;p=mobile-ledger.git self-explanatory amount reversal switch --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsAdapter.java index 80c6df49..23260e00 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsAdapter.java @@ -549,8 +549,17 @@ class TemplateDetailsAdapter extends RecyclerView.Adapter getItem().setNegateAmount(isChecked)); + b.negateAmountSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { + getItem().setNegateAmount(isChecked); + b.templateDetailsNegateAmountText.setText( + isChecked ? R.string.template_account_change_amount_sign + : R.string.template_account_keep_amount_sign); + }); + final View.OnClickListener negLabelClickListener = (view) -> { + b.negateAmountSwitch.toggle(); + }; + b.templateDetailsNegateAmountLabel.setOnClickListener(negLabelClickListener); + b.templateDetailsNegateAmountText.setOnClickListener(negLabelClickListener); } @Override void bind(TemplateDetailsItem item) { @@ -601,6 +610,9 @@ class TemplateDetailsAdapter extends RecyclerView.Adapter - + + + \ No newline at end of file diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index c2df39b4..360c3fc7 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -219,4 +219,7 @@ Връщане Резултат от прилагането на шаблона Група %1$d (%2$s) + Без промяна на знака + Обръщане на знака на сумата (от плюс на минус и от минус на плюс) + Знак на сумата diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dc477843..4def8849 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -229,4 +229,7 @@ Undo Pattern match result Group %1$d (%2$s) + Sign will not be altered + Amount sign will be changed (plus to minus; minus to plus) + Change amount sign