1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2018-2021 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"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars.-->
30 android:layout_height="match_parent"
31 android:layout_width="match_parent"
32 android:orientation="vertical"
33 app:layout_dodgeInsetEdges="bottom" >
36 android:layout_height="0dp"
37 android:layout_width="match_parent"
38 android:layout_weight="1" >
40 <!-- Align the cards vertically. -->
42 android:layout_height="wrap_content"
43 android:layout_width="match_parent"
44 android:orientation="vertical" >
46 <!-- The encryption card. -->
47 <androidx.cardview.widget.CardView
48 android:layout_height="wrap_content"
49 android:layout_width="match_parent"
50 android:layout_marginTop="10dp"
51 android:layout_marginBottom="5dp"
52 android:layout_marginStart="10dp"
53 android:layout_marginEnd="10dp" >
55 <!-- Align the contents of the card vertically. -->
57 android:layout_height="match_parent"
58 android:layout_width="match_parent"
59 android:orientation="vertical"
60 android:layout_marginTop="10dp"
61 android:layout_marginBottom="20dp"
62 android:layout_marginStart="10dp"
63 android:layout_marginEnd="10dp" >
66 android:layout_width="wrap_content"
67 android:layout_height="wrap_content"
68 android:layout_gravity="center_horizontal"
69 android:layout_marginBottom="6dp"
70 android:text="@string/encryption"
71 android:textSize="25sp"
72 android:textStyle="bold"
73 android:textColor="?colorAccent" />
76 android:id="@+id/encryption_spinner"
77 android:layout_height="wrap_content"
78 android:layout_width="wrap_content"
79 android:layout_gravity="center_horizontal" />
81 <!-- The encryption password. -->
82 <com.google.android.material.textfield.TextInputLayout
83 android:id="@+id/encryption_password_textinputlayout"
84 android:layout_height="wrap_content"
85 android:layout_width="match_parent"
86 app:passwordToggleEnabled="true" >
88 <com.google.android.material.textfield.TextInputEditText
89 android:id="@+id/encryption_password_edittext"
90 android:layout_height="wrap_content"
91 android:layout_width="match_parent"
92 android:hint="@string/password"
93 android:inputType="textPassword"/>
94 </com.google.android.material.textfield.TextInputLayout>
96 <!-- KitKat password encryption message. -->
98 android:id="@+id/kitkat_password_encryption_textview"
99 android:layout_height="wrap_content"
100 android:layout_width="wrap_content"
101 android:layout_gravity="center_horizontal"
102 android:layout_marginTop="10dp"
103 android:text="@string/kitkat_password_encryption_message"
104 android:textAlignment="center" />
106 <!-- OpenKeychain required message. -->
108 android:id="@+id/openkeychain_required_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/openkeychain_required"
114 android:textAlignment="center" />
116 </androidx.cardview.widget.CardView>
118 <!-- The file location card. -->
119 <androidx.cardview.widget.CardView
120 android:id="@+id/file_location_cardview"
121 android:layout_height="wrap_content"
122 android:layout_width="match_parent"
123 android:layout_marginTop="5dp"
124 android:layout_marginBottom="5dp"
125 android:layout_marginStart="10dp"
126 android:layout_marginEnd="10dp" >
128 <!-- Align the contents of the card vertically. -->
130 android:layout_height="match_parent"
131 android:layout_width="match_parent"
132 android:orientation="vertical"
133 android:layout_marginTop="10dp"
134 android:layout_marginBottom="20dp"
135 android:layout_marginStart="10dp"
136 android:layout_marginEnd="10dp" >
139 android:layout_width="wrap_content"
140 android:layout_height="wrap_content"
141 android:layout_gravity="center_horizontal"
142 android:layout_marginBottom="6dp"
143 android:text="@string/file_location"
144 android:textSize="25sp"
145 android:textStyle="bold"
146 android:textColor="?colorAccent" />
149 android:layout_height="wrap_content"
150 android:layout_width="wrap_content"
151 android:layout_gravity="center_horizontal"
152 android:orientation="horizontal" >
155 android:id="@+id/import_radiobutton"
156 android:layout_height="wrap_content"
157 android:layout_width="wrap_content"
158 android:text="@string/import_button"
159 android:layout_marginEnd="10dp"
160 android:onClick="onClickRadioButton" />
163 android:id="@+id/export_radiobutton"
164 android:layout_height="wrap_content"
165 android:layout_width="wrap_content"
166 android:text="@string/export"
167 android:onClick="onClickRadioButton" />
170 <!-- Align the edit text and the select file button horizontally. -->
172 android:id="@+id/file_name_linearlayout"
173 android:layout_height="wrap_content"
174 android:layout_width="match_parent"
175 android:orientation="horizontal"
176 android:layout_marginTop="10dp">
178 <!-- The text input layout makes the hint float above the edit text. -->
179 <com.google.android.material.textfield.TextInputLayout
180 android:layout_height="wrap_content"
181 android:layout_width="0dp"
182 android:layout_weight="1" >
184 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
185 <com.google.android.material.textfield.TextInputEditText
186 android:id="@+id/file_name_edittext"
187 android:layout_height="wrap_content"
188 android:layout_width="match_parent"
189 android:hint="@string/file_name"
190 android:inputType="textMultiLine|textUri" />
191 </com.google.android.material.textfield.TextInputLayout>
194 android:id="@+id/browse_button"
195 android:layout_height="wrap_content"
196 android:layout_width="wrap_content"
197 android:layout_gravity="center_vertical"
198 android:text="@string/browse"
199 android:onClick="browse" />
202 <!-- OpenKeychain import instructions -->
204 android:id="@+id/openkeychain_import_instructions_textview"
205 android:layout_height="wrap_content"
206 android:layout_width="wrap_content"
207 android:layout_gravity="center_horizontal"
208 android:layout_margin="5dp"
209 android:text="@string/openkeychain_import_instructions"
210 android:textAlignment="center" />
213 android:id="@+id/import_export_button"
214 android:layout_height="wrap_content"
215 android:layout_width="wrap_content"
216 android:layout_gravity="center_horizontal"
217 android:layout_marginTop="10dp"
218 android:text="@string/import_button"
219 android:textSize="18sp"
220 android:onClick="importExport"
221 app:backgroundTint="?attr/buttonBackgroundColorSelector"
222 android:textColor="?attr/buttonTextColorSelector" />
224 </androidx.cardview.widget.CardView>
228 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
229 <com.google.android.material.appbar.AppBarLayout
230 android:id="@+id/import_export_appbarlayout"
231 android:layout_height="wrap_content"
232 android:layout_width="match_parent"
233 android:background="?android:attr/colorBackground"
234 android:theme="@style/PrivacyBrowserAppBar" >
236 <androidx.appcompat.widget.Toolbar
237 android:id="@+id/import_export_toolbar"
238 android:layout_height="wrap_content"
239 android:layout_width="match_parent" />
240 </com.google.android.material.appbar.AppBarLayout>
242 </androidx.coordinatorlayout.widget.CoordinatorLayout>