]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/template_details_header.xml
visual improvements in template editor
[mobile-ledger.git] / app / src / main / res / layout / template_details_header.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2021 Damyan Ivanov.
3   ~ This file is part of MoLe.
4   ~ MoLe is free software: you can distribute it and/or modify it
5   ~ under the term of the GNU General Public License as published by
6   ~ the Free Software Foundation, either version 3 of the License, or
7   ~ (at your opinion), any later version.
8   ~
9   ~ MoLe is distributed in the hope that it will be useful,
10   ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
11   ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   ~ GNU General Public License terms for details.
13   ~
14   ~ You should have received a copy of the GNU General Public License
15   ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
16   -->
17
18 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
19     xmlns:app="http://schemas.android.com/apk/res-auto"
20     android:id="@+id/pattern_details_item_head"
21     android:layout_width="match_parent"
22     android:layout_height="wrap_content"
23     android:padding="@dimen/text_margin"
24     >
25     <com.google.android.material.textfield.TextInputLayout
26         android:id="@+id/pattern_name_layout"
27         android:layout_width="0dp"
28         android:layout_height="wrap_content"
29         android:layout_marginBottom="@dimen/text_margin"
30         app:endIconMode="clear_text"
31         app:layout_constraintBottom_toTopOf="@id/pattern_layout"
32         app:layout_constraintEnd_toEndOf="parent"
33         app:layout_constraintStart_toStartOf="parent"
34         app:layout_constraintTop_toTopOf="parent"
35         >
36         <com.google.android.material.textfield.TextInputEditText
37             android:id="@+id/template_name"
38             android:layout_width="match_parent"
39             android:layout_height="wrap_content"
40             android:hint="@string/template_name_label"
41             android:inputType="text"
42             />
43     </com.google.android.material.textfield.TextInputLayout>
44     <com.google.android.material.textfield.TextInputLayout
45         android:id="@+id/pattern_layout"
46         android:layout_width="0dp"
47         android:layout_height="wrap_content"
48         android:layout_marginBottom="@dimen/text_margin"
49         android:textAppearance="?attr/textAppearanceListItem"
50         app:endIconMode="clear_text"
51         app:layout_constraintBottom_toTopOf="@id/pattern_hint_title"
52         app:layout_constraintEnd_toEndOf="parent"
53         app:layout_constraintStart_toStartOf="parent"
54         app:layout_constraintTop_toBottomOf="@id/pattern_name_layout"
55         >
56         <com.google.android.material.textfield.TextInputEditText
57             android:id="@+id/pattern"
58             android:layout_width="match_parent"
59             android:layout_height="wrap_content"
60             android:hint="@string/template_details_pattern_label"
61             android:inputType="text"
62             />
63     </com.google.android.material.textfield.TextInputLayout>
64     <TextView
65         android:id="@+id/pattern_hint_title"
66         android:layout_width="0dp"
67         android:layout_height="wrap_content"
68         android:text="@string/pattern_match_result"
69         android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
70         app:layout_constraintBottom_toTopOf="@+id/pattern_hint_text"
71         app:layout_constraintEnd_toEndOf="parent"
72         app:layout_constraintStart_toStartOf="parent"
73         app:layout_constraintTop_toBottomOf="@id/pattern_layout"
74         />
75     <TextView
76         android:id="@+id/pattern_hint_text"
77         android:layout_width="0dp"
78         android:layout_height="match_parent"
79         android:layout_marginBottom="@dimen/text_margin"
80         android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
81         app:layout_constraintBottom_toTopOf="@+id/test_text_layout"
82         app:layout_constraintEnd_toEndOf="parent"
83         app:layout_constraintStart_toStartOf="parent"
84         app:layout_constraintTop_toBottomOf="@id/pattern_hint_title"
85         />
86     <com.google.android.material.textfield.TextInputLayout
87         android:id="@+id/test_text_layout"
88         android:layout_width="0dp"
89         android:layout_height="wrap_content"
90         android:layout_marginBottom="@dimen/text_margin"
91         android:textAppearance="?attr/textAppearanceListItem"
92         app:endIconMode="clear_text"
93         app:layout_constraintBottom_toTopOf="@id/transaction_parameters_label"
94         app:layout_constraintEnd_toStartOf="@id/template_details_head_scan_qr_button"
95         app:layout_constraintStart_toStartOf="parent"
96         app:layout_constraintTop_toBottomOf="@id/pattern_hint_text"
97         >
98         <com.google.android.material.textfield.TextInputEditText
99             android:id="@+id/test_text"
100             android:layout_width="match_parent"
101             android:layout_height="wrap_content"
102             android:hint="@string/template_details_test_text_label"
103             android:inputType="text"
104             />
105     </com.google.android.material.textfield.TextInputLayout>
106     <ImageButton
107         android:id="@+id/template_details_head_scan_qr_button"
108         android:layout_width="wrap_content"
109         android:layout_height="0dp"
110         android:background="@android:color/transparent"
111         android:contentDescription="@string/scan_qr"
112         android:minWidth="@dimen/thumb_row_height"
113         app:layout_constraintBottom_toBottomOf="@id/test_text_layout"
114         app:layout_constraintEnd_toEndOf="parent"
115         app:layout_constraintTop_toTopOf="@id/test_text_layout"
116         app:srcCompat="@drawable/ic_baseline_qr_code_scanner_24"
117         app:tint="?colorPrimary"
118         />
119     <TextView
120         android:id="@+id/transaction_parameters_label"
121         android:layout_width="match_parent"
122         android:layout_height="wrap_content"
123         android:gravity="end"
124         android:text="@string/template_transaction_parameters_label"
125         android:textAppearance="?attr/textAppearanceListItem"
126         app:layout_constraintBottom_toTopOf="@+id/pattern_transaction_date_label"
127         app:layout_constraintEnd_toEndOf="parent"
128         app:layout_constraintStart_toStartOf="parent"
129         app:layout_constraintTop_toBottomOf="@id/test_text_layout"
130         />
131     <TextView
132         android:id="@+id/pattern_transaction_date_label"
133         android:layout_width="match_parent"
134         android:layout_height="wrap_content"
135         android:text="@string/template_details_date_label"
136         android:textAppearance="?attr/textAppearanceListItem"
137         app:layout_constraintEnd_toEndOf="parent"
138         app:layout_constraintStart_toStartOf="parent"
139         app:layout_constraintTop_toBottomOf="@id/transaction_parameters_label"
140         />
141     <TextView
142         android:id="@+id/template_details_year_source_label"
143         android:layout_width="0dp"
144         android:layout_height="wrap_content"
145         android:text="@string/template_details_date_year_source_label"
146         android:textAlignment="center"
147         android:textAppearance="?attr/textAppearanceListItem"
148         app:layout_constraintBottom_toTopOf="@+id/template_details_year_source"
149         app:layout_constraintEnd_toStartOf="@id/template_details_month_source_label"
150         app:layout_constraintStart_toStartOf="parent"
151         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
152         />
153     <TextView
154         android:id="@+id/template_details_month_source_label"
155         android:layout_width="0dp"
156         android:layout_height="wrap_content"
157         android:text="@string/template_details_date_month_source_label"
158         android:textAlignment="center"
159         android:textAppearance="?attr/textAppearanceListItem"
160         app:layout_constraintBottom_toTopOf="@+id/template_details_month_source"
161         app:layout_constraintEnd_toStartOf="@id/template_details_day_source_label"
162         app:layout_constraintStart_toEndOf="@id/template_details_year_source_label"
163         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
164         />
165     <TextView
166         android:id="@+id/template_details_day_source_label"
167         android:layout_width="0dp"
168         android:layout_height="wrap_content"
169         android:text="@string/template_details_date_day_source_label"
170         android:textAlignment="center"
171         android:textAppearance="?attr/textAppearanceListItem"
172         app:layout_constraintBottom_toTopOf="@+id/template_details_day_source"
173         app:layout_constraintEnd_toEndOf="parent"
174         app:layout_constraintStart_toEndOf="@id/template_details_month_source_label"
175         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
176         />
177     <TextView
178         android:id="@+id/template_details_year_source"
179         android:layout_width="0dp"
180         android:layout_height="wrap_content"
181         android:text="@string/template_details_source_literal"
182         android:textAlignment="center"
183         android:textAppearance="?attr/textAppearanceListItemSecondary"
184         app:layout_constraintBottom_toTopOf="@+id/template_details_date_year_layout"
185         app:layout_constraintEnd_toStartOf="@id/template_details_month_source"
186         app:layout_constraintStart_toStartOf="parent"
187         app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
188         />
189     <TextView
190         android:id="@+id/template_details_month_source"
191         android:layout_width="0dp"
192         android:layout_height="wrap_content"
193         android:text=""
194         android:textAlignment="center"
195         android:textAppearance="?attr/textAppearanceListItemSecondary"
196         app:layout_constraintBottom_toTopOf="@+id/template_details_date_month_layout"
197         app:layout_constraintEnd_toStartOf="@id/template_details_day_source"
198         app:layout_constraintStart_toEndOf="@id/template_details_year_source"
199         app:layout_constraintTop_toBottomOf="@id/template_details_month_source_label"
200         />
201     <TextView
202         android:id="@+id/template_details_day_source"
203         android:layout_width="0dp"
204         android:layout_height="wrap_content"
205         android:text=""
206         android:textAlignment="center"
207         android:textAppearance="?attr/textAppearanceListItemSecondary"
208         app:layout_constraintBottom_toTopOf="@+id/template_details_date_day_layout"
209         app:layout_constraintEnd_toEndOf="parent"
210         app:layout_constraintStart_toEndOf="@id/template_details_month_source"
211         app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
212         />
213     <androidx.constraintlayout.widget.Barrier
214         android:id="@+id/barrier_before_date_inputs"
215         android:layout_width="match_parent"
216         android:layout_height="wrap_content"
217         app:barrierDirection="bottom"
218         app:constraint_referenced_ids="template_details_year_source,template_details_month_source,template_details_day_source"
219         />
220     <com.google.android.material.textfield.TextInputLayout
221         android:id="@+id/template_details_date_year_layout"
222         android:layout_width="0dp"
223         android:layout_height="wrap_content"
224         android:layout_marginBottom="@dimen/text_margin"
225         app:layout_constraintEnd_toEndOf="@id/template_details_year_source"
226         app:layout_constraintStart_toStartOf="parent"
227         app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
228         >
229         <com.google.android.material.textfield.TextInputEditText
230             android:id="@+id/template_details_date_year"
231             android:layout_width="match_parent"
232             android:layout_height="wrap_content"
233             android:gravity="center_horizontal"
234             android:hint="@string/date_year_hint"
235             android:inputType="number"
236             />
237     </com.google.android.material.textfield.TextInputLayout>
238     <com.google.android.material.textfield.TextInputLayout
239         android:id="@+id/template_details_date_month_layout"
240         android:layout_width="0dp"
241         android:layout_height="wrap_content"
242         android:layout_marginBottom="@dimen/text_margin"
243         app:layout_constraintEnd_toEndOf="@id/template_details_month_source"
244         app:layout_constraintStart_toStartOf="@id/template_details_month_source"
245         app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
246         >
247         <com.google.android.material.textfield.TextInputEditText
248             android:id="@+id/template_details_date_month"
249             android:layout_width="match_parent"
250             android:layout_height="wrap_content"
251             android:gravity="center_horizontal"
252             android:hint="@string/date_month_hint"
253             android:inputType="number"
254             />
255     </com.google.android.material.textfield.TextInputLayout>
256     <com.google.android.material.textfield.TextInputLayout
257         android:id="@+id/template_details_date_day_layout"
258         android:layout_width="0dp"
259         android:layout_height="wrap_content"
260         android:layout_marginBottom="@dimen/text_margin"
261         app:layout_constraintBottom_toTopOf="@id/barrier_before_description"
262         app:layout_constraintEnd_toEndOf="parent"
263         app:layout_constraintStart_toStartOf="@id/template_details_day_source"
264         app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
265         >
266         <com.google.android.material.textfield.TextInputEditText
267             android:id="@+id/template_details_date_day"
268             android:layout_width="match_parent"
269             android:layout_height="wrap_content"
270             android:gravity="center_horizontal"
271             android:hint="@string/date_day_hint"
272             android:inputType="number"
273             />
274     </com.google.android.material.textfield.TextInputLayout>
275     <androidx.constraintlayout.widget.Barrier
276         android:id="@+id/barrier_before_description"
277         android:layout_width="match_parent"
278         android:layout_height="wrap_content"
279         android:orientation="horizontal"
280         app:barrierDirection="bottom"
281         app:constraint_referenced_ids="template_details_date_day_layout,template_details_date_month_layout,template_details_date_year_layout"
282         app:layout_constraintEnd_toEndOf="parent"
283         app:layout_constraintStart_toStartOf="parent"
284         />
285     <TextView
286         android:id="@+id/template_transaction_description_source_label"
287         android:layout_width="0dp"
288         android:layout_height="match_parent"
289         android:text="@string/transaction_description_source_label"
290         android:textAppearance="?attr/textAppearanceListItem"
291         app:layout_constraintBottom_toTopOf="@+id/template_transaction_description_source"
292         app:layout_constraintEnd_toEndOf="parent"
293         app:layout_constraintStart_toStartOf="parent"
294         app:layout_constraintTop_toBottomOf="@id/barrier_before_description"
295         />
296     <TextView
297         android:id="@+id/template_transaction_description_source"
298         android:layout_width="0dp"
299         android:layout_height="wrap_content"
300         android:minWidth="100dp"
301         android:textAppearance="?attr/textAppearanceListItemSecondary"
302         app:layout_constraintBottom_toTopOf="@+id/transaction_description_layout"
303         app:layout_constraintEnd_toEndOf="parent"
304         app:layout_constraintStart_toStartOf="parent"
305         app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source_label"
306         />
307     <com.google.android.material.textfield.TextInputLayout
308         android:id="@+id/transaction_description_layout"
309         android:layout_width="match_parent"
310         android:layout_height="wrap_content"
311         android:layout_marginBottom="@dimen/text_margin"
312         app:endIconMode="clear_text"
313         app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source_label"
314         app:layout_constraintEnd_toEndOf="parent"
315         app:layout_constraintStart_toStartOf="parent"
316         app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source"
317         >
318         <com.google.android.material.textfield.TextInputEditText
319             android:id="@+id/transaction_description"
320             android:layout_width="match_parent"
321             android:layout_height="wrap_content"
322             android:hint="@string/template_transaction_description_hint"
323             />
324     </com.google.android.material.textfield.TextInputLayout>
325     <TextView
326         android:id="@+id/template_transaction_comment_source_label"
327         android:layout_width="0dp"
328         android:layout_height="match_parent"
329         android:text="@string/transaction_comment_source_label"
330         android:textAppearance="?attr/textAppearanceListItem"
331         app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source"
332         app:layout_constraintEnd_toEndOf="parent"
333         app:layout_constraintStart_toStartOf="parent"
334         app:layout_constraintTop_toBottomOf="@id/transaction_description_layout"
335         />
336     <TextView
337         android:id="@+id/template_transaction_comment_source"
338         android:layout_width="0dp"
339         android:layout_height="wrap_content"
340         android:minWidth="100dp"
341         android:textAppearance="?attr/textAppearanceListItemSecondary"
342         app:layout_constraintBottom_toTopOf="@+id/transaction_comment_layout"
343         app:layout_constraintEnd_toEndOf="parent"
344         app:layout_constraintStart_toStartOf="parent"
345         app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source_label"
346         />
347     <com.google.android.material.textfield.TextInputLayout
348         android:id="@+id/transaction_comment_layout"
349         android:layout_width="match_parent"
350         android:layout_height="wrap_content"
351         app:endIconMode="clear_text"
352         app:layout_constraintBottom_toBottomOf="parent"
353         app:layout_constraintEnd_toEndOf="parent"
354         app:layout_constraintStart_toStartOf="parent"
355         app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source"
356         >
357         <com.google.android.material.textfield.TextInputEditText
358             android:id="@+id/transaction_comment"
359             android:layout_width="match_parent"
360             android:layout_height="wrap_content"
361             android:hint="@string/template_transaction_comment_hint"
362             />
363     </com.google.android.material.textfield.TextInputLayout>
364
365 </androidx.constraintlayout.widget.ConstraintLayout>