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