]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/import_export_bottom_appbar.xml
First wrong button text in View Headers in night theme. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_bottom_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2018-2023 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
7
8   Privacy Browser Android is free software: you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation, either version 3 of the License, or
11   (at your option) any later version.
12
13   Privacy Browser Android is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
20
21 <androidx.coordinatorlayout.widget.CoordinatorLayout
22     android:id="@+id/import_export_coordinatorlayout"
23     xmlns:android="http://schemas.android.com/apk/res/android"
24     xmlns:app="http://schemas.android.com/apk/res-auto"
25     android:layout_height="match_parent"
26     android:layout_width="match_parent" >
27
28     <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. -->
29     <LinearLayout
30         android:layout_height="match_parent"
31         android:layout_width="match_parent"
32         android:orientation="vertical" >
33
34         <ScrollView
35             android:id="@+id/scrollview"
36             android:layout_height="0dp"
37             android:layout_width="match_parent"
38             android:layout_weight="1" >
39
40             <!-- Align the content vertically. -->
41             <LinearLayout
42                 android:layout_height="wrap_content"
43                 android:layout_width="match_parent"
44                 android:orientation="vertical"
45                 android:layout_marginTop="10dp" >
46
47                 <!-- Settings and Bookmarks. -->
48                 <TextView
49                     android:layout_height="wrap_content"
50                     android:layout_width="match_parent"
51                     android:gravity="center_horizontal"
52                     android:text="@string/bookmarks_and_settings"
53                     android:textSize="30sp"
54                     android:textStyle="bold"
55                     android:textColor="?android:textColorPrimary" />
56
57                 <TextView
58                     android:layout_height="wrap_content"
59                     android:layout_width="match_parent"
60                     android:gravity="center_horizontal"
61                     android:layout_marginBottom="10dp"
62                     android:text="@string/sqlite_database_format"
63                     android:textSize="14sp" />
64
65                 <!-- The encryption card. -->
66                 <androidx.cardview.widget.CardView
67                     android:layout_height="wrap_content"
68                     android:layout_width="match_parent"
69                     android:layout_marginStart="10dp"
70                     android:layout_marginEnd="10dp"
71                     android:layout_marginBottom="5dp" >
72
73                     <!-- Align the contents of the card vertically. -->
74                     <LinearLayout
75                         android:layout_height="match_parent"
76                         android:layout_width="match_parent"
77                         android:orientation="vertical"
78                         android:layout_marginTop="10dp"
79                         android:layout_marginBottom="20dp"
80                         android:layout_marginStart="10dp"
81                         android:layout_marginEnd="10dp" >
82
83                         <TextView
84                             android:layout_width="wrap_content"
85                             android:layout_height="wrap_content"
86                             android:layout_gravity="center_horizontal"
87                             android:layout_marginBottom="6dp"
88                             android:text="@string/encryption"
89                             android:textSize="25sp"
90                             android:textStyle="bold"
91                             android:textColor="?colorAccent" />
92
93                         <Spinner
94                             android:id="@+id/encryption_spinner"
95                             android:layout_height="wrap_content"
96                             android:layout_width="wrap_content"
97                             android:layout_gravity="center_horizontal" />
98
99                         <!-- The encryption password. -->
100                         <com.google.android.material.textfield.TextInputLayout
101                             android:id="@+id/encryption_password_textinputlayout"
102                             android:layout_height="wrap_content"
103                             android:layout_width="match_parent"
104                             app:passwordToggleEnabled="true" >
105
106                             <com.google.android.material.textfield.TextInputEditText
107                                 android:id="@+id/encryption_password_edittext"
108                                 android:layout_height="wrap_content"
109                                 android:layout_width="match_parent"
110                                 android:hint="@string/password"
111                                 android:inputType="textPassword"/>
112                         </com.google.android.material.textfield.TextInputLayout>
113
114                         <!-- OpenKeychain required message. -->
115                         <TextView
116                             android:id="@+id/openkeychain_required_textview"
117                             android:layout_height="wrap_content"
118                             android:layout_width="wrap_content"
119                             android:layout_gravity="center_horizontal"
120                             android:layout_marginTop="10dp"
121                             android:text="@string/openkeychain_required"
122                             android:textAlignment="center" />
123                     </LinearLayout>
124                 </androidx.cardview.widget.CardView>
125
126                 <!-- The bookmarks and settings file location card. -->
127                 <androidx.cardview.widget.CardView
128                     android:id="@+id/settings_file_location_cardview"
129                     android:layout_height="wrap_content"
130                     android:layout_width="match_parent"
131                     android:layout_marginTop="5dp"
132                     android:layout_marginBottom="5dp"
133                     android:layout_marginStart="10dp"
134                     android:layout_marginEnd="10dp" >
135
136                     <!-- Align the contents of the card vertically. -->
137                     <LinearLayout
138                         android:layout_height="match_parent"
139                         android:layout_width="match_parent"
140                         android:orientation="vertical"
141                         android:layout_marginTop="10dp"
142                         android:layout_marginBottom="20dp"
143                         android:layout_marginStart="10dp"
144                         android:layout_marginEnd="10dp" >
145
146                         <TextView
147                             android:layout_width="wrap_content"
148                             android:layout_height="wrap_content"
149                             android:layout_gravity="center_horizontal"
150                             android:layout_marginBottom="6dp"
151                             android:text="@string/file_location"
152                             android:textSize="25sp"
153                             android:textStyle="bold"
154                             android:textColor="?colorAccent" />
155
156                         <RadioGroup
157                             android:layout_height="wrap_content"
158                             android:layout_width="wrap_content"
159                             android:layout_gravity="center_horizontal"
160                             android:orientation="horizontal" >
161
162                             <RadioButton
163                                 android:id="@+id/settings_import_radiobutton"
164                                 android:layout_height="wrap_content"
165                                 android:layout_width="wrap_content"
166                                 android:text="@string/import_button"
167                                 android:layout_marginEnd="10dp"
168                                 android:onClick="onClickSettingsRadioButton" />
169
170                             <RadioButton
171                                 android:id="@+id/settings_export_radiobutton"
172                                 android:layout_height="wrap_content"
173                                 android:layout_width="wrap_content"
174                                 android:text="@string/export"
175                                 android:onClick="onClickSettingsRadioButton" />
176                         </RadioGroup>
177
178                         <!-- Align the edit text and the select file button horizontally. -->
179                         <LinearLayout
180                             android:id="@+id/settings_file_name_linearlayout"
181                             android:layout_height="wrap_content"
182                             android:layout_width="match_parent"
183                             android:orientation="horizontal"
184                             android:layout_marginTop="10dp">
185
186                             <!-- The text input layout makes the hint float above the edit text. -->
187                             <com.google.android.material.textfield.TextInputLayout
188                                 android:layout_height="wrap_content"
189                                 android:layout_width="0dp"
190                                 android:layout_weight="1" >
191
192                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
193                                 <com.google.android.material.textfield.TextInputEditText
194                                     android:id="@+id/settings_file_name_edittext"
195                                     android:layout_height="wrap_content"
196                                     android:layout_width="match_parent"
197                                     android:hint="@string/file_name"
198                                     android:inputType="textMultiLine|textUri" />
199                             </com.google.android.material.textfield.TextInputLayout>
200
201                             <Button
202                                 android:id="@+id/settings_browse_button"
203                                 android:layout_height="wrap_content"
204                                 android:layout_width="wrap_content"
205                                 android:layout_gravity="center_vertical"
206                                 android:text="@string/browse"
207                                 android:onClick="settingsBrowse" />
208                         </LinearLayout>
209
210                         <!-- OpenKeychain import instructions -->
211                         <TextView
212                             android:id="@+id/openkeychain_import_instructions_textview"
213                             android:layout_height="wrap_content"
214                             android:layout_width="wrap_content"
215                             android:layout_gravity="center_horizontal"
216                             android:layout_margin="5dp"
217                             android:text="@string/openkeychain_import_instructions"
218                             android:textAlignment="center" />
219
220                         <Button
221                             android:id="@+id/settings_import_export_button"
222                             android:layout_height="wrap_content"
223                             android:layout_width="wrap_content"
224                             android:layout_gravity="center_horizontal"
225                             android:layout_marginTop="10dp"
226                             android:text="@string/import_button"
227                             android:textSize="18sp"
228                             android:onClick="importExportSettings"
229                             app:backgroundTint="@color/button_background_selector"
230                             android:textColor="@color/button_text_selector" />
231                     </LinearLayout>
232                 </androidx.cardview.widget.CardView>
233
234                 <!-- Bookmarks. -->
235                 <TextView
236                     android:layout_height="wrap_content"
237                     android:layout_width="match_parent"
238                     android:gravity="center_horizontal"
239                     android:layout_marginTop="30dp"
240                     android:text="@string/bookmarks"
241                     android:textSize="30sp"
242                     android:textStyle="bold"
243                     android:textColor="?android:textColorPrimary" />
244
245                 <TextView
246                     android:layout_height="wrap_content"
247                     android:layout_width="match_parent"
248                     android:gravity="center_horizontal"
249                     android:layout_marginBottom="10dp"
250                     android:text="@string/html_format"
251                     android:textSize="14sp" />
252
253                 <!-- The bookmarks file location card. -->
254                 <androidx.cardview.widget.CardView
255                     android:layout_height="wrap_content"
256                     android:layout_width="match_parent"
257                     android:layout_marginStart="10dp"
258                     android:layout_marginEnd="10dp"
259                     android:layout_marginBottom="20dp" >
260
261                     <!-- Align the contents of the card vertically. -->
262                     <LinearLayout
263                         android:layout_height="match_parent"
264                         android:layout_width="match_parent"
265                         android:orientation="vertical"
266                         android:layout_marginTop="10dp"
267                         android:layout_marginBottom="20dp"
268                         android:layout_marginStart="10dp"
269                         android:layout_marginEnd="10dp" >
270
271                         <TextView
272                             android:layout_width="wrap_content"
273                             android:layout_height="wrap_content"
274                             android:layout_gravity="center_horizontal"
275                             android:layout_marginBottom="6dp"
276                             android:text="@string/file_location"
277                             android:textSize="25sp"
278                             android:textStyle="bold"
279                             android:textColor="?colorAccent" />
280
281                         <RadioGroup
282                             android:layout_height="wrap_content"
283                             android:layout_width="wrap_content"
284                             android:layout_gravity="center_horizontal"
285                             android:orientation="horizontal" >
286
287                             <RadioButton
288                                 android:id="@+id/bookmarks_import_radiobutton"
289                                 android:layout_height="wrap_content"
290                                 android:layout_width="wrap_content"
291                                 android:text="@string/import_button"
292                                 android:layout_marginEnd="10dp"
293                                 android:onClick="onClickBookmarksRadioButton" />
294
295                             <RadioButton
296                                 android:layout_height="wrap_content"
297                                 android:layout_width="wrap_content"
298                                 android:text="@string/export"
299                                 android:onClick="onClickBookmarksRadioButton" />
300                         </RadioGroup>
301
302                         <!-- Align the edit text and the select file button horizontally. -->
303                         <LinearLayout
304                             android:id="@+id/bookmarks_file_name_linearlayout"
305                             android:layout_height="wrap_content"
306                             android:layout_width="match_parent"
307                             android:orientation="horizontal"
308                             android:layout_marginTop="10dp">
309
310                             <!-- The text input layout makes the hint float above the edit text. -->
311                             <com.google.android.material.textfield.TextInputLayout
312                                 android:layout_height="wrap_content"
313                                 android:layout_width="0dp"
314                                 android:layout_weight="1" >
315
316                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
317                                 <com.google.android.material.textfield.TextInputEditText
318                                     android:id="@+id/bookmarks_file_name_edittext"
319                                     android:layout_height="wrap_content"
320                                     android:layout_width="match_parent"
321                                     android:hint="@string/file_name"
322                                     android:inputType="textMultiLine|textUri" />
323                             </com.google.android.material.textfield.TextInputLayout>
324
325                             <Button
326                                 android:id="@+id/bookmarks_browse_button"
327                                 android:layout_height="wrap_content"
328                                 android:layout_width="wrap_content"
329                                 android:layout_gravity="center_vertical"
330                                 android:text="@string/browse"
331                                 android:onClick="bookmarksBrowse" />
332                         </LinearLayout>
333
334                         <Button
335                             android:id="@+id/bookmarks_import_export_button"
336                             android:layout_height="wrap_content"
337                             android:layout_width="wrap_content"
338                             android:layout_gravity="center_horizontal"
339                             android:layout_marginTop="10dp"
340                             android:text="@string/import_button"
341                             android:textSize="18sp"
342                             android:onClick="importExportBookmarks"
343                             app:backgroundTint="@color/button_background_selector"
344                             android:textColor="@color/button_text_selector" />
345                     </LinearLayout>
346                 </androidx.cardview.widget.CardView>
347             </LinearLayout>
348         </ScrollView>
349
350         <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
351         <com.google.android.material.appbar.AppBarLayout
352             android:id="@+id/import_export_appbarlayout"
353             android:layout_height="wrap_content"
354             android:layout_width="match_parent"
355             android:background="?android:attr/colorBackground"
356             android:theme="@style/PrivacyBrowserAppBar" >
357
358             <androidx.appcompat.widget.Toolbar
359                 android:id="@+id/import_export_toolbar"
360                 android:layout_height="wrap_content"
361                 android:layout_width="match_parent" />
362         </com.google.android.material.appbar.AppBarLayout>
363     </LinearLayout>
364 </androidx.coordinatorlayout.widget.CoordinatorLayout>