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"` 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 <!-- OpenKeychain required message. -->
98 android:id="@+id/openkeychain_required_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/openkeychain_required"
104 android:textAlignment="center" />
106 </androidx.cardview.widget.CardView>
108 <!-- The file location card. -->
109 <androidx.cardview.widget.CardView
110 android:id="@+id/file_location_cardview"
111 android:layout_height="wrap_content"
112 android:layout_width="match_parent"
113 android:layout_marginTop="5dp"
114 android:layout_marginBottom="5dp"
115 android:layout_marginStart="10dp"
116 android:layout_marginEnd="10dp" >
118 <!-- Align the contents of the card vertically. -->
120 android:layout_height="match_parent"
121 android:layout_width="match_parent"
122 android:orientation="vertical"
123 android:layout_marginTop="10dp"
124 android:layout_marginBottom="20dp"
125 android:layout_marginStart="10dp"
126 android:layout_marginEnd="10dp" >
129 android:layout_width="wrap_content"
130 android:layout_height="wrap_content"
131 android:layout_gravity="center_horizontal"
132 android:layout_marginBottom="6dp"
133 android:text="@string/file_location"
134 android:textSize="25sp"
135 android:textStyle="bold"
136 android:textColor="?colorAccent" />
139 android:layout_height="wrap_content"
140 android:layout_width="wrap_content"
141 android:layout_gravity="center_horizontal"
142 android:orientation="horizontal" >
145 android:id="@+id/import_radiobutton"
146 android:layout_height="wrap_content"
147 android:layout_width="wrap_content"
148 android:text="@string/import_button"
149 android:layout_marginEnd="10dp"
150 android:onClick="onClickRadioButton" />
153 android:id="@+id/export_radiobutton"
154 android:layout_height="wrap_content"
155 android:layout_width="wrap_content"
156 android:text="@string/export"
157 android:onClick="onClickRadioButton" />
160 <!-- Align the edit text and the select file button horizontally. -->
162 android:id="@+id/file_name_linearlayout"
163 android:layout_height="wrap_content"
164 android:layout_width="match_parent"
165 android:orientation="horizontal"
166 android:layout_marginTop="10dp">
168 <!-- The text input layout makes the hint float above the edit text. -->
169 <com.google.android.material.textfield.TextInputLayout
170 android:layout_height="wrap_content"
171 android:layout_width="0dp"
172 android:layout_weight="1" >
174 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
175 <com.google.android.material.textfield.TextInputEditText
176 android:id="@+id/file_name_edittext"
177 android:layout_height="wrap_content"
178 android:layout_width="match_parent"
179 android:hint="@string/file_name"
180 android:inputType="textMultiLine|textUri" />
181 </com.google.android.material.textfield.TextInputLayout>
184 android:id="@+id/browse_button"
185 android:layout_height="wrap_content"
186 android:layout_width="wrap_content"
187 android:layout_gravity="center_vertical"
188 android:text="@string/browse"
189 android:onClick="browse" />
192 <!-- OpenKeychain import instructions -->
194 android:id="@+id/openkeychain_import_instructions_textview"
195 android:layout_height="wrap_content"
196 android:layout_width="wrap_content"
197 android:layout_gravity="center_horizontal"
198 android:layout_margin="5dp"
199 android:text="@string/openkeychain_import_instructions"
200 android:textAlignment="center" />
203 android:id="@+id/import_export_button"
204 android:layout_height="wrap_content"
205 android:layout_width="wrap_content"
206 android:layout_gravity="center_horizontal"
207 android:layout_marginTop="10dp"
208 android:text="@string/import_button"
209 android:textSize="18sp"
210 android:onClick="importExport"
211 app:backgroundTint="@color/button_background_selector"
212 android:textColor="@color/button_text_selector" />
214 </androidx.cardview.widget.CardView>
218 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
219 <com.google.android.material.appbar.AppBarLayout
220 android:id="@+id/import_export_appbarlayout"
221 android:layout_height="wrap_content"
222 android:layout_width="match_parent"
223 android:background="?android:attr/colorBackground"
224 android:theme="@style/PrivacyBrowserAppBar" >
226 <androidx.appcompat.widget.Toolbar
227 android:id="@+id/import_export_toolbar"
228 android:layout_height="wrap_content"
229 android:layout_width="match_parent" />
230 </com.google.android.material.appbar.AppBarLayout>
232 </androidx.coordinatorlayout.widget.CoordinatorLayout>