1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright 2018-2023 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
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.
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.
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/>. -->
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" >
28 <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
30 android:layout_height="match_parent"
31 android:layout_width="match_parent"
32 android:orientation="vertical" >
34 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
35 <com.google.android.material.appbar.AppBarLayout
36 android:id="@+id/import_export_appbarlayout"
37 android:layout_height="wrap_content"
38 android:layout_width="match_parent"
39 android:background="?android:attr/colorBackground"
40 android:theme="@style/PrivacyBrowserAppBar" >
42 <androidx.appcompat.widget.Toolbar
43 android:id="@+id/import_export_toolbar"
44 android:layout_height="wrap_content"
45 android:layout_width="match_parent" />
46 </com.google.android.material.appbar.AppBarLayout>
49 android:id="@+id/scrollview"
50 android:layout_height="match_parent"
51 android:layout_width="match_parent" >
53 <!-- Align the content vertically. -->
55 android:layout_height="wrap_content"
56 android:layout_width="match_parent"
57 android:orientation="vertical"
58 android:layout_marginTop="10dp" >
60 <!-- Settings and Bookmarks. -->
62 android:layout_height="wrap_content"
63 android:layout_width="match_parent"
64 android:gravity="center_horizontal"
65 android:text="@string/bookmarks_and_settings"
66 android:textSize="30sp"
67 android:textStyle="bold"
68 android:textColor="?android:textColorPrimary" />
71 android:layout_height="wrap_content"
72 android:layout_width="match_parent"
73 android:gravity="center_horizontal"
74 android:layout_marginBottom="10dp"
75 android:text="@string/sqlite_database_format"
76 android:textSize="14sp" />
78 <!-- The encryption card. -->
79 <androidx.cardview.widget.CardView
80 android:layout_height="wrap_content"
81 android:layout_width="match_parent"
82 android:layout_marginStart="10dp"
83 android:layout_marginEnd="10dp"
84 android:layout_marginBottom="5dp" >
86 <!-- Align the contents of the card vertically. -->
88 android:layout_height="match_parent"
89 android:layout_width="match_parent"
90 android:orientation="vertical"
91 android:layout_marginTop="10dp"
92 android:layout_marginBottom="20dp"
93 android:layout_marginStart="10dp"
94 android:layout_marginEnd="10dp" >
97 android:layout_width="wrap_content"
98 android:layout_height="wrap_content"
99 android:layout_gravity="center_horizontal"
100 android:layout_marginBottom="6dp"
101 android:text="@string/encryption"
102 android:textSize="25sp"
103 android:textStyle="bold"
104 android:textColor="?colorAccent" />
107 android:id="@+id/encryption_spinner"
108 android:layout_height="wrap_content"
109 android:layout_width="wrap_content"
110 android:layout_gravity="center_horizontal" />
112 <!-- The encryption password. -->
113 <com.google.android.material.textfield.TextInputLayout
114 android:id="@+id/encryption_password_textinputlayout"
115 android:layout_height="wrap_content"
116 android:layout_width="match_parent"
117 app:passwordToggleEnabled="true" >
119 <com.google.android.material.textfield.TextInputEditText
120 android:id="@+id/encryption_password_edittext"
121 android:layout_height="wrap_content"
122 android:layout_width="match_parent"
123 android:hint="@string/password"
124 android:inputType="textPassword"/>
125 </com.google.android.material.textfield.TextInputLayout>
127 <!-- OpenKeychain required message. -->
129 android:id="@+id/openkeychain_required_textview"
130 android:layout_height="wrap_content"
131 android:layout_width="wrap_content"
132 android:layout_gravity="center_horizontal"
133 android:layout_marginTop="10dp"
134 android:text="@string/openkeychain_required"
135 android:textAlignment="center" />
137 </androidx.cardview.widget.CardView>
139 <!-- The bookmarks and settings file location card. -->
140 <androidx.cardview.widget.CardView
141 android:id="@+id/settings_file_location_cardview"
142 android:layout_height="wrap_content"
143 android:layout_width="match_parent"
144 android:layout_marginTop="5dp"
145 android:layout_marginBottom="5dp"
146 android:layout_marginStart="10dp"
147 android:layout_marginEnd="10dp" >
149 <!-- Align the contents of the card vertically. -->
151 android:layout_height="match_parent"
152 android:layout_width="match_parent"
153 android:orientation="vertical"
154 android:layout_marginTop="10dp"
155 android:layout_marginBottom="20dp"
156 android:layout_marginStart="10dp"
157 android:layout_marginEnd="10dp" >
160 android:layout_width="wrap_content"
161 android:layout_height="wrap_content"
162 android:layout_gravity="center_horizontal"
163 android:layout_marginBottom="6dp"
164 android:text="@string/file_location"
165 android:textSize="25sp"
166 android:textStyle="bold"
167 android:textColor="?colorAccent" />
170 android:layout_height="wrap_content"
171 android:layout_width="wrap_content"
172 android:layout_gravity="center_horizontal"
173 android:orientation="horizontal" >
176 android:id="@+id/settings_import_radiobutton"
177 android:layout_height="wrap_content"
178 android:layout_width="wrap_content"
179 android:text="@string/import_button"
180 android:layout_marginEnd="10dp"
181 android:onClick="onClickSettingsRadioButton" />
184 android:id="@+id/settings_export_radiobutton"
185 android:layout_height="wrap_content"
186 android:layout_width="wrap_content"
187 android:text="@string/export"
188 android:onClick="onClickSettingsRadioButton" />
191 <!-- Align the edit text and the select file button horizontally. -->
193 android:id="@+id/settings_file_name_linearlayout"
194 android:layout_height="wrap_content"
195 android:layout_width="match_parent"
196 android:orientation="horizontal"
197 android:layout_marginTop="10dp">
199 <!-- The text input layout makes the hint float above the edit text. -->
200 <com.google.android.material.textfield.TextInputLayout
201 android:layout_height="wrap_content"
202 android:layout_width="0dp"
203 android:layout_weight="1" >
205 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
206 <com.google.android.material.textfield.TextInputEditText
207 android:id="@+id/settings_file_name_edittext"
208 android:layout_height="wrap_content"
209 android:layout_width="match_parent"
210 android:hint="@string/file_name"
211 android:inputType="textMultiLine|textUri" />
212 </com.google.android.material.textfield.TextInputLayout>
215 android:id="@+id/settings_browse_button"
216 android:layout_height="wrap_content"
217 android:layout_width="wrap_content"
218 android:layout_gravity="center_vertical"
219 android:text="@string/browse"
220 android:onClick="settingsBrowse" />
223 <!-- OpenKeychain import instructions -->
225 android:id="@+id/openkeychain_import_instructions_textview"
226 android:layout_height="wrap_content"
227 android:layout_width="wrap_content"
228 android:layout_gravity="center_horizontal"
229 android:layout_margin="5dp"
230 android:text="@string/openkeychain_import_instructions"
231 android:textAlignment="center" />
234 android:id="@+id/settings_import_export_button"
235 android:layout_height="wrap_content"
236 android:layout_width="wrap_content"
237 android:layout_gravity="center_horizontal"
238 android:layout_marginTop="10dp"
239 android:text="@string/import_button"
240 android:textSize="18sp"
241 android:onClick="importExportSettings"
242 app:backgroundTint="@color/button_background_selector"
243 android:textColor="@color/button_text_selector" />
245 </androidx.cardview.widget.CardView>
249 android:layout_height="wrap_content"
250 android:layout_width="match_parent"
251 android:gravity="center_horizontal"
252 android:layout_marginTop="30dp"
253 android:text="@string/bookmarks"
254 android:textSize="30sp"
255 android:textStyle="bold"
256 android:textColor="?android:textColorPrimary" />
259 android:layout_height="wrap_content"
260 android:layout_width="match_parent"
261 android:gravity="center_horizontal"
262 android:layout_marginBottom="10dp"
263 android:text="@string/html_format"
264 android:textSize="14sp" />
266 <!-- The bookmarks file location card. -->
267 <androidx.cardview.widget.CardView
268 android:layout_height="wrap_content"
269 android:layout_width="match_parent"
270 android:layout_marginStart="10dp"
271 android:layout_marginEnd="10dp"
272 android:layout_marginBottom="20dp" >
274 <!-- Align the contents of the card vertically. -->
276 android:layout_height="match_parent"
277 android:layout_width="match_parent"
278 android:orientation="vertical"
279 android:layout_marginTop="10dp"
280 android:layout_marginBottom="20dp"
281 android:layout_marginStart="10dp"
282 android:layout_marginEnd="10dp" >
285 android:layout_width="wrap_content"
286 android:layout_height="wrap_content"
287 android:layout_gravity="center_horizontal"
288 android:layout_marginBottom="6dp"
289 android:text="@string/file_location"
290 android:textSize="25sp"
291 android:textStyle="bold"
292 android:textColor="?colorAccent" />
295 android:layout_height="wrap_content"
296 android:layout_width="wrap_content"
297 android:layout_gravity="center_horizontal"
298 android:orientation="horizontal" >
301 android:id="@+id/bookmarks_import_radiobutton"
302 android:layout_height="wrap_content"
303 android:layout_width="wrap_content"
304 android:text="@string/import_button"
305 android:layout_marginEnd="10dp"
306 android:onClick="onClickBookmarksRadioButton" />
309 android:layout_height="wrap_content"
310 android:layout_width="wrap_content"
311 android:text="@string/export"
312 android:onClick="onClickBookmarksRadioButton" />
315 <!-- Align the edit text and the select file button horizontally. -->
317 android:id="@+id/bookmarks_file_name_linearlayout"
318 android:layout_height="wrap_content"
319 android:layout_width="match_parent"
320 android:orientation="horizontal"
321 android:layout_marginTop="10dp">
323 <!-- The text input layout makes the hint float above the edit text. -->
324 <com.google.android.material.textfield.TextInputLayout
325 android:layout_height="wrap_content"
326 android:layout_width="0dp"
327 android:layout_weight="1" >
329 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
330 <com.google.android.material.textfield.TextInputEditText
331 android:id="@+id/bookmarks_file_name_edittext"
332 android:layout_height="wrap_content"
333 android:layout_width="match_parent"
334 android:hint="@string/file_name"
335 android:inputType="textMultiLine|textUri" />
336 </com.google.android.material.textfield.TextInputLayout>
339 android:id="@+id/bookmarks_browse_button"
340 android:layout_height="wrap_content"
341 android:layout_width="wrap_content"
342 android:layout_gravity="center_vertical"
343 android:text="@string/browse"
344 android:onClick="bookmarksBrowse" />
348 android:id="@+id/bookmarks_import_export_button"
349 android:layout_height="wrap_content"
350 android:layout_width="wrap_content"
351 android:layout_gravity="center_horizontal"
352 android:layout_marginTop="10dp"
353 android:text="@string/import_button"
354 android:textSize="18sp"
355 android:onClick="importExportBookmarks"
356 app:backgroundTint="@color/button_background_selector"
357 android:textColor="@color/button_text_selector" />
359 </androidx.cardview.widget.CardView>
363 </androidx.coordinatorlayout.widget.CoordinatorLayout>