]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/import_export_coordinatorlayout_top_appbar.xml
Add the option to move the app bar to the bottom of the screen. https://redmine.stout...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_coordinatorlayout_top_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"` 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                         <!-- 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                         <!-- OpenKeychain import instructions -->
215                         <TextView
216                             android:id="@+id/openkeychain_import_instructions_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/openkeychain_import_instructions"
222                             android:textAlignment="center" />
223
224                         <Button
225                             android:id="@+id/import_export_button"
226                             android:layout_height="wrap_content"
227                             android:layout_width="wrap_content"
228                             android:layout_gravity="center_horizontal"
229                             android:layout_marginTop="10dp"
230                             android:text="@string/import_button"
231                             android:textSize="18sp"
232                             android:onClick="importExport"
233                             app:backgroundTint="?attr/buttonBackgroundColorSelector"
234                             android:textColor="?attr/buttonTextColorSelector" />
235                     </LinearLayout>
236                 </androidx.cardview.widget.CardView>
237             </LinearLayout>
238         </ScrollView>
239     </LinearLayout>
240 </androidx.coordinatorlayout.widget.CoordinatorLayout>