]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/transaction_list_row.xml
running totals when filtering transactions by account
[mobile-ledger.git] / app / src / main / res / layout / transaction_list_row.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   ~ Copyright © 2021 Damyan Ivanov.
5   ~ This file is part of MoLe.
6   ~ MoLe is free software: you can distribute it and/or modify it
7   ~ under the term of the GNU General Public License as published by
8   ~ the Free Software Foundation, either version 3 of the License, or
9   ~ (at your opinion), any later version.
10   ~
11   ~ MoLe is distributed in the hope that it will be useful,
12   ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
13   ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   ~ GNU General Public License terms for details.
15   ~
16   ~ You should have received a copy of the GNU General Public License
17   ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
18   -->
19
20 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
21     xmlns:app="http://schemas.android.com/apk/res-auto"
22     xmlns:tools="http://schemas.android.com/tools"
23     android:layout_width="match_parent"
24     android:layout_height="wrap_content"
25     >
26
27     <com.google.android.material.card.MaterialCardView
28         android:id="@+id/transaction_card_view"
29         style="@style/Widget.MaterialComponents.CardView"
30         android:layout_width="match_parent"
31         android:layout_height="wrap_content"
32         android:layout_margin="8dp"
33         android:visibility="visible"
34         app:cardCornerRadius="0dp"
35         app:cardElevation="2dp"
36         app:cardUseCompatPadding="false"
37         >
38
39         <androidx.constraintlayout.widget.ConstraintLayout
40             android:id="@+id/transaction_row"
41             android:layout_width="match_parent"
42             android:layout_height="wrap_content"
43             android:gravity="center_vertical"
44             android:minHeight="36dp"
45             android:padding="8dp"
46             >
47
48             <LinearLayout
49                 android:id="@+id/transaction_row_head"
50                 android:layout_width="0dp"
51                 android:layout_height="wrap_content"
52                 android:orientation="vertical"
53                 app:layout_constraintEnd_toEndOf="parent"
54                 app:layout_constraintStart_toStartOf="parent"
55                 app:layout_constraintTop_toTopOf="parent"
56                 >
57
58                 <TextView
59                     android:id="@+id/transaction_row_description"
60                     android:layout_width="match_parent"
61                     android:layout_height="wrap_content"
62                     android:text="---."
63                     android:textAppearance="@android:style/TextAppearance.Material.Medium"
64                     android:textStyle="bold"
65                     tools:ignore="HardcodedText"
66                     />
67                 <TextView
68                     android:id="@+id/transaction_comment"
69                     style="@style/transaction_list_comment"
70                     android:layout_width="match_parent"
71                     android:layout_height="wrap_content"
72                     android:layout_marginStart="0dp"
73                     android:layout_marginTop="0dp"
74                     android:text="Comment text"
75                     tools:ignore="HardcodedText"
76                     />
77             </LinearLayout>
78
79             <LinearLayout
80                 android:id="@+id/transaction_row_acc_amounts"
81                 android:layout_width="0dp"
82                 android:layout_height="wrap_content"
83                 android:layout_marginTop="8dp"
84                 android:orientation="vertical"
85                 app:layout_constraintEnd_toStartOf="@id/transaction_running_total"
86                 app:layout_constraintStart_toStartOf="parent"
87                 app:layout_constraintTop_toBottomOf="@+id/transaction_row_head"
88                 >
89
90                 <include layout="@layout/transaction_list_row_accounts_table_row" />
91                 <include layout="@layout/transaction_list_row_accounts_table_row" />
92
93             </LinearLayout>
94             <TextView
95                 android:id="@+id/transaction_running_total"
96                 style="@style/transaction_list_comment"
97                 android:layout_width="wrap_content"
98                 android:layout_height="wrap_content"
99                 android:layout_marginStart="@dimen/half_text_margin"
100                 android:gravity="top|end"
101                 android:text="one two"
102                 android:visibility="visible"
103                 app:layout_constraintBottom_toBottomOf="@id/transaction_row_acc_amounts"
104                 app:layout_constraintEnd_toEndOf="parent"
105                 app:layout_constraintStart_toEndOf="@id/transaction_row_acc_amounts"
106                 app:layout_goneMarginStart="0dp"
107                 />
108             <View
109                 android:id="@+id/transaction_running_total_divider"
110                 android:layout_width="1dp"
111                 android:layout_height="0dp"
112                 android:background="?commentColor"
113                 android:layout_marginStart="@dimen/quarter_text_margin"
114                 app:layout_goneMarginStart="0dp"
115                 app:layout_constraintBottom_toBottomOf="@id/transaction_running_total"
116                 app:layout_constraintStart_toEndOf="@id/transaction_row_acc_amounts"
117                 app:layout_constraintTop_toTopOf="@id/transaction_running_total"
118                 />
119
120         </androidx.constraintlayout.widget.ConstraintLayout>
121     </com.google.android.material.card.MaterialCardView>
122
123
124 </FrameLayout>