import net.ktnx.mobileledger.model.TransactionListItem;
import net.ktnx.mobileledger.utils.Colors;
import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.Misc;
import java.text.DateFormat;
import java.util.Date;
case HEAD:
holder.tvDescription.setText(step.getTransaction()
.getDescription());
+ String trComment = Misc.emptyIsNull(step.getTransaction()
+ .getComment());
+ if (trComment == null)
+ holder.tvComment.setVisibility(View.GONE);
+ else {
+ holder.tvComment.setText(trComment);
+ holder.tvComment.setVisibility(View.VISIBLE);
+ }
- if (step.isOdd())
- holder.row.setBackgroundColor(Colors.tableRowDarkBG);
- else
- holder.row.setBackgroundColor(Colors.tableRowLightBG);
+// if (step.isOdd())
+// holder.row.setBackgroundColor(Colors.tableRowDarkBG);
+// else
+// holder.row.setBackgroundColor(Colors.tableRowLightBG);
break;
case ACCOUNTS:
class TransactionRowHolder extends RecyclerView.ViewHolder {
TextView tvDescription;
+ TextView tvComment;
LinearLayout tableAccounts;
ConstraintLayout row;
ConstraintLayout vDelimiter;
super(itemView);
this.row = itemView.findViewById(R.id.transaction_row);
this.tvDescription = itemView.findViewById(R.id.transaction_row_description);
+ this.tvComment = itemView.findViewById(R.id.transaction_comment);
this.tableAccounts = itemView.findViewById(R.id.transaction_row_acc_amounts);
this.vDelimiter = itemView.findViewById(R.id.transaction_delimiter);
this.vTransaction = itemView.findViewById(R.id.transaction_card_view);
android:id="@+id/transaction_row_head"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
+ android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/transaction_row_description"
style="@style/account_summary_account_name"
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="5"
android:text="---."
android:textAppearance="@android:style/TextAppearance.Material.Medium"
- android:textColor="?textColor"
- tools:ignore="HardcodedText" />
-
+ tools:ignore="HardcodedText"
+ />
+ <TextView
+ android:id="@+id/transaction_comment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:text="Comment text"
+ android:textStyle="italic"
+ tools:ignore="HardcodedText"
+ />
</LinearLayout>
<View