Bump the minimum API to 23. https://redmine.stoutner.com/issues/793
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_bottom_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2018-2021 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"` keeps the content above the app bar layout.  `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars.-->
29     <LinearLayout
30         android:layout_height="match_parent"
31         android:layout_width="match_parent"
32         android:orientation="vertical"
33         app:layout_dodgeInsetEdges="bottom" >
34
35         <ScrollView
36             android:layout_height="0dp"
37             android:layout_width="match_parent"
38             android:layout_weight="1" >
39
40             <!-- Align the cards vertically. -->
41             <LinearLayout
42                 android:layout_height="wrap_content"
43                 android:layout_width="match_parent"
44                 android:orientation="vertical" >
45
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" >
54
55                     <!-- Align the contents of the card vertically. -->
56                     <LinearLayout
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" >
64
65                         <TextView
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" />
74
75                         <Spinner
76                             android:id="@+id/encryption_spinner"
77                             android:layout_height="wrap_content"
78                             android:layout_width="wrap_content"
79                             android:layout_gravity="center_horizontal" />
80
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" >
87
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>
95
96                         <!-- OpenKeychain required message. -->
97                         <TextView
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" />
105                     </LinearLayout>
106                 </androidx.cardview.widget.CardView>
107
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" >
117
118                     <!-- Align the contents of the card vertically. -->
119                     <LinearLayout
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" >
127
128                         <TextView
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" />
137
138                         <RadioGroup
139                             android:layout_height="wrap_content"
140                             android:layout_width="wrap_content"
141                             android:layout_gravity="center_horizontal"
142                             android:orientation="horizontal" >
143
144                             <RadioButton
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" />
151
152                             <RadioButton
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" />
158                         </RadioGroup>
159
160                         <!-- Align the edit text and the select file button horizontally. -->
161                         <LinearLayout
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">
167
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" >
173
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>
182
183                             <Button
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" />
190                         </LinearLayout>
191
192                         <!-- OpenKeychain import instructions -->
193                         <TextView
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" />
201
202                         <Button
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="?attr/buttonBackgroundColorSelector"
212                             android:textColor="?attr/buttonTextColorSelector" />
213                     </LinearLayout>
214                 </androidx.cardview.widget.CardView>
215             </LinearLayout>
216         </ScrollView>
217
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" >
225
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>
231     </LinearLayout>
232 </androidx.coordinatorlayout.widget.CoordinatorLayout>