1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
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.
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.
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/>. -->
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" >
31 <!-- the `LinearLayout` with `orientation="vertical"` moves the content below the `AppBarLayout`. -->
33 android:layout_height="match_parent"
34 android:layout_width="match_parent"
35 android:orientation="vertical" >
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" >
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>
52 android:layout_height="match_parent"
53 android:layout_width="match_parent" >
55 <!-- Align the cards vertically. -->
57 android:layout_height="wrap_content"
58 android:layout_width="match_parent"
59 android:orientation="vertical" >
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" >
70 <!-- Align the contents of the card vertically. -->
72 android:layout_height="match_parent"
73 android:layout_width="match_parent"
74 android:orientation="vertical"
75 android:layout_margin="10dp" >
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" />
88 android:id="@+id/encryption_spinner"
89 android:layout_height="wrap_content"
90 android:layout_width="wrap_content"
91 android:layout_gravity="center_horizontal" />
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" >
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>
108 </android.support.v7.widget.CardView>
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" >
119 <!-- Align the contents of the card vertically. -->
121 android:layout_height="match_parent"
122 android:layout_width="match_parent"
123 android:orientation="vertical"
124 android:layout_margin="10dp" >
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" />
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" />
142 <!-- Align the EditText and the select file button horizontally. -->
144 android:layout_height="wrap_content"
145 android:layout_width="match_parent"
146 android:orientation="horizontal"
147 android:layout_marginTop="10dp">
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" >
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>
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" />
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" />
184 </android.support.v7.widget.CardView>
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" />
200 </android.support.design.widget.CoordinatorLayout>