]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/profile_detail.xml
d2ca5601a89705eb5322bd25b5f0d4da281bc195
[mobile-ledger.git] / app / src / main / res / layout / profile_detail.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2020 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 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19     xmlns:app="http://schemas.android.com/apk/res-auto"
20     xmlns:tools="http://schemas.android.com/tools"
21     android:id="@+id/profile_detail"
22     style="?android:attr/textAppearanceLarge"
23     android:layout_width="match_parent"
24     android:layout_height="match_parent"
25     android:orientation="vertical"
26     android:padding="16dp"
27     tools:context=".ui.profiles.ProfileDetailFragment">
28
29     <com.google.android.material.textfield.TextInputLayout
30         android:id="@+id/profile_name_layout"
31         android:layout_width="match_parent"
32         android:layout_height="wrap_content"
33         android:layout_marginBottom="16dp">
34
35         <com.google.android.material.textfield.TextInputEditText
36             android:id="@+id/profile_name"
37             android:layout_width="match_parent"
38             android:layout_height="wrap_content"
39             android:hint="@string/profile_name_label"
40             android:inputType="textPersonName" />
41     </com.google.android.material.textfield.TextInputLayout>
42
43     <com.google.android.material.textfield.TextInputLayout
44         android:id="@+id/url_layout"
45         android:layout_width="match_parent"
46         android:layout_height="wrap_content"
47         android:layout_marginBottom="16dp"
48         android:orientation="vertical">
49
50         <com.google.android.material.textfield.TextInputEditText
51             android:id="@+id/url"
52             android:layout_width="match_parent"
53             android:layout_height="wrap_content"
54             android:hint="@string/url_label"
55             android:inputType="textUri"
56             android:text="@string/pref_default_backend_url" />
57     </com.google.android.material.textfield.TextInputLayout>
58
59     <LinearLayout
60         android:layout_width="match_parent"
61         android:layout_height="wrap_content"
62         android:animateLayoutChanges="true"
63         android:orientation="vertical">
64
65         <Switch
66             android:id="@+id/enable_http_auth"
67             android:layout_width="match_parent"
68             android:layout_height="wrap_content"
69             android:layout_marginBottom="16dp"
70             android:text="@string/pref_title_use_http_auth"
71             android:textAppearance="?android:textAppearanceListItem" />
72
73         <LinearLayout
74             android:id="@+id/auth_params"
75             android:layout_width="match_parent"
76             android:layout_height="wrap_content"
77             android:layout_marginBottom="16dp"
78             android:animateLayoutChanges="true"
79             android:orientation="vertical"
80             android:paddingStart="8dp"
81             tools:ignore="RtlSymmetry">
82
83             <LinearLayout
84                 android:id="@+id/insecure_scheme_text"
85                 android:layout_width="match_parent"
86                 android:layout_height="wrap_content"
87                 android:layout_marginBottom="@dimen/activity_vertical_margin"
88                 android:background="?colorError"
89                 android:padding="@dimen/activity_vertical_margin"
90                 android:visibility="gone">
91
92                 <TextView
93                     android:layout_width="match_parent"
94                     android:layout_height="wrap_content"
95                     android:textColor="?colorOnError"
96                     android:text="@string/insecure_scheme_with_auth" />
97             </LinearLayout>
98
99             <com.google.android.material.textfield.TextInputLayout
100                 android:id="@+id/auth_user_name_layout"
101                 android:layout_width="match_parent"
102                 android:layout_height="wrap_content"
103                 android:layout_marginBottom="16dp"
104                 android:orientation="vertical">
105
106                 <com.google.android.material.textfield.TextInputEditText
107                     android:id="@+id/auth_user_name"
108                     android:layout_width="match_parent"
109                     android:layout_height="wrap_content"
110                     android:hint="@string/pref_title_backend_auth_user"
111                     android:inputType="textPersonName" />
112             </com.google.android.material.textfield.TextInputLayout>
113
114             <com.google.android.material.textfield.TextInputLayout
115                 android:id="@+id/password_layout"
116                 android:layout_width="match_parent"
117                 android:layout_height="wrap_content"
118                 android:orientation="vertical"
119                 app:passwordToggleEnabled="true">
120
121                 <com.google.android.material.textfield.TextInputEditText
122                     android:id="@+id/password"
123                     android:layout_width="match_parent"
124                     android:layout_height="wrap_content"
125                     android:hint="@string/pref_title_backend_auth_password"
126                     android:inputType="textWebPassword" />
127
128             </com.google.android.material.textfield.TextInputLayout>
129
130         </LinearLayout>
131
132         <androidx.constraintlayout.widget.ConstraintLayout
133             android:id="@+id/api_version_layout"
134             android:layout_width="match_parent"
135             android:layout_height="wrap_content"
136             android:layout_marginBottom="16dp">
137
138             <TextView
139                 android:id="@+id/api_version_label"
140                 android:layout_width="match_parent"
141                 android:layout_height="wrap_content"
142                 android:text="@string/profile_api_version_title"
143                 android:textAppearance="?android:textAppearanceListItem"
144                 app:layout_constraintTop_toTopOf="parent"
145                 />
146
147             <TextView
148                 android:id="@+id/api_version_text"
149                 android:layout_width="0dp"
150                 android:layout_height="wrap_content"
151                 android:textAppearance="?android:textAppearanceListItemSecondary"
152                 android:textColor="?attr/textColor"
153                 app:layout_constraintEnd_toStartOf="@id/detected_version_text"
154                 app:layout_constraintStart_toStartOf="parent"
155                 app:layout_constraintTop_toBottomOf="@id/api_version_label"
156                 />
157             <TextView
158                 android:id="@+id/detected_version_label"
159                 android:layout_width="0dp"
160                 android:layout_height="wrap_content"
161                 android:layout_marginEnd="8dp"
162                 android:gravity="end"
163                 android:text="@string/detected_version_label"
164                 android:textAppearance="?android:textAppearanceListItemSecondary"
165                 app:layout_constraintEnd_toStartOf="@id/detected_version_text"
166                 app:layout_constraintStart_toStartOf="parent"
167                 app:layout_constraintTop_toBottomOf="@id/api_version_text"
168                 />
169             <TextView
170                 android:id="@+id/detected_version_text"
171                 android:layout_width="wrap_content"
172                 android:layout_height="wrap_content"
173                 android:layout_marginEnd="8dp"
174                 android:text="@string/api_version_unknown_label"
175                 android:textAppearance="?android:textAppearanceListItemSecondary"
176                 android:textColor="?attr/textColor"
177                 app:layout_constraintEnd_toStartOf="@id/api_version_detect_button"
178                 app:layout_constraintTop_toBottomOf="@id/api_version_text"
179                 />
180             <TextView
181                 android:id="@+id/api_version_detect_button"
182                 android:layout_width="24dp"
183                 android:layout_height="0dp"
184                 android:drawableBottom="@drawable/ic_refresh_primary_24dp"
185                 android:foregroundGravity="bottom"
186                 app:layout_constraintBottom_toBottomOf="parent"
187                 app:layout_constraintEnd_toEndOf="parent"
188                 app:layout_constraintTop_toBottomOf="@id/api_version_label"
189                 />
190         </androidx.constraintlayout.widget.ConstraintLayout>
191
192         <Switch
193             android:id="@+id/profile_permit_posting"
194             android:layout_width="match_parent"
195             android:layout_height="wrap_content"
196             android:layout_marginBottom="16dp"
197             android:text="@string/posting_permitted"
198             android:textAppearance="?android:textAppearanceListItem" />
199
200         <LinearLayout
201             android:id="@+id/posting_sub_items"
202             android:layout_width="match_parent"
203             android:layout_height="wrap_content"
204             android:orientation="vertical">
205
206             <LinearLayout
207                 android:id="@+id/default_commodity_layout"
208                 android:layout_width="match_parent"
209                 android:layout_height="wrap_content"
210                 android:layout_marginBottom="16dp"
211                 android:clickable="true"
212                 android:focusable="true"
213                 android:orientation="vertical">
214
215                 <TextView
216                     android:layout_width="match_parent"
217                     android:layout_height="wrap_content"
218                     android:text="@string/profile_default_commodity"
219                     android:textAppearance="?android:textAppearanceListItem" />
220
221                 <TextView
222                     android:id="@+id/default_commodity_text"
223                     android:layout_width="match_parent"
224                     android:layout_height="wrap_content"
225                     android:text="@string/btn_no_currency"
226                     android:textAppearance="?android:textAppearanceListItemSecondary"
227                     android:textColor="?attr/textColor" />
228             </LinearLayout>
229
230             <Switch
231                 android:id="@+id/profile_show_commodity"
232                 android:layout_width="match_parent"
233                 android:layout_height="wrap_content"
234                 android:layout_marginBottom="16dp"
235                 android:text="@string/currency_input_by_default"
236                 android:textAppearance="?android:textAppearanceListItem" />
237
238             <Switch
239                 android:id="@+id/profile_show_comments"
240                 android:layout_width="match_parent"
241                 android:layout_height="wrap_content"
242                 android:layout_marginBottom="16dp"
243                 android:text="@string/show_comment_input_by_default"
244                 android:textAppearance="?android:textAppearanceListItem" />
245
246             <LinearLayout
247                 android:id="@+id/future_dates_layout"
248                 android:layout_width="match_parent"
249                 android:layout_height="wrap_content"
250                 android:layout_marginBottom="16dp"
251                 android:orientation="vertical">
252
253                 <TextView
254                     android:id="@+id/future_dates_title"
255                     android:layout_width="match_parent"
256                     android:layout_height="wrap_content"
257                     android:text="@string/profile_future_dates_label"
258                     android:textAppearance="?android:textAppearanceListItem" />
259
260                 <TextView
261                     android:id="@+id/future_dates_text"
262                     android:layout_width="match_parent"
263                     android:layout_height="wrap_content"
264                     android:textAppearance="?android:textAppearanceListItemSecondary"
265                     android:textColor="?attr/textColor" />
266             </LinearLayout>
267
268             <com.google.android.material.textfield.TextInputLayout
269                 android:id="@+id/preferred_accounts_accounts_filter_layout"
270                 android:layout_width="match_parent"
271                 android:layout_height="wrap_content"
272                 android:layout_marginBottom="16dp"
273                 android:orientation="vertical">
274
275                 <com.google.android.material.textfield.TextInputEditText
276                     android:id="@+id/preferred_accounts_filter_filter"
277                     android:layout_width="match_parent"
278                     android:layout_height="wrap_content"
279                     android:fontFamily="monospace"
280                     android:hint="@string/pref_preferred_autocompletion_account_filter_hint"
281                     android:inputType="text"
282                     android:textColor="?attr/editTextColor" />
283             </com.google.android.material.textfield.TextInputLayout>
284         </LinearLayout>
285
286         <LinearLayout
287             android:layout_width="match_parent"
288             android:layout_height="match_parent"
289             android:orientation="horizontal">
290
291             <TextView
292                 android:layout_width="wrap_content"
293                 android:layout_height="match_parent"
294                 android:layout_weight="100"
295                 android:gravity="center_vertical"
296                 android:text="@string/profile_color_label"
297                 android:textAppearance="?android:textAppearanceListItem" />
298
299             <ImageButton
300                 android:id="@+id/btn_pick_ring_color"
301                 android:layout_width="@dimen/thumb_row_height"
302                 android:layout_height="@dimen/thumb_row_height"
303                 android:layout_weight="1"
304                 android:background="?colorPrimary"
305                 android:contentDescription="@string/btn_color_picker_button"
306                 app:srcCompat="@drawable/ic_palette_black_24dp"
307                 android:tint="?colorOnPrimarySurface"
308                 />
309
310         </LinearLayout>
311
312     </LinearLayout>
313 </LinearLayout>