holder.vTransaction.setVisibility(View.GONE);
holder.vDelimiter.setVisibility(View.VISIBLE);
holder.tvDelimiterDate.setText(DateFormat.getDateInstance().format(date));
- holder.tvDelimiterMonth
- .setText(item.isMonthShown() ? Globals.monthNames[date.getMonth()] : "");
+ if (item.isMonthShown()) {
+ holder.tvDelimiterMonth.setText(Globals.monthNames[date.getMonth()]);
+ holder.tvDelimiterMonth.setVisibility(View.VISIBLE);
+ holder.vDelimiterLine.setBackgroundResource(R.drawable.dashed_border_8dp);
+ }
+ else {
+ holder.tvDelimiterMonth.setVisibility(View.GONE);
+ holder.vDelimiterLine.setBackgroundResource(R.drawable.dashed_border_1dp);
+ }
}
}
ConstraintLayout vDelimiter;
CardView vTransaction;
TextView tvDelimiterMonth, tvDelimiterDate;
+ View vDelimiterLine;
public TransactionRowHolder(@NonNull View itemView) {
super(itemView);
this.row = itemView.findViewById(R.id.transaction_row);
this.vTransaction = itemView.findViewById(R.id.transaction_card_view);
this.tvDelimiterDate = itemView.findViewById(R.id.transaction_delimiter_date);
this.tvDelimiterMonth = itemView.findViewById(R.id.transaction_delimiter_month);
+ this.vDelimiterLine = itemView.findViewById(R.id.transaction_delimiter_line);
}
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright © 2019 Damyan Ivanov.
+ ~ This file is part of Mobile-Ledger.
+ ~ Mobile-Ledger is free software: you can distribute it and/or modify it
+ ~ under the term of the GNU General Public License as published by
+ ~ the Free Software Foundation, either version 3 of the License, or
+ ~ (at your opinion), any later version.
+ ~
+ ~ Mobile-Ledger is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU General Public License terms for details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
+ -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="line"
+ android:thickness="1dp"
+ android:tint="@color/header_border">
+ <stroke
+ android:width="8dp"
+ android:color="@color/colorPrimaryDark"
+ android:dashWidth="16dp"
+ android:dashGap="8dp" />
+
+</shape>
\ No newline at end of file