f3c7cefeb4b2cf9a2b81309f9e2cd87336ab19ef
[PrivacyBrowser.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_margin="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                         <android.support.design.widget.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                             <android.support.design.widget.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                         </android.support.design.widget.TextInputLayout>
107                     </LinearLayout>
108                 </android.support.v7.widget.CardView>
109
110                 <!-- The file location card. -->
111                 <android.support.v7.widget.CardView
112                     android:layout_height="wrap_content"
113                     android:layout_width="match_parent"
114                     android:layout_marginTop="5dp"
115                     android:layout_marginBottom="5dp"
116                     android:layout_marginStart="10dp"
117                     android:layout_marginEnd="10dp" >
118
119                     <!-- Align the contents of the card vertically. -->
120                     <LinearLayout
121                         android:layout_height="match_parent"
122                         android:layout_width="match_parent"
123                         android:orientation="vertical"
124                         android:layout_margin="10dp" >
125
126                         <TextView
127                             android:layout_width="wrap_content"
128                             android:layout_height="wrap_content"
129                             android:layout_gravity="center_horizontal"
130                             android:layout_marginBottom="6dp"
131                             android:text="@string/file_location"
132                             android:textSize="25sp"
133                             android:textStyle="bold"
134                             android:textColor="?colorAccent" />
135
136                         <Spinner
137                             android:id="@+id/import_export_spinner"
138                             android:layout_height="wrap_content"
139                             android:layout_width="wrap_content"
140                             android:layout_gravity="center_horizontal" />
141
142                         <!-- Align the EditText and the select file button horizontally. -->
143                         <LinearLayout
144                             android:layout_height="wrap_content"
145                             android:layout_width="match_parent"
146                             android:orientation="horizontal"
147                             android:layout_marginTop="10dp">
148
149                             <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
150                             <android.support.design.widget.TextInputLayout
151                                 android:layout_height="wrap_content"
152                                 android:layout_width="0dp"
153                                 android:layout_weight="1" >
154
155                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
156                                 <android.support.design.widget.TextInputEditText
157                                     android:id="@+id/file_name_edittext"
158                                     android:layout_height="wrap_content"
159                                     android:layout_width="match_parent"
160                                     android:hint="@string/file_name"
161                                     android:inputType="textMultiLine|textUri" />
162                             </android.support.design.widget.TextInputLayout>
163
164                             <Button
165                                 android:id="@+id/browser_button"
166                                 android:layout_height="wrap_content"
167                                 android:layout_width="wrap_content"
168                                 android:layout_gravity="center_vertical"
169                                 android:text="@string/browse"
170                                 android:onClick="browse" />
171                         </LinearLayout>
172
173                         <Button
174                             android:id="@+id/import_export_button"
175                             android:layout_height="wrap_content"
176                             android:layout_width="wrap_content"
177                             android:layout_gravity="center_horizontal"
178                             android:text="@string/import_button"
179                             android:textSize="18sp"
180                             android:onClick="importExport"
181                             app:backgroundTint="?attr/buttonBackgroundColorSelector"
182                             android:textColor="?attr/buttonTextColorSelector" />
183                     </LinearLayout>
184                 </android.support.v7.widget.CardView>
185
186                 <TextView
187                     android:id="@+id/import_export_storage_permission_textview"
188                     android:layout_width="wrap_content"
189                     android:layout_height="wrap_content"
190                     android:layout_gravity="center_horizontal"
191                     android:layout_marginBottom="10dp"
192                     android:layout_marginStart="15dp"
193                     android:layout_marginEnd="15dp"
194                     android:text="@string/storage_permission_explanation"
195                     android:textColor="?android:textColorPrimary"
196                     android:textAlignment="center" />
197             </LinearLayout>
198         </ScrollView>
199     </LinearLayout>
200 </android.support.design.widget.CoordinatorLayout>