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_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_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_params_label"
35 app:layout_constraintEnd_toEndOf="parent"
36 app:layout_constraintTop_toTopOf="@id/template_params_label"
39 android:id="@+id/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_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_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="wrap_content"
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/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/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/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/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/year_source"
177 app:layout_constraintEnd_toStartOf="@id/month_source_label"
178 app:layout_constraintStart_toStartOf="parent"
179 app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
182 android:id="@+id/month_source_label"
183 android:layout_width="0dp"
184 android:layout_height="wrap_content"
185 android:text="@string/month_source_label"
186 android:textAlignment="center"
187 android:textAppearance="@android:style/TextAppearance.Material.Body1"
188 app:layout_constraintBottom_toTopOf="@+id/month_source"
189 app:layout_constraintEnd_toStartOf="@id/day_source_label"
190 app:layout_constraintStart_toEndOf="@id/year_source_label"
191 app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
194 android:id="@+id/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/day_source"
201 app:layout_constraintEnd_toEndOf="parent"
202 app:layout_constraintStart_toEndOf="@id/month_source_label"
203 app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
206 android:id="@+id/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 android:layout_marginHorizontal="@dimen/half_text_margin"
213 app:layout_constraintBottom_toTopOf="@+id/year_layout"
214 app:layout_constraintEnd_toStartOf="@id/month_source"
215 app:layout_constraintStart_toStartOf="parent"
216 app:layout_constraintTop_toBottomOf="@id/day_source_label"
219 android:id="@+id/month_source"
220 android:layout_width="0dp"
221 android:layout_height="wrap_content"
222 android:layout_marginHorizontal="@dimen/half_text_margin"
223 android:text="@string/template_details_source_literal"
224 android:textAlignment="center"
225 android:textAppearance="?attr/textAppearanceListItemSecondary"
226 app:layout_constraintBottom_toTopOf="@+id/month_layout"
227 app:layout_constraintEnd_toStartOf="@id/day_source"
228 app:layout_constraintStart_toEndOf="@id/year_source"
229 app:layout_constraintTop_toBottomOf="@id/month_source_label"
232 android:id="@+id/day_source"
233 android:layout_width="0dp"
234 android:layout_height="wrap_content"
235 android:layout_marginHorizontal="@dimen/half_text_margin"
236 android:text="@string/template_details_source_literal"
237 android:textAlignment="center"
238 android:textAppearance="?attr/textAppearanceListItemSecondary"
239 app:layout_constraintBottom_toTopOf="@+id/day_layout"
240 app:layout_constraintEnd_toEndOf="parent"
241 app:layout_constraintStart_toEndOf="@id/month_source"
242 app:layout_constraintTop_toBottomOf="@id/day_source_label"
244 <androidx.constraintlayout.widget.Barrier
245 android:id="@+id/barrier_before_date_inputs"
246 android:layout_width="match_parent"
247 android:layout_height="wrap_content"
248 app:barrierDirection="bottom"
249 app:constraint_referenced_ids="year_source,month_source,day_source"
251 <com.google.android.material.textfield.TextInputLayout
252 android:id="@+id/year_layout"
253 android:layout_width="0dp"
254 android:layout_height="wrap_content"
255 app:layout_constraintEnd_toStartOf="@+id/month_layout"
256 app:layout_constraintStart_toStartOf="parent"
257 app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
259 <com.google.android.material.textfield.TextInputEditText
260 android:id="@+id/template_details_date_year"
261 android:layout_width="match_parent"
262 android:layout_height="wrap_content"
263 android:gravity="center_horizontal"
264 android:hint="@string/date_year_hint"
265 android:inputType="number"
267 </com.google.android.material.textfield.TextInputLayout>
268 <com.google.android.material.textfield.TextInputLayout
269 android:id="@+id/month_layout"
270 android:layout_width="0dp"
271 android:layout_height="wrap_content"
272 app:layout_constraintEnd_toStartOf="@+id/day_layout"
273 app:layout_constraintStart_toEndOf="@id/year_layout"
274 app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
276 <com.google.android.material.textfield.TextInputEditText
277 android:id="@+id/template_details_date_month"
278 android:layout_width="match_parent"
279 android:layout_height="wrap_content"
280 android:gravity="center_horizontal"
281 android:hint="@string/date_month_hint"
282 android:inputType="number"
284 </com.google.android.material.textfield.TextInputLayout>
285 <com.google.android.material.textfield.TextInputLayout
286 android:id="@+id/day_layout"
287 android:layout_width="0dp"
288 android:layout_height="wrap_content"
289 android:layout_marginBottom="@dimen/text_margin"
290 app:layout_constraintEnd_toEndOf="parent"
291 app:layout_constraintStart_toEndOf="@id/month_layout"
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="day_layout,month_layout,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:layout_marginTop="@dimen/text_margin"
318 android:text="@string/transaction_description_source_label"
319 android:textAppearance="?attr/textAppearanceListItem"
320 app:layout_constraintBottom_toTopOf="@+id/template_transaction_description_source"
321 app:layout_constraintEnd_toEndOf="parent"
322 app:layout_constraintStart_toStartOf="parent"
323 app:layout_constraintTop_toBottomOf="@id/barrier_before_description"
326 android:id="@+id/template_transaction_description_source"
327 android:layout_width="0dp"
328 android:layout_height="wrap_content"
329 android:minWidth="100dp"
330 android:textAppearance="?attr/textAppearanceListItemSecondary"
331 android:text="@string/template_details_source_literal"
332 app:layout_constraintBottom_toTopOf="@+id/transaction_description_layout"
333 app:layout_constraintEnd_toEndOf="parent"
334 app:layout_constraintStart_toStartOf="parent"
335 app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source_label"
337 <com.google.android.material.textfield.TextInputLayout
338 android:id="@+id/transaction_description_layout"
339 android:layout_width="match_parent"
340 android:layout_height="wrap_content"
341 android:layout_marginBottom="@dimen/text_margin"
342 app:endIconMode="clear_text"
343 app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source_label"
344 app:layout_constraintEnd_toEndOf="parent"
345 app:layout_constraintStart_toStartOf="parent"
346 app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source"
348 <com.google.android.material.textfield.TextInputEditText
349 android:id="@+id/transaction_description"
350 android:layout_width="match_parent"
351 android:layout_height="wrap_content"
352 android:hint="@string/template_transaction_description_hint"
354 </com.google.android.material.textfield.TextInputLayout>
356 android:id="@+id/template_transaction_comment_source_label"
357 android:layout_width="0dp"
358 android:layout_height="match_parent"
359 android:text="@string/transaction_comment_source_label"
360 android:textAppearance="?attr/textAppearanceListItem"
361 app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source"
362 app:layout_constraintEnd_toEndOf="parent"
363 app:layout_constraintStart_toStartOf="parent"
364 app:layout_constraintTop_toBottomOf="@id/transaction_description_layout"
367 android:id="@+id/template_transaction_comment_source"
368 android:layout_width="0dp"
369 android:layout_height="wrap_content"
370 android:minWidth="100dp"
371 android:textAppearance="?attr/textAppearanceListItemSecondary"
372 android:text="@string/template_details_source_literal"
373 app:layout_constraintBottom_toTopOf="@+id/transaction_comment_layout"
374 app:layout_constraintEnd_toEndOf="parent"
375 app:layout_constraintStart_toStartOf="parent"
376 app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source_label"
378 <com.google.android.material.textfield.TextInputLayout
379 android:id="@+id/transaction_comment_layout"
380 android:layout_width="match_parent"
381 android:layout_height="wrap_content"
382 android:layout_marginBottom="@dimen/text_margin"
383 app:endIconMode="clear_text"
384 app:layout_constraintBottom_toTopOf="@id/template_is_fallback_label"
385 app:layout_constraintEnd_toEndOf="parent"
386 app:layout_constraintStart_toStartOf="parent"
387 app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source"
389 <com.google.android.material.textfield.TextInputEditText
390 android:id="@+id/transaction_comment"
391 android:layout_width="match_parent"
392 android:layout_height="wrap_content"
393 android:hint="@string/template_transaction_comment_hint"
395 </com.google.android.material.textfield.TextInputLayout>
397 android:id="@+id/template_is_fallback_label"
398 android:layout_width="0dp"
399 android:layout_height="wrap_content"
400 android:text="@string/template_is_fallback_label"
401 android:textAppearance="?attr/textAppearanceListItem"
402 app:layout_constraintBottom_toTopOf="@+id/template_is_fallback_text"
403 app:layout_constraintEnd_toStartOf="@id/template_is_fallback_switch"
404 app:layout_constraintStart_toStartOf="parent"
405 app:layout_constraintTop_toBottomOf="@id/transaction_comment_layout"
408 android:id="@+id/template_is_fallback_text"
409 android:layout_width="0dp"
410 android:layout_height="wrap_content"
411 android:textAppearance="?attr/textAppearanceListItemSecondary"
412 android:text="@string/template_is_fallback_no"
413 app:layout_constraintBottom_toBottomOf="parent"
414 app:layout_constraintEnd_toStartOf="@id/template_is_fallback_switch"
415 app:layout_constraintStart_toStartOf="parent"
416 app:layout_constraintTop_toBottomOf="@id/template_is_fallback_label"
418 <com.google.android.material.switchmaterial.SwitchMaterial
419 android:id="@+id/template_is_fallback_switch"
420 android:layout_width="wrap_content"
421 android:layout_height="wrap_content"
422 app:layout_constraintBottom_toBottomOf="@id/template_is_fallback_text"
423 app:layout_constraintEnd_toEndOf="parent"
424 app:layout_constraintTop_toTopOf="@id/template_is_fallback_label"
428 </androidx.constraintlayout.widget.ConstraintLayout>