]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/template_details_account.xml
implement swipe-remove and drag-move in template details
[mobile-ledger.git] / app / src / main / res / layout / template_details_account.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_account_row"
21     android:layout_width="match_parent"
22     android:layout_height="wrap_content"
23     android:animateLayoutChanges="true"
24     android:padding="@dimen/text_margin"
25     >
26     <TextView
27         android:id="@+id/pattern_account_label"
28         android:layout_width="0dp"
29         android:layout_height="wrap_content"
30         android:gravity="end"
31         android:text="@string/template_details_account_row_label"
32         android:textAppearance="?attr/textAppearanceListItem"
33         app:drawableBottomCompat="@drawable/dashed_border_8dp"
34         app:drawableStartCompat="@drawable/ic_baseline_drag_handle_24"
35         app:layout_constraintBottom_toTopOf="@id/template_account_name_source_label"
36         app:layout_constraintEnd_toEndOf="parent"
37         app:layout_constraintHorizontal_bias="1.0"
38         app:layout_constraintTop_toTopOf="parent"
39         />
40     <TextView
41         android:id="@+id/template_account_name_source_label"
42         android:layout_width="0dp"
43         android:layout_height="match_parent"
44         android:paddingTop="@dimen/text_margin"
45         android:text="@string/account_name_source_label"
46         android:textAppearance="?attr/textAppearanceListItem"
47         app:layout_constraintBottom_toTopOf="@+id/template_details_account_name_source"
48         app:layout_constraintEnd_toEndOf="parent"
49         app:layout_constraintStart_toStartOf="parent"
50         app:layout_constraintTop_toBottomOf="@id/pattern_account_label"
51         />
52     <TextView
53         android:id="@+id/template_details_account_name_source"
54         android:layout_width="0dp"
55         android:layout_height="wrap_content"
56         android:minWidth="100dp"
57         android:textAppearance="?attr/textAppearanceListItemSecondary"
58         app:layout_constraintBottom_toTopOf="@+id/template_details_account_name_layout"
59         app:layout_constraintEnd_toEndOf="parent"
60         app:layout_constraintStart_toStartOf="parent"
61         app:layout_constraintTop_toBottomOf="@id/template_account_name_source_label"
62         />
63     <com.google.android.material.textfield.TextInputLayout
64         android:id="@+id/template_details_account_name_layout"
65         android:layout_width="match_parent"
66         android:layout_height="wrap_content"
67         android:layout_marginBottom="@dimen/text_margin"
68         android:textAppearance="?attr/textAppearanceListItem"
69         app:endIconMode="clear_text"
70         app:layout_constraintBottom_toTopOf="@+id/template_account_comment_source_label"
71         app:layout_constraintEnd_toEndOf="parent"
72         app:layout_constraintStart_toStartOf="parent"
73         app:layout_constraintTop_toBottomOf="@id/template_details_account_name_source"
74         >
75         <com.google.android.material.textfield.MaterialAutoCompleteTextView
76             android:id="@+id/template_details_account_name"
77             style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
78             android:layout_width="match_parent"
79             android:layout_height="wrap_content"
80             android:hint="@string/template_details_account_name_label"
81             android:inputType="text"
82             />
83     </com.google.android.material.textfield.TextInputLayout>
84
85     <TextView
86         android:id="@+id/template_account_comment_source_label"
87         android:layout_width="0dp"
88         android:layout_height="match_parent"
89         android:text="@string/account_comment_source_label"
90         android:textAppearance="?attr/textAppearanceListItem"
91         app:layout_constraintBottom_toTopOf="@+id/template_details_account_comment_source"
92         app:layout_constraintEnd_toEndOf="parent"
93         app:layout_constraintStart_toStartOf="parent"
94         app:layout_constraintTop_toBottomOf="@id/template_details_account_name_layout"
95         />
96     <TextView
97         android:id="@+id/template_details_account_comment_source"
98         android:layout_width="0dp"
99         android:layout_height="wrap_content"
100         android:minWidth="100dp"
101         android:textAppearance="?attr/textAppearanceListItemSecondary"
102         app:layout_constraintBottom_toTopOf="@+id/template_details_account_comment_layout"
103         app:layout_constraintEnd_toEndOf="parent"
104         app:layout_constraintStart_toStartOf="parent"
105         app:layout_constraintTop_toBottomOf="@id/template_account_comment_source_label"
106         />
107     <com.google.android.material.textfield.TextInputLayout
108         android:id="@+id/template_details_account_comment_layout"
109         android:layout_width="match_parent"
110         android:layout_height="wrap_content"
111         android:layout_marginBottom="@dimen/text_margin"
112         android:textAppearance="?attr/textAppearanceListItem"
113         app:endIconMode="clear_text"
114         app:layout_constraintBottom_toTopOf="@+id/template_account_amount_source_label"
115         app:layout_constraintEnd_toEndOf="parent"
116         app:layout_constraintStart_toStartOf="parent"
117         app:layout_constraintTop_toBottomOf="@id/template_details_account_comment_source"
118         >
119         <com.google.android.material.textfield.TextInputEditText
120             android:id="@+id/template_details_account_comment"
121             android:layout_width="match_parent"
122             android:layout_height="wrap_content"
123             android:hint="@string/template_details_account_comment_label"
124             android:inputType="text"
125             />
126     </com.google.android.material.textfield.TextInputLayout>
127
128     <TextView
129         android:id="@+id/template_account_amount_source_label"
130         android:layout_width="0dp"
131         android:layout_height="match_parent"
132         android:text="@string/account_amount_source_label"
133         android:textAppearance="?attr/textAppearanceListItem"
134         app:layout_constraintBottom_toTopOf="@+id/template_details_account_amount_source"
135         app:layout_constraintEnd_toStartOf="@id/negate_amount_switch"
136         app:layout_constraintStart_toStartOf="parent"
137         app:layout_constraintTop_toBottomOf="@id/template_details_account_comment_layout"
138         />
139     <TextView
140         android:id="@+id/template_details_account_amount_source"
141         android:layout_width="0dp"
142         android:layout_height="wrap_content"
143         android:textAppearance="?attr/textAppearanceListItemSecondary"
144         app:layout_constraintBottom_toTopOf="@+id/template_details_account_amount_layout"
145         app:layout_constraintEnd_toStartOf="@id/negate_amount_switch"
146         app:layout_constraintStart_toStartOf="parent"
147         app:layout_constraintTop_toBottomOf="@id/template_account_amount_source_label"
148         />
149     <com.google.android.material.textfield.TextInputLayout
150         android:id="@+id/template_details_account_amount_layout"
151         android:layout_width="match_parent"
152         android:layout_height="wrap_content"
153         android:layout_marginBottom="@dimen/text_margin"
154         android:textAppearance="?attr/textAppearanceListItem"
155         app:layout_constraintBottom_toTopOf="@id/template_details_negate_amount_label"
156         app:layout_constraintEnd_toEndOf="parent"
157         app:layout_constraintStart_toStartOf="parent"
158         app:layout_constraintTop_toBottomOf="@id/template_details_account_amount_source"
159         >
160         <com.google.android.material.textfield.TextInputEditText
161             android:id="@+id/template_details_account_amount"
162             android:layout_width="match_parent"
163             android:layout_height="wrap_content"
164             android:hint="@string/template_details_account_amount_label"
165             android:inputType="number|numberDecimal|numberSigned"
166             android:selectAllOnFocus="true"
167             />
168     </com.google.android.material.textfield.TextInputLayout>
169     <TextView
170         android:id="@+id/template_details_negate_amount_label"
171         android:layout_width="0dp"
172         android:layout_height="wrap_content"
173         android:layout_marginTop="@dimen/text_margin"
174         android:text="@string/template_account_negate_amount_label"
175         android:textAppearance="?attr/textAppearanceListItem"
176         app:layout_constraintBottom_toTopOf="@id/template_details_negate_amount_text"
177         app:layout_constraintEnd_toStartOf="@+id/negate_amount_switch"
178         app:layout_constraintStart_toStartOf="parent"
179         app:layout_constraintTop_toBottomOf="@id/template_details_account_amount_layout"
180         />
181     <TextView
182         android:id="@+id/template_details_negate_amount_text"
183         android:layout_width="0dp"
184         android:layout_height="wrap_content"
185         android:text="@string/template_account_keep_amount_sign"
186         android:textAppearance="?attr/textAppearanceListItemSecondary"
187         app:layout_constraintBottom_toBottomOf="parent"
188         app:layout_constraintBottom_toTopOf="@id/template_details_negate_amount_text"
189         app:layout_constraintEnd_toStartOf="@+id/negate_amount_switch"
190         app:layout_constraintStart_toStartOf="parent"
191         app:layout_constraintTop_toBottomOf="@id/template_details_negate_amount_label"
192         />
193     <com.google.android.material.switchmaterial.SwitchMaterial
194         android:id="@+id/negate_amount_switch"
195         android:layout_width="wrap_content"
196         android:layout_height="wrap_content"
197         app:layout_constraintBottom_toBottomOf="@id/template_details_negate_amount_text"
198         app:layout_constraintEnd_toEndOf="parent"
199         app:layout_constraintTop_toTopOf="@id/template_details_negate_amount_label"
200         />
201
202 </androidx.constraintlayout.widget.ConstraintLayout>