]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/import_export_coordinatorlayout.xml
67b0cfd759de541c22fdea3a8b3def9a859db6aa
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_coordinatorlayout.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2018 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 <!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar.
22     When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
23 <android.support.design.widget.CoordinatorLayout
24     android:id="@+id/import_export_coordinatorlayout"
25     xmlns:android="http://schemas.android.com/apk/res/android"
26     xmlns:app="http://schemas.android.com/apk/res-auto"
27     android:layout_height="match_parent"
28     android:layout_width="match_parent"
29     android:fitsSystemWindows="true" >
30
31     <!-- the `LinearLayout` with `orientation="vertical"` moves the content below the `AppBarLayout`. -->
32     <LinearLayout
33         android:layout_height="match_parent"
34         android:layout_width="match_parent"
35         android:orientation="vertical" >
36
37         <android.support.design.widget.AppBarLayout
38             android:id="@+id/import_export_appbarlayout"
39             android:layout_height="wrap_content"
40             android:layout_width="match_parent" >
41
42             <android.support.v7.widget.Toolbar
43                 android:id="@+id/import_export_toolbar"
44                 android:layout_height="wrap_content"
45                 android:layout_width="match_parent"
46                 android:background="?attr/colorPrimaryDark"
47                 android:theme="?attr/appBarTextTheme"
48                 app:popupTheme="?attr/popupsTheme" />
49         </android.support.design.widget.AppBarLayout>
50
51         <ScrollView
52             android:layout_height="match_parent"
53             android:layout_width="match_parent" >
54
55             <!-- Align the cards vertically. -->
56             <LinearLayout
57                 android:layout_height="wrap_content"
58                 android:layout_width="match_parent"
59                 android:orientation="vertical" >
60
61                 <!-- The encryption card. -->
62                 <android.support.v7.widget.CardView
63                     android:layout_height="wrap_content"
64                     android:layout_width="match_parent"
65                     android:layout_marginTop="10dp"
66                     android:layout_marginBottom="5dp"
67                     android:layout_marginStart="10dp"
68                     android:layout_marginEnd="10dp" >
69
70                     <!-- Align the contents of the card vertically. -->
71                     <LinearLayout
72                         android:layout_height="match_parent"
73                         android:layout_width="match_parent"
74                         android:orientation="vertical"
75                         android:layout_marginTop="10dp"
76                         android:layout_marginBottom="20dp"
77                         android:layout_marginStart="10dp"
78                         android:layout_marginEnd="10dp" >
79
80                         <TextView
81                             android:layout_width="wrap_content"
82                             android:layout_height="wrap_content"
83                             android:layout_gravity="center_horizontal"
84                             android:layout_marginBottom="6dp"
85                             android:text="@string/encryption"
86                             android:textSize="25sp"
87                             android:textStyle="bold"
88                             android:textColor="?colorAccent" />
89
90                         <Spinner
91                             android:id="@+id/encryption_spinner"
92                             android:layout_height="wrap_content"
93                             android:layout_width="wrap_content"
94                             android:layout_gravity="center_horizontal" />
95
96                         <!-- The encryption password. -->
97                         <android.support.design.widget.TextInputLayout
98                             android:id="@+id/password_encryption_textinputlayout"
99                             android:layout_height="wrap_content"
100                             android:layout_width="match_parent"
101                             app:passwordToggleEnabled="true" >
102
103                             <android.support.design.widget.TextInputEditText
104                                 android:id="@+id/password_encryption_edittext"
105                                 android:layout_height="wrap_content"
106                                 android:layout_width="match_parent"
107                                 android:hint="@string/password"
108                                 android:inputType="textPassword"/>
109                         </android.support.design.widget.TextInputLayout>
110
111                         <!-- KitKat password encryption message. -->
112                         <TextView
113                             android:id="@+id/kitkat_password_encryption_textview"
114                             android:layout_height="wrap_content"
115                             android:layout_width="wrap_content"
116                             android:layout_gravity="center_horizontal"
117                             android:layout_marginTop="10dp"
118                             android:text="@string/kitkat_password_encryption_message"
119                             android:textColor="?android:textColorPrimary"
120                             android:textAlignment="center" />
121
122                         <!-- OpenKeychain required message. -->
123                         <TextView
124                             android:id="@+id/openkeychain_required_textview"
125                             android:layout_height="wrap_content"
126                             android:layout_width="wrap_content"
127                             android:layout_gravity="center_horizontal"
128                             android:layout_marginTop="10dp"
129                             android:text="@string/openkeychain_required"
130                             android:textColor="?android:textColorPrimary"
131                             android:textAlignment="center" />
132                     </LinearLayout>
133                 </android.support.v7.widget.CardView>
134
135                 <!-- The file location card. -->
136                 <android.support.v7.widget.CardView
137                     android:id="@+id/file_location_cardview"
138                     android:layout_height="wrap_content"
139                     android:layout_width="match_parent"
140                     android:layout_marginTop="5dp"
141                     android:layout_marginBottom="5dp"
142                     android:layout_marginStart="10dp"
143                     android:layout_marginEnd="10dp" >
144
145                     <!-- Align the contents of the card vertically. -->
146                     <LinearLayout
147                         android:layout_height="match_parent"
148                         android:layout_width="match_parent"
149                         android:orientation="vertical"
150                         android:layout_marginTop="10dp"
151                         android:layout_marginBottom="20dp"
152                         android:layout_marginStart="10dp"
153                         android:layout_marginEnd="10dp" >
154
155                         <TextView
156                             android:layout_width="wrap_content"
157                             android:layout_height="wrap_content"
158                             android:layout_gravity="center_horizontal"
159                             android:layout_marginBottom="6dp"
160                             android:text="@string/file_location"
161                             android:textSize="25sp"
162                             android:textStyle="bold"
163                             android:textColor="?colorAccent" />
164
165                         <RadioGroup
166                             android:layout_height="wrap_content"
167                             android:layout_width="wrap_content"
168                             android:layout_gravity="center_horizontal"
169                             android:orientation="horizontal" >
170
171                             <RadioButton
172                                 android:id="@+id/import_radiobutton"
173                                 android:layout_height="wrap_content"
174                                 android:layout_width="wrap_content"
175                                 android:text="@string/import_button"
176                                 android:layout_marginEnd="10dp"
177                                 android:onClick="onClickRadioButton" />
178
179                             <RadioButton
180                                 android:id="@+id/export_radiobutton"
181                                 android:layout_height="wrap_content"
182                                 android:layout_width="wrap_content"
183                                 android:text="@string/export"
184                                 android:onClick="onClickRadioButton" />
185                         </RadioGroup>
186
187                         <!-- Align the EditText and the select file button horizontally. -->
188                         <LinearLayout
189                             android:id="@+id/file_name_linearlayout"
190                             android:layout_height="wrap_content"
191                             android:layout_width="match_parent"
192                             android:orientation="horizontal"
193                             android:layout_marginTop="10dp">
194
195                             <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
196                             <android.support.design.widget.TextInputLayout
197                                 android:layout_height="wrap_content"
198                                 android:layout_width="0dp"
199                                 android:layout_weight="1" >
200
201                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
202                                 <android.support.design.widget.TextInputEditText
203                                     android:id="@+id/file_name_edittext"
204                                     android:layout_height="wrap_content"
205                                     android:layout_width="match_parent"
206                                     android:hint="@string/file_name"
207                                     android:inputType="textMultiLine|textUri" />
208                             </android.support.design.widget.TextInputLayout>
209
210                             <Button
211                                 android:id="@+id/browser_button"
212                                 android:layout_height="wrap_content"
213                                 android:layout_width="wrap_content"
214                                 android:layout_gravity="center_vertical"
215                                 android:text="@string/browse"
216                                 android:onClick="browse" />
217                         </LinearLayout>
218
219                         <!-- OpenKeychain import instructions -->
220                         <TextView
221                             android:id="@+id/openkeychain_import_instructions_textview"
222                             android:layout_height="wrap_content"
223                             android:layout_width="wrap_content"
224                             android:layout_gravity="center_horizontal"
225                             android:layout_margin="5dp"
226                             android:text="@string/openkeychain_import_instructions"
227                             android:textColor="?android:textColorPrimary"
228                             android:textAlignment="center" />
229
230                         <Button
231                             android:id="@+id/import_export_button"
232                             android:layout_height="wrap_content"
233                             android:layout_width="wrap_content"
234                             android:layout_gravity="center_horizontal"
235                             android:layout_marginTop="10dp"
236                             android:text="@string/import_button"
237                             android:textSize="18sp"
238                             android:onClick="importExport"
239                             app:backgroundTint="?attr/buttonBackgroundColorSelector"
240                             android:textColor="?attr/buttonTextColorSelector" />
241                     </LinearLayout>
242                 </android.support.v7.widget.CardView>
243
244                 <TextView
245                     android:id="@+id/import_export_storage_permission_textview"
246                     android:layout_width="wrap_content"
247                     android:layout_height="wrap_content"
248                     android:layout_gravity="center_horizontal"
249                     android:layout_marginBottom="10dp"
250                     android:layout_marginStart="15dp"
251                     android:layout_marginEnd="15dp"
252                     android:text="@string/storage_permission_explanation"
253                     android:textColor="?android:textColorPrimary"
254                     android:textAlignment="center" />
255             </LinearLayout>
256         </ScrollView>
257     </LinearLayout>
258 </android.support.design.widget.CoordinatorLayout>