From 632be2acddc6cb3442a7b5614e57e90d5c34674a Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 31 Mar 2024 14:13:26 +0300 Subject: [PATCH] more pronounced day/month delimiters in the transaction list --- .../TransactionListDelimiterRowHolder.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListDelimiterRowHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListDelimiterRowHolder.java index 390b4941..b5fe883d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListDelimiterRowHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListDelimiterRowHolder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2021 Damyan Ivanov. + * Copyright © 2024 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -19,9 +19,12 @@ package net.ktnx.mobileledger.ui.transaction_list; import android.view.View; +import androidx.constraintlayout.widget.ConstraintLayout; + import net.ktnx.mobileledger.App; import net.ktnx.mobileledger.databinding.TransactionDelimiterBinding; import net.ktnx.mobileledger.model.TransactionListItem; +import net.ktnx.mobileledger.utils.DimensionUtils; import net.ktnx.mobileledger.utils.Globals; import net.ktnx.mobileledger.utils.SimpleDate; @@ -46,15 +49,21 @@ class TransactionListDelimiterRowHolder extends TransactionRowHolderBase { b.transactionDelimiterMonth.setText( Globals.monthNames[cal.get(GregorianCalendar.MONTH)]); b.transactionDelimiterMonth.setVisibility(View.VISIBLE); - // holder.vDelimiterLine.setBackgroundResource(R.drawable - // .dashed_border_8dp); b.transactionDelimiterThick.setVisibility(View.VISIBLE); + ConstraintLayout.LayoutParams lp = + (ConstraintLayout.LayoutParams) b.transactionDelimiterThick.getLayoutParams(); + lp.height = DimensionUtils.dp2px(b.getRoot() + .getContext(), 4); + b.transactionDelimiterThick.setLayoutParams(lp); } else { b.transactionDelimiterMonth.setVisibility(View.GONE); - // holder.vDelimiterLine.setBackgroundResource(R.drawable - // .dashed_border_1dp); - b.transactionDelimiterThick.setVisibility(View.GONE); + ConstraintLayout.LayoutParams lp = + (ConstraintLayout.LayoutParams) b.transactionDelimiterThick.getLayoutParams(); + lp.height = DimensionUtils.dp2px(b.getRoot() + .getContext(), 1.3f); + b.transactionDelimiterThick.setLayoutParams(lp); + b.transactionDelimiterThick.setVisibility(View.VISIBLE); } } -- 2.39.5