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.
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.
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/>.
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:animateLayoutChanges="true"
24 android:padding="@dimen/text_margin"
27 android:id="@+id/template_details_template_params_help_button"
28 android:layout_width="wrap_content"
29 android:layout_height="wrap_content"
30 android:background="@android:color/transparent"
31 android:contentDescription="@string/template_details_template_params_help_description"
32 android:minWidth="@dimen/thumb_row_height"
33 android:src="@drawable/ic_baseline_help_outline_24_primary"
34 app:layout_constraintBottom_toBottomOf="@id/template_details_template_params_label"
35 app:layout_constraintEnd_toEndOf="parent"
36 app:layout_constraintTop_toTopOf="@id/template_details_template_params_label"
39 android:id="@+id/template_details_template_params_label"
40 android:layout_width="0dp"
41 android:layout_height="wrap_content"
42 android:layout_marginBottom="@dimen/text_margin"
44 android:text="@string/template_details_template_params_label"
45 android:textAppearance="@android:style/TextAppearance.Material.Medium"
46 app:layout_constraintBottom_toTopOf="@id/pattern_name_layout"
47 app:layout_constraintEnd_toStartOf="@id/template_details_template_params_help_button"
48 app:layout_constraintStart_toStartOf="parent"
49 app:layout_constraintTop_toTopOf="parent"
51 <com.google.android.material.textfield.TextInputLayout
52 android:id="@+id/pattern_name_layout"
53 android:layout_width="0dp"
54 android:layout_height="wrap_content"
55 android:layout_marginBottom="@dimen/text_margin"
56 app:endIconMode="clear_text"
57 app:layout_constraintBottom_toTopOf="@id/pattern_layout"
58 app:layout_constraintEnd_toEndOf="parent"
59 app:layout_constraintStart_toStartOf="parent"
60 app:layout_constraintTop_toBottomOf="@id/template_details_template_params_label"
62 <com.google.android.material.textfield.TextInputEditText
63 android:id="@+id/template_name"
64 android:layout_width="match_parent"
65 android:layout_height="wrap_content"
66 android:hint="@string/template_name_label"
67 android:inputType="text"
69 </com.google.android.material.textfield.TextInputLayout>
70 <com.google.android.material.textfield.TextInputLayout
71 android:id="@+id/pattern_layout"
72 android:layout_width="0dp"
73 android:layout_height="wrap_content"
74 android:layout_marginBottom="@dimen/text_margin"
75 android:textAppearance="?attr/textAppearanceListItem"
76 app:endIconMode="clear_text"
77 app:layout_constraintBottom_toTopOf="@id/pattern_hint_title"
78 app:layout_constraintEnd_toEndOf="parent"
79 app:layout_constraintStart_toStartOf="parent"
80 app:layout_constraintTop_toBottomOf="@id/pattern_name_layout"
82 <com.google.android.material.textfield.TextInputEditText
83 android:id="@+id/pattern"
84 android:layout_width="match_parent"
85 android:layout_height="wrap_content"
86 android:hint="@string/template_details_pattern_label"
87 android:inputType="text|textMultiLine"
89 </com.google.android.material.textfield.TextInputLayout>
91 android:id="@+id/pattern_hint_title"
92 android:layout_width="0dp"
93 android:layout_height="wrap_content"
94 android:text="@string/pattern_match_result"
95 android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
96 app:layout_constraintBottom_toTopOf="@+id/pattern_hint_text"
97 app:layout_constraintEnd_toEndOf="parent"
98 app:layout_constraintStart_toStartOf="parent"
99 app:layout_constraintTop_toBottomOf="@id/pattern_layout"
102 android:id="@+id/pattern_hint_text"
103 android:layout_width="0dp"
104 android:layout_height="match_parent"
105 android:layout_marginBottom="@dimen/text_margin"
106 android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
107 app:layout_constraintBottom_toTopOf="@+id/test_text_layout"
108 app:layout_constraintEnd_toEndOf="parent"
109 app:layout_constraintStart_toStartOf="parent"
110 app:layout_constraintTop_toBottomOf="@id/pattern_hint_title"
112 <com.google.android.material.textfield.TextInputLayout
113 android:id="@+id/test_text_layout"
114 android:layout_width="0dp"
115 android:layout_height="wrap_content"
116 android:layout_marginBottom="@dimen/text_margin"
117 android:textAppearance="?attr/textAppearanceListItem"
118 app:endIconMode="clear_text"
119 app:layout_constraintBottom_toTopOf="@id/transaction_parameters_label"
120 app:layout_constraintEnd_toStartOf="@id/template_details_head_scan_qr_button"
121 app:layout_constraintStart_toStartOf="parent"
122 app:layout_constraintTop_toBottomOf="@id/pattern_hint_text"
124 <com.google.android.material.textfield.TextInputEditText
125 android:id="@+id/test_text"
126 android:layout_width="match_parent"
127 android:layout_height="wrap_content"
128 android:hint="@string/template_details_test_text_label"
129 android:inputType="text|textMultiLine"
131 </com.google.android.material.textfield.TextInputLayout>
133 android:id="@+id/template_details_head_scan_qr_button"
134 android:layout_width="wrap_content"
135 android:layout_height="0dp"
136 android:background="@android:color/transparent"
137 android:contentDescription="@string/scan_qr"
138 android:minWidth="@dimen/thumb_row_height"
139 app:layout_constraintBottom_toBottomOf="@id/test_text_layout"
140 app:layout_constraintEnd_toEndOf="parent"
141 app:layout_constraintTop_toTopOf="@id/test_text_layout"
142 app:srcCompat="@drawable/ic_baseline_qr_code_scanner_24"
143 app:tint="?colorPrimary"
146 android:id="@+id/transaction_parameters_label"
147 android:layout_width="match_parent"
148 android:layout_height="wrap_content"
149 android:layout_marginBottom="@dimen/text_margin"
150 android:gravity="end"
151 android:text="@string/template_transaction_parameters_label"
152 android:textAppearance="@android:style/TextAppearance.Material.Medium"
153 app:layout_constraintBottom_toTopOf="@+id/pattern_transaction_date_label"
154 app:layout_constraintEnd_toEndOf="parent"
155 app:layout_constraintStart_toStartOf="parent"
156 app:layout_constraintTop_toBottomOf="@id/test_text_layout"
159 android:id="@+id/pattern_transaction_date_label"
160 android:layout_width="match_parent"
161 android:layout_height="wrap_content"
162 android:text="@string/template_details_date_label"
163 android:textAppearance="?attr/textAppearanceListItem"
164 app:layout_constraintBottom_toTopOf="@id/template_details_year_source_label"
165 app:layout_constraintEnd_toEndOf="parent"
166 app:layout_constraintStart_toStartOf="parent"
167 app:layout_constraintTop_toBottomOf="@id/transaction_parameters_label"
170 android:id="@+id/template_details_year_source_label"
171 android:layout_width="0dp"
172 android:layout_height="wrap_content"
173 android:text="@string/template_details_date_year_source_label"
174 android:textAlignment="center"
175 android:textAppearance="@android:style/TextAppearance.Material.Body1"
176 app:layout_constraintBottom_toTopOf="@+id/template_details_year_source"
177 app:layout_constraintEnd_toStartOf="@id/template_details_month_source_label"
178 app:layout_constraintStart_toStartOf="parent"
179 app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
182 android:id="@+id/template_details_month_source_label"
183 android:layout_width="0dp"
184 android:layout_height="wrap_content"
185 android:text="@string/template_details_date_month_source_label"
186 android:textAlignment="center"
187 android:textAppearance="@android:style/TextAppearance.Material.Body1"
188 app:layout_constraintBottom_toTopOf="@+id/template_details_month_source"
189 app:layout_constraintEnd_toStartOf="@id/template_details_day_source_label"
190 app:layout_constraintStart_toEndOf="@id/template_details_year_source_label"
191 app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
194 android:id="@+id/template_details_day_source_label"
195 android:layout_width="0dp"
196 android:layout_height="wrap_content"
197 android:text="@string/template_details_date_day_source_label"
198 android:textAlignment="center"
199 android:textAppearance="@android:style/TextAppearance.Material.Body1"
200 app:layout_constraintBottom_toTopOf="@+id/template_details_day_source"
201 app:layout_constraintEnd_toEndOf="parent"
202 app:layout_constraintStart_toEndOf="@id/template_details_month_source_label"
203 app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
206 android:id="@+id/template_details_year_source"
207 android:layout_width="0dp"
208 android:layout_height="wrap_content"
209 android:text="@string/template_details_source_literal"
210 android:textAlignment="center"
211 android:textAppearance="?attr/textAppearanceListItemSecondary"
212 app:layout_constraintBottom_toTopOf="@+id/template_details_date_year_layout"
213 app:layout_constraintEnd_toStartOf="@id/template_details_month_source"
214 app:layout_constraintStart_toStartOf="parent"
215 app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
218 android:id="@+id/template_details_month_source"
219 android:layout_width="0dp"
220 android:layout_height="wrap_content"
222 android:textAlignment="center"
223 android:textAppearance="?attr/textAppearanceListItemSecondary"
224 app:layout_constraintBottom_toTopOf="@+id/template_details_date_month_layout"
225 app:layout_constraintEnd_toStartOf="@id/template_details_day_source"
226 app:layout_constraintStart_toEndOf="@id/template_details_year_source"
227 app:layout_constraintTop_toBottomOf="@id/template_details_month_source_label"
230 android:id="@+id/template_details_day_source"
231 android:layout_width="0dp"
232 android:layout_height="wrap_content"
234 android:textAlignment="center"
235 android:textAppearance="?attr/textAppearanceListItemSecondary"
236 app:layout_constraintBottom_toTopOf="@+id/template_details_date_day_layout"
237 app:layout_constraintEnd_toEndOf="parent"
238 app:layout_constraintStart_toEndOf="@id/template_details_month_source"
239 app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
241 <androidx.constraintlayout.widget.Barrier
242 android:id="@+id/barrier_before_date_inputs"
243 android:layout_width="match_parent"
244 android:layout_height="wrap_content"
245 app:barrierDirection="bottom"
246 app:constraint_referenced_ids="template_details_year_source,template_details_month_source,template_details_day_source"
248 <com.google.android.material.textfield.TextInputLayout
249 android:id="@+id/template_details_date_year_layout"
250 android:layout_width="0dp"
251 android:layout_height="wrap_content"
252 android:layout_marginBottom="@dimen/text_margin"
253 app:layout_constraintEnd_toEndOf="@id/template_details_year_source"
254 app:layout_constraintStart_toStartOf="parent"
255 app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
257 <com.google.android.material.textfield.TextInputEditText
258 android:id="@+id/template_details_date_year"
259 android:layout_width="match_parent"
260 android:layout_height="wrap_content"
261 android:gravity="center_horizontal"
262 android:hint="@string/date_year_hint"
263 android:inputType="number"
265 </com.google.android.material.textfield.TextInputLayout>
266 <com.google.android.material.textfield.TextInputLayout
267 android:id="@+id/template_details_date_month_layout"
268 android:layout_width="0dp"
269 android:layout_height="wrap_content"
270 android:layout_marginBottom="@dimen/text_margin"
271 app:layout_constraintEnd_toEndOf="@id/template_details_month_source"
272 app:layout_constraintStart_toStartOf="@id/template_details_month_source"
273 app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
275 <com.google.android.material.textfield.TextInputEditText
276 android:id="@+id/template_details_date_month"
277 android:layout_width="match_parent"
278 android:layout_height="wrap_content"
279 android:gravity="center_horizontal"
280 android:hint="@string/date_month_hint"
281 android:inputType="number"
283 </com.google.android.material.textfield.TextInputLayout>
284 <com.google.android.material.textfield.TextInputLayout
285 android:id="@+id/template_details_date_day_layout"
286 android:layout_width="0dp"
287 android:layout_height="wrap_content"
288 android:layout_marginBottom="@dimen/text_margin"
289 app:layout_constraintBottom_toTopOf="@id/barrier_before_description"
290 app:layout_constraintEnd_toEndOf="parent"
291 app:layout_constraintStart_toStartOf="@id/template_details_day_source"
292 app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
294 <com.google.android.material.textfield.TextInputEditText
295 android:id="@+id/template_details_date_day"
296 android:layout_width="match_parent"
297 android:layout_height="wrap_content"
298 android:gravity="center_horizontal"
299 android:hint="@string/date_day_hint"
300 android:inputType="number"
302 </com.google.android.material.textfield.TextInputLayout>
303 <androidx.constraintlayout.widget.Barrier
304 android:id="@+id/barrier_before_description"
305 android:layout_width="match_parent"
306 android:layout_height="wrap_content"
307 android:orientation="horizontal"
308 app:barrierDirection="bottom"
309 app:constraint_referenced_ids="template_details_date_day_layout,template_details_date_month_layout,template_details_date_year_layout"
310 app:layout_constraintEnd_toEndOf="parent"
311 app:layout_constraintStart_toStartOf="parent"
314 android:id="@+id/template_transaction_description_source_label"
315 android:layout_width="0dp"
316 android:layout_height="match_parent"
317 android:text="@string/transaction_description_source_label"
318 android:textAppearance="?attr/textAppearanceListItem"
319 app:layout_constraintBottom_toTopOf="@+id/template_transaction_description_source"
320 app:layout_constraintEnd_toEndOf="parent"
321 app:layout_constraintStart_toStartOf="parent"
322 app:layout_constraintTop_toBottomOf="@id/barrier_before_description"
325 android:id="@+id/template_transaction_description_source"
326 android:layout_width="0dp"
327 android:layout_height="wrap_content"
328 android:minWidth="100dp"
329 android:textAppearance="?attr/textAppearanceListItemSecondary"
330 app:layout_constraintBottom_toTopOf="@+id/transaction_description_layout"
331 app:layout_constraintEnd_toEndOf="parent"
332 app:layout_constraintStart_toStartOf="parent"
333 app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source_label"
335 <com.google.android.material.textfield.TextInputLayout
336 android:id="@+id/transaction_description_layout"
337 android:layout_width="match_parent"
338 android:layout_height="wrap_content"
339 android:layout_marginBottom="@dimen/text_margin"
340 app:endIconMode="clear_text"
341 app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source_label"
342 app:layout_constraintEnd_toEndOf="parent"
343 app:layout_constraintStart_toStartOf="parent"
344 app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source"
346 <com.google.android.material.textfield.TextInputEditText
347 android:id="@+id/transaction_description"
348 android:layout_width="match_parent"
349 android:layout_height="wrap_content"
350 android:hint="@string/template_transaction_description_hint"
352 </com.google.android.material.textfield.TextInputLayout>
354 android:id="@+id/template_transaction_comment_source_label"
355 android:layout_width="0dp"
356 android:layout_height="match_parent"
357 android:text="@string/transaction_comment_source_label"
358 android:textAppearance="?attr/textAppearanceListItem"
359 app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source"
360 app:layout_constraintEnd_toEndOf="parent"
361 app:layout_constraintStart_toStartOf="parent"
362 app:layout_constraintTop_toBottomOf="@id/transaction_description_layout"
365 android:id="@+id/template_transaction_comment_source"
366 android:layout_width="0dp"
367 android:layout_height="wrap_content"
368 android:minWidth="100dp"
369 android:textAppearance="?attr/textAppearanceListItemSecondary"
370 app:layout_constraintBottom_toTopOf="@+id/transaction_comment_layout"
371 app:layout_constraintEnd_toEndOf="parent"
372 app:layout_constraintStart_toStartOf="parent"
373 app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source_label"
375 <com.google.android.material.textfield.TextInputLayout
376 android:id="@+id/transaction_comment_layout"
377 android:layout_width="match_parent"
378 android:layout_height="wrap_content"
379 android:layout_marginBottom="@dimen/text_margin"
380 app:endIconMode="clear_text"
381 app:layout_constraintBottom_toTopOf="@id/template_is_fallback_label"
382 app:layout_constraintEnd_toEndOf="parent"
383 app:layout_constraintStart_toStartOf="parent"
384 app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source"
386 <com.google.android.material.textfield.TextInputEditText
387 android:id="@+id/transaction_comment"
388 android:layout_width="match_parent"
389 android:layout_height="wrap_content"
390 android:hint="@string/template_transaction_comment_hint"
392 </com.google.android.material.textfield.TextInputLayout>
394 android:id="@+id/template_is_fallback_label"
395 android:layout_width="0dp"
396 android:layout_height="wrap_content"
397 android:text="@string/template_is_fallback_label"
398 android:textAppearance="?attr/textAppearanceListItem"
399 app:layout_constraintBottom_toTopOf="@+id/template_is_fallback_text"
400 app:layout_constraintEnd_toStartOf="@id/template_is_fallback_switch"
401 app:layout_constraintStart_toStartOf="parent"
402 app:layout_constraintTop_toBottomOf="@id/transaction_comment_layout"
405 android:id="@+id/template_is_fallback_text"
406 android:layout_width="0dp"
407 android:layout_height="wrap_content"
408 android:textAppearance="?attr/textAppearanceListItemSecondary"
409 app:layout_constraintBottom_toBottomOf="parent"
410 app:layout_constraintEnd_toStartOf="@id/template_is_fallback_switch"
411 app:layout_constraintStart_toStartOf="parent"
412 app:layout_constraintTop_toBottomOf="@id/template_is_fallback_label"
414 <com.google.android.material.switchmaterial.SwitchMaterial
415 android:id="@+id/template_is_fallback_switch"
416 android:layout_width="wrap_content"
417 android:layout_height="wrap_content"
418 app:layout_constraintBottom_toBottomOf="@id/template_is_fallback_text"
419 app:layout_constraintEnd_toEndOf="parent"
420 app:layout_constraintTop_toTopOf="@id/template_is_fallback_label"
424 </androidx.constraintlayout.widget.ConstraintLayout>