1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2018-2020 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
8 Privacy Browser 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 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. 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 <com.google.android.material.appbar.AppBarLayout
35 android:id="@+id/import_export_appbarlayout"
36 android:layout_height="wrap_content"
37 android:layout_width="match_parent"
38 android:background="?android:attr/colorBackground" >
40 <androidx.appcompat.widget.Toolbar
41 android:id="@+id/import_export_toolbar"
42 android:layout_height="wrap_content"
43 android:layout_width="match_parent" />
44 </com.google.android.material.appbar.AppBarLayout>
47 android:layout_height="match_parent"
48 android:layout_width="match_parent" >
50 <!-- Align the cards vertically. -->
52 android:layout_height="wrap_content"
53 android:layout_width="match_parent"
54 android:orientation="vertical" >
56 <!-- The encryption card. -->
57 <androidx.cardview.widget.CardView
58 android:layout_height="wrap_content"
59 android:layout_width="match_parent"
60 android:layout_marginTop="10dp"
61 android:layout_marginBottom="5dp"
62 android:layout_marginStart="10dp"
63 android:layout_marginEnd="10dp" >
65 <!-- Align the contents of the card vertically. -->
67 android:layout_height="match_parent"
68 android:layout_width="match_parent"
69 android:orientation="vertical"
70 android:layout_marginTop="10dp"
71 android:layout_marginBottom="20dp"
72 android:layout_marginStart="10dp"
73 android:layout_marginEnd="10dp" >
76 android:layout_width="wrap_content"
77 android:layout_height="wrap_content"
78 android:layout_gravity="center_horizontal"
79 android:layout_marginBottom="6dp"
80 android:text="@string/encryption"
81 android:textSize="25sp"
82 android:textStyle="bold"
83 android:textColor="?colorAccent" />
86 android:id="@+id/encryption_spinner"
87 android:layout_height="wrap_content"
88 android:layout_width="wrap_content"
89 android:layout_gravity="center_horizontal" />
91 <!-- The encryption password. -->
92 <com.google.android.material.textfield.TextInputLayout
93 android:id="@+id/password_encryption_textinputlayout"
94 android:layout_height="wrap_content"
95 android:layout_width="match_parent"
96 app:passwordToggleEnabled="true" >
98 <com.google.android.material.textfield.TextInputEditText
99 android:id="@+id/password_encryption_edittext"
100 android:layout_height="wrap_content"
101 android:layout_width="match_parent"
102 android:hint="@string/password"
103 android:inputType="textPassword"/>
104 </com.google.android.material.textfield.TextInputLayout>
106 <!-- KitKat password encryption message. -->
108 android:id="@+id/kitkat_password_encryption_textview"
109 android:layout_height="wrap_content"
110 android:layout_width="wrap_content"
111 android:layout_gravity="center_horizontal"
112 android:layout_marginTop="10dp"
113 android:text="@string/kitkat_password_encryption_message"
114 android:textAlignment="center" />
116 <!-- OpenKeychain required message. -->
118 android:id="@+id/openkeychain_required_textview"
119 android:layout_height="wrap_content"
120 android:layout_width="wrap_content"
121 android:layout_gravity="center_horizontal"
122 android:layout_marginTop="10dp"
123 android:text="@string/openkeychain_required"
124 android:textAlignment="center" />
126 </androidx.cardview.widget.CardView>
128 <!-- The file location card. -->
129 <androidx.cardview.widget.CardView
130 android:id="@+id/file_location_cardview"
131 android:layout_height="wrap_content"
132 android:layout_width="match_parent"
133 android:layout_marginTop="5dp"
134 android:layout_marginBottom="5dp"
135 android:layout_marginStart="10dp"
136 android:layout_marginEnd="10dp" >
138 <!-- Align the contents of the card vertically. -->
140 android:layout_height="match_parent"
141 android:layout_width="match_parent"
142 android:orientation="vertical"
143 android:layout_marginTop="10dp"
144 android:layout_marginBottom="20dp"
145 android:layout_marginStart="10dp"
146 android:layout_marginEnd="10dp" >
149 android:layout_width="wrap_content"
150 android:layout_height="wrap_content"
151 android:layout_gravity="center_horizontal"
152 android:layout_marginBottom="6dp"
153 android:text="@string/file_location"
154 android:textSize="25sp"
155 android:textStyle="bold"
156 android:textColor="?colorAccent" />
159 android:layout_height="wrap_content"
160 android:layout_width="wrap_content"
161 android:layout_gravity="center_horizontal"
162 android:orientation="horizontal" >
165 android:id="@+id/import_radiobutton"
166 android:layout_height="wrap_content"
167 android:layout_width="wrap_content"
168 android:text="@string/import_button"
169 android:layout_marginEnd="10dp"
170 android:onClick="onClickRadioButton" />
173 android:id="@+id/export_radiobutton"
174 android:layout_height="wrap_content"
175 android:layout_width="wrap_content"
176 android:text="@string/export"
177 android:onClick="onClickRadioButton" />
180 <!-- Align the edit text and the select file button horizontally. -->
182 android:id="@+id/file_name_linearlayout"
183 android:layout_height="wrap_content"
184 android:layout_width="match_parent"
185 android:orientation="horizontal"
186 android:layout_marginTop="10dp">
188 <!-- The text input layout makes the hint float above the edit text. -->
189 <com.google.android.material.textfield.TextInputLayout
190 android:layout_height="wrap_content"
191 android:layout_width="0dp"
192 android:layout_weight="1" >
194 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
195 <com.google.android.material.textfield.TextInputEditText
196 android:id="@+id/file_name_edittext"
197 android:layout_height="wrap_content"
198 android:layout_width="match_parent"
199 android:hint="@string/file_name"
200 android:inputType="textMultiLine|textUri" />
201 </com.google.android.material.textfield.TextInputLayout>
204 android:id="@+id/browse_button"
205 android:layout_height="wrap_content"
206 android:layout_width="wrap_content"
207 android:layout_gravity="center_vertical"
208 android:text="@string/browse"
209 android:onClick="browse" />
212 <!-- File notices. -->
214 android:id="@+id/file_does_not_exist_textview"
215 android:layout_height="wrap_content"
216 android:layout_width="wrap_content"
217 android:layout_gravity="center_horizontal"
218 android:layout_margin="5dp"
219 android:text="@string/file_does_not_exist"
220 android:textColor="?attr/redTextColor"
221 android:textAlignment="center" />
224 android:id="@+id/file_exists_warning_textview"
225 android:layout_height="wrap_content"
226 android:layout_width="wrap_content"
227 android:layout_gravity="center_horizontal"
228 android:layout_margin="5dp"
229 android:text="@string/file_exists_warning"
230 android:textColor="?attr/redTextColor"
231 android:textAlignment="center" />
233 <!-- OpenKeychain import instructions -->
235 android:id="@+id/openkeychain_import_instructions_textview"
236 android:layout_height="wrap_content"
237 android:layout_width="wrap_content"
238 android:layout_gravity="center_horizontal"
239 android:layout_margin="5dp"
240 android:text="@string/openkeychain_import_instructions"
241 android:textAlignment="center" />
244 android:id="@+id/import_export_button"
245 android:layout_height="wrap_content"
246 android:layout_width="wrap_content"
247 android:layout_gravity="center_horizontal"
248 android:layout_marginTop="10dp"
249 android:text="@string/import_button"
250 android:textSize="18sp"
251 android:onClick="importExport"
252 app:backgroundTint="?attr/buttonBackgroundColorSelector"
253 android:textColor="?attr/buttonTextColorSelector" />
255 </androidx.cardview.widget.CardView>
258 android:id="@+id/import_export_storage_permission_textview"
259 android:layout_width="wrap_content"
260 android:layout_height="wrap_content"
261 android:layout_gravity="center_horizontal"
262 android:layout_marginBottom="10dp"
263 android:layout_marginStart="15dp"
264 android:layout_marginEnd="15dp"
265 android:text="@string/storage_permission_explanation"
266 android:textAlignment="center" />
270 </androidx.coordinatorlayout.widget.CoordinatorLayout>