]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/import_export_coordinatorlayout.xml
Fix problems with audio still playing after a tab is closed. https://redmine.stoutne...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_coordinatorlayout.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2018-2020 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
7
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.
12
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.
17
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/>. -->
20
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" >
27
28     <!-- the linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
29     <LinearLayout
30         android:layout_height="match_parent"
31         android:layout_width="match_parent"
32         android:orientation="vertical" >
33
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" >
41
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>
47
48         <ScrollView
49             android:layout_height="match_parent"
50             android:layout_width="match_parent" >
51
52             <!-- Align the cards vertically. -->
53             <LinearLayout
54                 android:layout_height="wrap_content"
55                 android:layout_width="match_parent"
56                 android:orientation="vertical" >
57
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" >
66
67                     <!-- Align the contents of the card vertically. -->
68                     <LinearLayout
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" >
76
77                         <TextView
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" />
86
87                         <Spinner
88                             android:id="@+id/encryption_spinner"
89                             android:layout_height="wrap_content"
90                             android:layout_width="wrap_content"
91                             android:layout_gravity="center_horizontal" />
92
93                         <!-- The encryption password. -->
94                         <com.google.android.material.textfield.TextInputLayout
95                             android:id="@+id/password_encryption_textinputlayout"
96                             android:layout_height="wrap_content"
97                             android:layout_width="match_parent"
98                             app:passwordToggleEnabled="true" >
99
100                             <com.google.android.material.textfield.TextInputEditText
101                                 android:id="@+id/password_encryption_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>
107
108                         <!-- KitKat password encryption message. -->
109                         <TextView
110                             android:id="@+id/kitkat_password_encryption_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/kitkat_password_encryption_message"
116                             android:textAlignment="center" />
117
118                         <!-- OpenKeychain required message. -->
119                         <TextView
120                             android:id="@+id/openkeychain_required_textview"
121                             android:layout_height="wrap_content"
122                             android:layout_width="wrap_content"
123                             android:layout_gravity="center_horizontal"
124                             android:layout_marginTop="10dp"
125                             android:text="@string/openkeychain_required"
126                             android:textAlignment="center" />
127                     </LinearLayout>
128                 </androidx.cardview.widget.CardView>
129
130                 <!-- The file location card. -->
131                 <androidx.cardview.widget.CardView
132                     android:id="@+id/file_location_cardview"
133                     android:layout_height="wrap_content"
134                     android:layout_width="match_parent"
135                     android:layout_marginTop="5dp"
136                     android:layout_marginBottom="5dp"
137                     android:layout_marginStart="10dp"
138                     android:layout_marginEnd="10dp" >
139
140                     <!-- Align the contents of the card vertically. -->
141                     <LinearLayout
142                         android:layout_height="match_parent"
143                         android:layout_width="match_parent"
144                         android:orientation="vertical"
145                         android:layout_marginTop="10dp"
146                         android:layout_marginBottom="20dp"
147                         android:layout_marginStart="10dp"
148                         android:layout_marginEnd="10dp" >
149
150                         <TextView
151                             android:layout_width="wrap_content"
152                             android:layout_height="wrap_content"
153                             android:layout_gravity="center_horizontal"
154                             android:layout_marginBottom="6dp"
155                             android:text="@string/file_location"
156                             android:textSize="25sp"
157                             android:textStyle="bold"
158                             android:textColor="?colorAccent" />
159
160                         <RadioGroup
161                             android:layout_height="wrap_content"
162                             android:layout_width="wrap_content"
163                             android:layout_gravity="center_horizontal"
164                             android:orientation="horizontal" >
165
166                             <RadioButton
167                                 android:id="@+id/import_radiobutton"
168                                 android:layout_height="wrap_content"
169                                 android:layout_width="wrap_content"
170                                 android:text="@string/import_button"
171                                 android:layout_marginEnd="10dp"
172                                 android:onClick="onClickRadioButton" />
173
174                             <RadioButton
175                                 android:id="@+id/export_radiobutton"
176                                 android:layout_height="wrap_content"
177                                 android:layout_width="wrap_content"
178                                 android:text="@string/export"
179                                 android:onClick="onClickRadioButton" />
180                         </RadioGroup>
181
182                         <!-- Align the edit text and the select file button horizontally. -->
183                         <LinearLayout
184                             android:id="@+id/file_name_linearlayout"
185                             android:layout_height="wrap_content"
186                             android:layout_width="match_parent"
187                             android:orientation="horizontal"
188                             android:layout_marginTop="10dp">
189
190                             <!-- The text input layout makes the hint float above the edit text. -->
191                             <com.google.android.material.textfield.TextInputLayout
192                                 android:layout_height="wrap_content"
193                                 android:layout_width="0dp"
194                                 android:layout_weight="1" >
195
196                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
197                                 <com.google.android.material.textfield.TextInputEditText
198                                     android:id="@+id/file_name_edittext"
199                                     android:layout_height="wrap_content"
200                                     android:layout_width="match_parent"
201                                     android:hint="@string/file_name"
202                                     android:inputType="textMultiLine|textUri" />
203                             </com.google.android.material.textfield.TextInputLayout>
204
205                             <Button
206                                 android:id="@+id/browse_button"
207                                 android:layout_height="wrap_content"
208                                 android:layout_width="wrap_content"
209                                 android:layout_gravity="center_vertical"
210                                 android:text="@string/browse"
211                                 android:onClick="browse" />
212                         </LinearLayout>
213
214                         <!-- File notices. -->
215                         <TextView
216                             android:id="@+id/file_does_not_exist_textview"
217                             android:layout_height="wrap_content"
218                             android:layout_width="wrap_content"
219                             android:layout_gravity="center_horizontal"
220                             android:layout_margin="5dp"
221                             android:text="@string/file_does_not_exist"
222                             android:textColor="?attr/redTextColor"
223                             android:textAlignment="center" />
224
225                         <TextView
226                             android:id="@+id/file_exists_warning_textview"
227                             android:layout_height="wrap_content"
228                             android:layout_width="wrap_content"
229                             android:layout_gravity="center_horizontal"
230                             android:layout_margin="5dp"
231                             android:text="@string/file_exists_warning"
232                             android:textColor="?attr/redTextColor"
233                             android:textAlignment="center" />
234
235                         <!-- OpenKeychain import instructions -->
236                         <TextView
237                             android:id="@+id/openkeychain_import_instructions_textview"
238                             android:layout_height="wrap_content"
239                             android:layout_width="wrap_content"
240                             android:layout_gravity="center_horizontal"
241                             android:layout_margin="5dp"
242                             android:text="@string/openkeychain_import_instructions"
243                             android:textAlignment="center" />
244
245                         <Button
246                             android:id="@+id/import_export_button"
247                             android:layout_height="wrap_content"
248                             android:layout_width="wrap_content"
249                             android:layout_gravity="center_horizontal"
250                             android:layout_marginTop="10dp"
251                             android:text="@string/import_button"
252                             android:textSize="18sp"
253                             android:onClick="importExport"
254                             app:backgroundTint="?attr/buttonBackgroundColorSelector"
255                             android:textColor="?attr/buttonTextColorSelector" />
256                     </LinearLayout>
257                 </androidx.cardview.widget.CardView>
258
259                 <TextView
260                     android:id="@+id/import_export_storage_permission_textview"
261                     android:layout_width="wrap_content"
262                     android:layout_height="wrap_content"
263                     android:layout_gravity="center_horizontal"
264                     android:layout_marginBottom="10dp"
265                     android:layout_marginStart="15dp"
266                     android:layout_marginEnd="15dp"
267                     android:text="@string/storage_permission_explanation"
268                     android:textAlignment="center" />
269             </LinearLayout>
270         </ScrollView>
271     </LinearLayout>
272 </androidx.coordinatorlayout.widget.CoordinatorLayout>