]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/import_export_top_appbar.xml
a970ca798916cd5fda9f3842b3f3b99669b7381f
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_top_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2018-2022 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
7
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.
12
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.
17
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/>. -->
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/encryption_password_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/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>
107
108                         <!-- OpenKeychain required message. -->
109                         <TextView
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" />
117                     </LinearLayout>
118                 </androidx.cardview.widget.CardView>
119
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" >
129
130                     <!-- Align the contents of the card vertically. -->
131                     <LinearLayout
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" >
139
140                         <TextView
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" />
149
150                         <RadioGroup
151                             android:layout_height="wrap_content"
152                             android:layout_width="wrap_content"
153                             android:layout_gravity="center_horizontal"
154                             android:orientation="horizontal" >
155
156                             <RadioButton
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" />
163
164                             <RadioButton
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" />
170                         </RadioGroup>
171
172                         <!-- Align the edit text and the select file button horizontally. -->
173                         <LinearLayout
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">
179
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" >
185
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>
194
195                             <Button
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" />
202                         </LinearLayout>
203
204                         <!-- OpenKeychain import instructions -->
205                         <TextView
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" />
213
214                         <Button
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" />
225                     </LinearLayout>
226                 </androidx.cardview.widget.CardView>
227             </LinearLayout>
228         </ScrollView>
229     </LinearLayout>
230 </androidx.coordinatorlayout.widget.CoordinatorLayout>