1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2018-2019 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 <!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar.
22 When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
23 <androidx.coordinatorlayout.widget.CoordinatorLayout
24 android:id="@+id/import_export_coordinatorlayout"
25 xmlns:android="http://schemas.android.com/apk/res/android"
26 xmlns:app="http://schemas.android.com/apk/res-auto"
27 android:layout_height="match_parent"
28 android:layout_width="match_parent"
29 android:fitsSystemWindows="true" >
31 <!-- the `LinearLayout` with `orientation="vertical"` moves the content below the `AppBarLayout`. -->
33 android:layout_height="match_parent"
34 android:layout_width="match_parent"
35 android:orientation="vertical" >
37 <com.google.android.material.appbar.AppBarLayout
38 android:id="@+id/import_export_appbarlayout"
39 android:layout_height="wrap_content"
40 android:layout_width="match_parent" >
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 android:background="?attr/colorPrimaryDark"
47 android:theme="?attr/appBarTextTheme"
48 app:popupTheme="?attr/popupsTheme" />
49 </com.google.android.material.appbar.AppBarLayout>
52 android:layout_height="match_parent"
53 android:layout_width="match_parent" >
55 <!-- Align the cards vertically. -->
57 android:layout_height="wrap_content"
58 android:layout_width="match_parent"
59 android:orientation="vertical" >
61 <!-- The encryption card. -->
62 <androidx.cardview.widget.CardView
63 android:layout_height="wrap_content"
64 android:layout_width="match_parent"
65 android:layout_marginTop="10dp"
66 android:layout_marginBottom="5dp"
67 android:layout_marginStart="10dp"
68 android:layout_marginEnd="10dp" >
70 <!-- Align the contents of the card vertically. -->
72 android:layout_height="match_parent"
73 android:layout_width="match_parent"
74 android:orientation="vertical"
75 android:layout_marginTop="10dp"
76 android:layout_marginBottom="20dp"
77 android:layout_marginStart="10dp"
78 android:layout_marginEnd="10dp" >
81 android:layout_width="wrap_content"
82 android:layout_height="wrap_content"
83 android:layout_gravity="center_horizontal"
84 android:layout_marginBottom="6dp"
85 android:text="@string/encryption"
86 android:textSize="25sp"
87 android:textStyle="bold"
88 android:textColor="?colorAccent" />
91 android:id="@+id/encryption_spinner"
92 android:layout_height="wrap_content"
93 android:layout_width="wrap_content"
94 android:layout_gravity="center_horizontal" />
96 <!-- The encryption password. -->
97 <com.google.android.material.textfield.TextInputLayout
98 android:id="@+id/password_encryption_textinputlayout"
99 android:layout_height="wrap_content"
100 android:layout_width="match_parent"
101 app:passwordToggleEnabled="true" >
103 <com.google.android.material.textfield.TextInputEditText
104 android:id="@+id/password_encryption_edittext"
105 android:layout_height="wrap_content"
106 android:layout_width="match_parent"
107 android:hint="@string/password"
108 android:inputType="textPassword"/>
109 </com.google.android.material.textfield.TextInputLayout>
111 <!-- KitKat password encryption message. -->
113 android:id="@+id/kitkat_password_encryption_textview"
114 android:layout_height="wrap_content"
115 android:layout_width="wrap_content"
116 android:layout_gravity="center_horizontal"
117 android:layout_marginTop="10dp"
118 android:text="@string/kitkat_password_encryption_message"
119 android:textColor="?android:textColorPrimary"
120 android:textAlignment="center" />
122 <!-- OpenKeychain required message. -->
124 android:id="@+id/openkeychain_required_textview"
125 android:layout_height="wrap_content"
126 android:layout_width="wrap_content"
127 android:layout_gravity="center_horizontal"
128 android:layout_marginTop="10dp"
129 android:text="@string/openkeychain_required"
130 android:textColor="?android:textColorPrimary"
131 android:textAlignment="center" />
133 </androidx.cardview.widget.CardView>
135 <!-- The file location card. -->
136 <androidx.cardview.widget.CardView
137 android:id="@+id/file_location_cardview"
138 android:layout_height="wrap_content"
139 android:layout_width="match_parent"
140 android:layout_marginTop="5dp"
141 android:layout_marginBottom="5dp"
142 android:layout_marginStart="10dp"
143 android:layout_marginEnd="10dp" >
145 <!-- Align the contents of the card vertically. -->
147 android:layout_height="match_parent"
148 android:layout_width="match_parent"
149 android:orientation="vertical"
150 android:layout_marginTop="10dp"
151 android:layout_marginBottom="20dp"
152 android:layout_marginStart="10dp"
153 android:layout_marginEnd="10dp" >
156 android:layout_width="wrap_content"
157 android:layout_height="wrap_content"
158 android:layout_gravity="center_horizontal"
159 android:layout_marginBottom="6dp"
160 android:text="@string/file_location"
161 android:textSize="25sp"
162 android:textStyle="bold"
163 android:textColor="?colorAccent" />
166 android:layout_height="wrap_content"
167 android:layout_width="wrap_content"
168 android:layout_gravity="center_horizontal"
169 android:orientation="horizontal" >
172 android:id="@+id/import_radiobutton"
173 android:layout_height="wrap_content"
174 android:layout_width="wrap_content"
175 android:text="@string/import_button"
176 android:layout_marginEnd="10dp"
177 android:onClick="onClickRadioButton" />
180 android:id="@+id/export_radiobutton"
181 android:layout_height="wrap_content"
182 android:layout_width="wrap_content"
183 android:text="@string/export"
184 android:onClick="onClickRadioButton" />
187 <!-- Align the EditText and the select file button horizontally. -->
189 android:id="@+id/file_name_linearlayout"
190 android:layout_height="wrap_content"
191 android:layout_width="match_parent"
192 android:orientation="horizontal"
193 android:layout_marginTop="10dp">
195 <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
196 <com.google.android.material.textfield.TextInputLayout
197 android:layout_height="wrap_content"
198 android:layout_width="0dp"
199 android:layout_weight="1" >
201 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
202 <com.google.android.material.textfield.TextInputEditText
203 android:id="@+id/file_name_edittext"
204 android:layout_height="wrap_content"
205 android:layout_width="match_parent"
206 android:hint="@string/file_name"
207 android:inputType="textMultiLine|textUri" />
208 </com.google.android.material.textfield.TextInputLayout>
211 android:id="@+id/browse_button"
212 android:layout_height="wrap_content"
213 android:layout_width="wrap_content"
214 android:layout_gravity="center_vertical"
215 android:text="@string/browse"
216 android:onClick="browse" />
219 <!-- OpenKeychain import instructions -->
221 android:id="@+id/openkeychain_import_instructions_textview"
222 android:layout_height="wrap_content"
223 android:layout_width="wrap_content"
224 android:layout_gravity="center_horizontal"
225 android:layout_margin="5dp"
226 android:text="@string/openkeychain_import_instructions"
227 android:textColor="?android:textColorPrimary"
228 android:textAlignment="center" />
231 android:id="@+id/import_export_button"
232 android:layout_height="wrap_content"
233 android:layout_width="wrap_content"
234 android:layout_gravity="center_horizontal"
235 android:layout_marginTop="10dp"
236 android:text="@string/import_button"
237 android:textSize="18sp"
238 android:onClick="importExport"
239 app:backgroundTint="?attr/buttonBackgroundColorSelector"
240 android:textColor="?attr/buttonTextColorSelector" />
242 </androidx.cardview.widget.CardView>
245 android:id="@+id/import_export_storage_permission_textview"
246 android:layout_width="wrap_content"
247 android:layout_height="wrap_content"
248 android:layout_gravity="center_horizontal"
249 android:layout_marginBottom="10dp"
250 android:layout_marginStart="15dp"
251 android:layout_marginEnd="15dp"
252 android:text="@string/storage_permission_explanation"
253 android:textColor="?android:textColorPrimary"
254 android:textAlignment="center" />
258 </androidx.coordinatorlayout.widget.CoordinatorLayout>