super(binding.getRoot());
b = binding;
}
- public void bind(@NonNull LedgerTransaction tr, @Nullable String boldAccountName) {
+ public void bind(@NonNull TransactionListItem item, @Nullable String boldAccountName) {
+ LedgerTransaction tr = item.getTransaction();
b.transactionRowDescription.setText(tr.getDescription());
String trComment = Misc.emptyIsNull(tr.getComment());
if (trComment == null)
b.transactionComment.setVisibility(View.VISIBLE);
}
+ if (Misc.emptyIsNull(item.getRunningTotal()) != null) {
+ b.transactionRunningTotal.setText(item.getRunningTotal());
+ b.transactionRunningTotal.setVisibility(View.VISIBLE);
+ b.transactionRunningTotalDivider.setVisibility(View.VISIBLE);
+ }
+ else {
+ b.transactionRunningTotal.setVisibility(View.GONE);
+ b.transactionRunningTotalDivider.setVisibility(View.GONE);
+ }
+
int rowIndex = 0;
Context ctx = b.getRoot()
.getContext();
if ((boldAccountName != null) && acc.getAccountName()
.startsWith(boldAccountName))
{
- accName.setTextColor(Colors.secondary);
- accAmount.setTextColor(Colors.secondary);
+ accName.setTextColor(Colors.primary);
+ accAmount.setTextColor(Colors.primary);
- SpannableString ss = new SpannableString(acc.getAccountName());
- ss.setSpan(new StyleSpan(Typeface.BOLD), 0, boldAccountName.length(),
+ SpannableString ss = new SpannableString(Misc.addWrapHints(acc.getAccountName()));
+ ss.setSpan(new StyleSpan(Typeface.BOLD), 0, Misc.addWrapHints(boldAccountName)
+ .length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
accName.setText(ss);
}
.getDefaultColor();
accName.setTextColor(textColor);
accAmount.setTextColor(textColor);
- accName.setText(acc.getAccountName());
+ accName.setText(Misc.addWrapHints(acc.getAccountName()));
}
String comment = acc.getComment();