]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/domain_settings.xml
Populate and save the domain `Switches` and `Spinners`.
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / domain_settings.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2017 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 <ScrollView
22     xmlns:android="http://schemas.android.com/apk/res/android"
23     xmlns:tools="http://schemas.android.com/tools"
24     android:layout_height="wrap_content"
25     android:layout_width="match_parent"
26     android:focusable="true"
27     android:focusableInTouchMode="true"
28     android:descendantFocusability="beforeDescendants" >
29
30     <LinearLayout
31         xmlns:android="http://schemas.android.com/apk/res/android"
32         android:layout_height="wrap_content"
33         android:layout_width="match_parent"
34         android:layout_margin="12dp"
35         android:orientation="vertical"
36         android:divider="?android:attr/dividerVertical"
37         android:showDividers="middle" >
38
39         <!-- Domain name. -->
40         <LinearLayout
41             android:layout_height="wrap_content"
42             android:layout_width="match_parent"
43             android:orientation="horizontal" >
44
45             <ImageView
46                 android:layout_height="wrap_content"
47                 android:layout_width="wrap_content"
48                 android:layout_marginBottom="26dp"
49                 android:layout_marginEnd="10dp"
50                 android:layout_gravity="bottom"
51                 android:src="@drawable/domains"
52                 android:tint="@color/blue_800"
53                 tools:ignore="contentDescription" />
54
55             <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
56             <android.support.design.widget.TextInputLayout
57                 android:layout_height="wrap_content"
58                 android:layout_width="match_parent"
59                 android:layout_marginStart="6dp"
60                 android:layout_marginBottom="14dp" >
61
62                 <!-- `android:inputType="textUri"` disables spell check in the `EditText`. -->
63                 <android.support.design.widget.TextInputEditText
64                     android:id="@+id/domain_settings_name_edittext"
65                     android:layout_width="match_parent"
66                     android:layout_height="wrap_content"
67                     android:hint="@string/domain_name"
68                     android:inputType="textUri" />
69             </android.support.design.widget.TextInputLayout>
70         </LinearLayout>
71
72         <!-- JavaScript. -->
73         <LinearLayout
74             android:layout_height="wrap_content"
75             android:layout_width="match_parent"
76             android:orientation="horizontal" >
77
78             <ImageView
79                 android:layout_height="wrap_content"
80                 android:layout_width="wrap_content"
81                 android:layout_marginEnd="10dp"
82                 android:layout_gravity="center_vertical"
83                 android:src="@drawable/privacy_mode"
84                 tools:ignore="contentDescription" />
85
86             <Switch
87                 android:id="@+id/domain_settings_javascript_switch"
88                 android:layout_height="wrap_content"
89                 android:layout_width="match_parent"
90                 android:layout_marginStart="8dp"
91                 android:layout_marginTop="14dp"
92                 android:layout_marginBottom="14dp"
93                 android:text="@string/javascript_enabled"
94                 android:textSize="18sp" />
95         </LinearLayout>
96
97         <!-- First-Party Cookies. -->
98         <LinearLayout
99             android:layout_height="wrap_content"
100             android:layout_width="match_parent"
101             android:orientation="horizontal" >
102
103             <ImageView
104                 android:layout_height="wrap_content"
105                 android:layout_width="wrap_content"
106                 android:layout_marginTop="1dp"
107                 android:layout_marginEnd="10dp"
108                 android:layout_gravity="center_vertical"
109                 android:src="@drawable/cookies_enabled"
110                 android:tint="@color/blue_800"
111                 tools:ignore="contentDescription" />
112
113             <Switch
114                 android:id="@+id/domain_settings_first_party_cookies_switch"
115                 android:layout_height="wrap_content"
116                 android:layout_width="match_parent"
117                 android:layout_marginStart="8dp"
118                 android:layout_marginTop="14dp"
119                 android:layout_marginBottom="14dp"
120                 android:text="@string/first_party_cookies_enabled"
121                 android:textSize="18sp" />
122         </LinearLayout>
123
124         <!-- Third-Party Cookies. -->
125         <LinearLayout
126             android:layout_height="wrap_content"
127             android:layout_width="match_parent"
128             android:orientation="horizontal" >
129
130             <ImageView
131                 android:layout_height="wrap_content"
132                 android:layout_width="wrap_content"
133                 android:layout_marginTop="1dp"
134                 android:layout_marginEnd="10dp"
135                 android:layout_gravity="center_vertical"
136                 android:src="@drawable/cookies_enabled"
137                 android:tint="@color/blue_800"
138                 tools:ignore="contentDescription" />
139
140             <Switch
141                 android:id="@+id/domain_settings_third_party_cookies_switch"
142                 android:layout_height="wrap_content"
143                 android:layout_width="match_parent"
144                 android:layout_marginStart="8dp"
145                 android:layout_marginTop="14dp"
146                 android:layout_marginBottom="14dp"
147                 android:text="@string/third_party_cookies_enabled"
148                 android:textSize="18sp" />
149         </LinearLayout>
150
151         <!-- DOM Storage. -->
152         <LinearLayout
153             android:layout_height="wrap_content"
154             android:layout_width="match_parent"
155             android:orientation="horizontal" >
156
157             <ImageView
158                 android:layout_height="wrap_content"
159                 android:layout_width="wrap_content"
160                 android:layout_marginTop="1dp"
161                 android:layout_marginEnd="10dp"
162                 android:layout_gravity="center_vertical"
163                 android:src="@drawable/dom_storage_enabled"
164                 android:tint="@color/blue_800"
165                 tools:ignore="contentDescription" />
166
167             <Switch
168                 android:id="@+id/domain_settings_dom_storage_switch"
169                 android:layout_height="wrap_content"
170                 android:layout_width="match_parent"
171                 android:layout_marginStart="8dp"
172                 android:layout_marginTop="14dp"
173                 android:layout_marginBottom="14dp"
174                 android:text="@string/dom_storage_enabled"
175                 android:textSize="18sp" />
176         </LinearLayout>
177
178         <!-- Form Data. -->
179         <LinearLayout
180             android:layout_height="wrap_content"
181             android:layout_width="match_parent"
182             android:orientation="horizontal">
183
184             <ImageView
185                 android:layout_height="wrap_content"
186                 android:layout_width="wrap_content"
187                 android:layout_marginTop="1dp"
188                 android:layout_marginEnd="10dp"
189                 android:layout_gravity="center_vertical"
190                 android:src="@drawable/form_data_enabled"
191                 android:tint="@color/blue_800"
192                 tools:ignore="contentDescription" />
193
194             <Switch
195                 android:id="@+id/domain_settings_form_data_switch"
196                 android:layout_height="wrap_content"
197                 android:layout_width="match_parent"
198                 android:layout_marginStart="8dp"
199                 android:layout_marginTop="14dp"
200                 android:layout_marginBottom="14dp"
201                 android:text="@string/form_data_enabled"
202                 android:textSize="18sp" />
203         </LinearLayout>
204
205         <!-- User Agent. -->
206         <LinearLayout
207             android:layout_height="wrap_content"
208             android:layout_width="match_parent"
209             android:orientation="vertical"
210             android:layout_marginTop="14dp"
211             android:layout_marginBottom="14dp" >
212
213             <LinearLayout
214                 android:layout_height="wrap_content"
215                 android:layout_width="match_parent"
216                 android:orientation="horizontal">
217
218                 <ImageView
219                     android:layout_height="wrap_content"
220                     android:layout_width="wrap_content"
221                     android:layout_marginTop="1dp"
222                     android:layout_marginEnd="10dp"
223                     android:layout_gravity="center_vertical"
224                     android:src="@drawable/user_agent"
225                     android:tint="@color/blue_800"
226                     android:contentDescription="@string/user_agent" />
227
228                 <Spinner
229                     android:id="@+id/domain_settings_user_agent_spinner"
230                     android:layout_height="wrap_content"
231                     android:layout_width="match_parent"
232                     android:labelFor="@+id/domain_settings_custom_user_agent_edittext"/>
233             </LinearLayout>
234
235             <TextView
236                 android:id="@+id/domain_settings_user_agent_textview"
237                 android:layout_height="match_parent"
238                 android:layout_width="match_parent"
239                 android:layout_marginStart="43dp"
240                 android:layout_marginEnd="36dp"
241                 android:textSize="13sp"/>
242
243             <EditText
244                 android:id="@id/domain_settings_custom_user_agent_edittext"
245                 android:layout_height="wrap_content"
246                 android:layout_width="match_parent"
247                 android:layout_marginStart="38dp"
248                 android:layout_marginEnd="60dp"
249                 android:inputType="textUri" />
250         </LinearLayout>
251
252         <!-- Font Size. -->
253         <!-- We need to add an extra `android:layout_marginBottom="14dp"` to the last `LinearLayout` or the bottom of the `ScrollView` gets cutoff if API 25. -->
254         <LinearLayout
255             android:layout_height="wrap_content"
256             android:layout_width="match_parent"
257             android:orientation="horizontal"
258             android:layout_marginBottom="14dp" >
259
260             <ImageView
261                 android:layout_height="wrap_content"
262                 android:layout_width="wrap_content"
263                 android:layout_marginTop="1dp"
264                 android:layout_marginEnd="10dp"
265                 android:layout_gravity="center_vertical"
266                 android:src="@drawable/font_size"
267                 android:tint="@color/blue_800"
268                 android:contentDescription="@string/font_size" />
269
270             <Spinner
271                 android:id="@+id/domain_settings_font_size_spinner"
272                 android:layout_height="wrap_content"
273                 android:layout_width="match_parent"
274                 android:layout_marginTop="14dp"
275                 android:layout_marginBottom="14dp"/>
276         </LinearLayout>
277     </LinearLayout>
278 </ScrollView>