1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2018-2022 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:layout_height="match_parent"
50 android:layout_width="match_parent" >
52 <!-- Align the cards vertically. -->
54 android:layout_height="wrap_content"
55 android:layout_width="match_parent"
56 android:orientation="vertical" >
58 <!-- The encryption card. -->
59 <androidx.cardview.widget.CardView
60 android:layout_height="wrap_content"
61 android:layout_width="match_parent"
62 android:layout_marginTop="10dp"
63 android:layout_marginBottom="5dp"
64 android:layout_marginStart="10dp"
65 android:layout_marginEnd="10dp" >
67 <!-- Align the contents of the card vertically. -->
69 android:layout_height="match_parent"
70 android:layout_width="match_parent"
71 android:orientation="vertical"
72 android:layout_marginTop="10dp"
73 android:layout_marginBottom="20dp"
74 android:layout_marginStart="10dp"
75 android:layout_marginEnd="10dp" >
78 android:layout_width="wrap_content"
79 android:layout_height="wrap_content"
80 android:layout_gravity="center_horizontal"
81 android:layout_marginBottom="6dp"
82 android:text="@string/encryption"
83 android:textSize="25sp"
84 android:textStyle="bold"
85 android:textColor="?colorAccent" />
88 android:id="@+id/encryption_spinner"
89 android:layout_height="wrap_content"
90 android:layout_width="wrap_content"
91 android:layout_gravity="center_horizontal" />
93 <!-- The encryption password. -->
94 <com.google.android.material.textfield.TextInputLayout
95 android:id="@+id/encryption_password_textinputlayout"
96 android:layout_height="wrap_content"
97 android:layout_width="match_parent"
98 app:passwordToggleEnabled="true" >
100 <com.google.android.material.textfield.TextInputEditText
101 android:id="@+id/encryption_password_edittext"
102 android:layout_height="wrap_content"
103 android:layout_width="match_parent"
104 android:hint="@string/password"
105 android:inputType="textPassword"/>
106 </com.google.android.material.textfield.TextInputLayout>
108 <!-- OpenKeychain required message. -->
110 android:id="@+id/openkeychain_required_textview"
111 android:layout_height="wrap_content"
112 android:layout_width="wrap_content"
113 android:layout_gravity="center_horizontal"
114 android:layout_marginTop="10dp"
115 android:text="@string/openkeychain_required"
116 android:textAlignment="center" />
118 </androidx.cardview.widget.CardView>
120 <!-- The file location card. -->
121 <androidx.cardview.widget.CardView
122 android:id="@+id/file_location_cardview"
123 android:layout_height="wrap_content"
124 android:layout_width="match_parent"
125 android:layout_marginTop="5dp"
126 android:layout_marginBottom="5dp"
127 android:layout_marginStart="10dp"
128 android:layout_marginEnd="10dp" >
130 <!-- Align the contents of the card vertically. -->
132 android:layout_height="match_parent"
133 android:layout_width="match_parent"
134 android:orientation="vertical"
135 android:layout_marginTop="10dp"
136 android:layout_marginBottom="20dp"
137 android:layout_marginStart="10dp"
138 android:layout_marginEnd="10dp" >
141 android:layout_width="wrap_content"
142 android:layout_height="wrap_content"
143 android:layout_gravity="center_horizontal"
144 android:layout_marginBottom="6dp"
145 android:text="@string/file_location"
146 android:textSize="25sp"
147 android:textStyle="bold"
148 android:textColor="?colorAccent" />
151 android:layout_height="wrap_content"
152 android:layout_width="wrap_content"
153 android:layout_gravity="center_horizontal"
154 android:orientation="horizontal" >
157 android:id="@+id/import_radiobutton"
158 android:layout_height="wrap_content"
159 android:layout_width="wrap_content"
160 android:text="@string/import_button"
161 android:layout_marginEnd="10dp"
162 android:onClick="onClickRadioButton" />
165 android:id="@+id/export_radiobutton"
166 android:layout_height="wrap_content"
167 android:layout_width="wrap_content"
168 android:text="@string/export"
169 android:onClick="onClickRadioButton" />
172 <!-- Align the edit text and the select file button horizontally. -->
174 android:id="@+id/file_name_linearlayout"
175 android:layout_height="wrap_content"
176 android:layout_width="match_parent"
177 android:orientation="horizontal"
178 android:layout_marginTop="10dp">
180 <!-- The text input layout makes the hint float above the edit text. -->
181 <com.google.android.material.textfield.TextInputLayout
182 android:layout_height="wrap_content"
183 android:layout_width="0dp"
184 android:layout_weight="1" >
186 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
187 <com.google.android.material.textfield.TextInputEditText
188 android:id="@+id/file_name_edittext"
189 android:layout_height="wrap_content"
190 android:layout_width="match_parent"
191 android:hint="@string/file_name"
192 android:inputType="textMultiLine|textUri" />
193 </com.google.android.material.textfield.TextInputLayout>
196 android:id="@+id/browse_button"
197 android:layout_height="wrap_content"
198 android:layout_width="wrap_content"
199 android:layout_gravity="center_vertical"
200 android:text="@string/browse"
201 android:onClick="browse" />
204 <!-- OpenKeychain import instructions -->
206 android:id="@+id/openkeychain_import_instructions_textview"
207 android:layout_height="wrap_content"
208 android:layout_width="wrap_content"
209 android:layout_gravity="center_horizontal"
210 android:layout_margin="5dp"
211 android:text="@string/openkeychain_import_instructions"
212 android:textAlignment="center" />
215 android:id="@+id/import_export_button"
216 android:layout_height="wrap_content"
217 android:layout_width="wrap_content"
218 android:layout_gravity="center_horizontal"
219 android:layout_marginTop="10dp"
220 android:text="@string/import_button"
221 android:textSize="18sp"
222 android:onClick="importExport"
223 app:backgroundTint="?attr/buttonBackgroundColorSelector"
224 android:textColor="?attr/buttonTextColorSelector" />
226 </androidx.cardview.widget.CardView>
230 </androidx.coordinatorlayout.widget.CoordinatorLayout>