import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import net.ktnx.mobileledger.R;
import net.ktnx.mobileledger.databinding.NewTransactionAccountRowBinding;
import net.ktnx.mobileledger.R;
import net.ktnx.mobileledger.databinding.NewTransactionAccountRowBinding;
//TODO multiple amounts with different currencies per posting?
NewTransactionAccountRowItemHolder(@NonNull NewTransactionAccountRowBinding b,
NewTransactionItemsAdapter adapter) {
//TODO multiple amounts with different currencies per posting?
NewTransactionAccountRowItemHolder(@NonNull NewTransactionAccountRowBinding b,
NewTransactionItemsAdapter adapter) {
b.currencyButton.setOnClickListener(v -> {
CurrencySelectorFragment cpf = new CurrencySelectorFragment();
cpf.showPositionAndPadding();
b.currencyButton.setOnClickListener(v -> {
CurrencySelectorFragment cpf = new CurrencySelectorFragment();
cpf.showPositionAndPadding();
- cpf.setOnCurrencySelectedListener(c -> adapter.setItemCurrency(getAdapterPosition(),
- (c == null) ? null : c.getName()));
+ cpf.setOnCurrencySelectedListener(
+ c -> adapter.setItemCurrency(getBindingAdapterPosition(), c));
// probably the row was swiped out
Logger.debug("new-trans", "Ignoring request to suncData(): adapter position negative");
return false;
}
// probably the row was swiped out
Logger.debug("new-trans", "Ignoring request to suncData(): adapter position negative");
return false;
}
acc.isAmountSet() ? String.format("%4.2f", acc.getAmount()) : null);
displayAmountValidity(true);
acc.isAmountSet() ? String.format("%4.2f", acc.getAmount()) : null);
displayAmountValidity(true);
- b.comment.setText(acc.getComment());
+ final String comment = acc.getComment();
+ b.comment.setText(comment);
+ styleComment(b.comment, comment);