37c8490d262ea20370c05bfabbdb8182cf39fc17
[PrivacyBrowser.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="vertical">
44
45             <LinearLayout
46                 android:layout_height="wrap_content"
47                 android:layout_width="match_parent"
48                 android:orientation="horizontal" >
49
50                 <ImageView
51                     android:layout_height="wrap_content"
52                     android:layout_width="wrap_content"
53                     android:layout_marginEnd="10dp"
54                     android:layout_marginBottom="12dp"
55                     android:layout_gravity="bottom"
56                     android:src="@drawable/domains"
57                     android:tint="@color/blue_800"
58                     tools:ignore="contentDescription" />
59
60                 <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
61                 <android.support.design.widget.TextInputLayout
62                     android:layout_height="wrap_content"
63                     android:layout_width="match_parent"
64                     android:layout_marginStart="6dp" >
65
66                     <!-- `android:inputType="textUri"` disables spell check in the `EditText`. -->
67                     <android.support.design.widget.TextInputEditText
68                         android:id="@+id/domain_settings_name_edittext"
69                         android:layout_width="match_parent"
70                         android:layout_height="wrap_content"
71                         android:hint="@string/domain_name"
72                         android:inputType="textUri" />
73                 </android.support.design.widget.TextInputLayout>
74             </LinearLayout>
75
76             <TextView
77                 android:layout_height="wrap_content"
78                 android:layout_width="match_parent"
79                 android:text="@string/domain_name_instructions"
80                 android:textSize="12sp"
81                 android:layout_marginStart="43dp"
82                 android:layout_marginBottom="14dp" />
83         </LinearLayout>
84
85         <!-- JavaScript. -->
86         <LinearLayout
87             android:layout_height="wrap_content"
88             android:layout_width="match_parent"
89             android:orientation="horizontal" >
90
91             <ImageView
92                 android:id="@+id/domain_settings_javascript_imageview"
93                 android:layout_height="wrap_content"
94                 android:layout_width="wrap_content"
95                 android:layout_marginEnd="10dp"
96                 android:layout_gravity="center_vertical"
97                 android:src="@drawable/privacy_mode"
98                 tools:ignore="contentDescription" />
99
100             <Switch
101                 android:id="@+id/domain_settings_javascript_switch"
102                 android:layout_height="wrap_content"
103                 android:layout_width="match_parent"
104                 android:layout_marginStart="8dp"
105                 android:layout_marginTop="14dp"
106                 android:layout_marginBottom="14dp"
107                 android:text="@string/javascript_enabled"
108                 android:textSize="18sp" />
109         </LinearLayout>
110
111         <!-- First-Party Cookies. -->
112         <LinearLayout
113             android:layout_height="wrap_content"
114             android:layout_width="match_parent"
115             android:orientation="horizontal" >
116
117             <ImageView
118                 android:id="@+id/domain_settings_first_party_cookies_imageview"
119                 android:layout_height="wrap_content"
120                 android:layout_width="wrap_content"
121                 android:layout_marginTop="1dp"
122                 android:layout_marginEnd="10dp"
123                 android:layout_gravity="center_vertical"
124                 android:src="@drawable/cookies_disabled"
125                 tools:ignore="contentDescription" />
126
127             <Switch
128                 android:id="@+id/domain_settings_first_party_cookies_switch"
129                 android:layout_height="wrap_content"
130                 android:layout_width="match_parent"
131                 android:layout_marginStart="8dp"
132                 android:layout_marginTop="14dp"
133                 android:layout_marginBottom="14dp"
134                 android:text="@string/first_party_cookies_enabled"
135                 android:textSize="18sp" />
136         </LinearLayout>
137
138         <!-- Third-Party Cookies. -->
139         <LinearLayout
140             android:id="@+id/domain_settings_third_party_cookies_linearlayout"
141             android:layout_height="wrap_content"
142             android:layout_width="match_parent"
143             android:orientation="horizontal" >
144
145             <ImageView
146                 android:id="@+id/domain_settings_third_party_cookies_imageview"
147                 android:layout_height="wrap_content"
148                 android:layout_width="wrap_content"
149                 android:layout_marginTop="1dp"
150                 android:layout_marginEnd="10dp"
151                 android:layout_gravity="center_vertical"
152                 android:src="@drawable/cookies_disabled"
153                 tools:ignore="contentDescription" />
154
155             <Switch
156                 android:id="@+id/domain_settings_third_party_cookies_switch"
157                 android:layout_height="wrap_content"
158                 android:layout_width="match_parent"
159                 android:layout_marginStart="8dp"
160                 android:layout_marginTop="14dp"
161                 android:layout_marginBottom="14dp"
162                 android:text="@string/third_party_cookies_enabled"
163                 android:textSize="18sp" />
164         </LinearLayout>
165
166         <!-- DOM Storage. -->
167         <LinearLayout
168             android:layout_height="wrap_content"
169             android:layout_width="match_parent"
170             android:orientation="horizontal" >
171
172             <ImageView
173                 android:id="@+id/domain_settings_dom_storage_imageview"
174                 android:layout_height="wrap_content"
175                 android:layout_width="wrap_content"
176                 android:layout_marginTop="1dp"
177                 android:layout_marginEnd="10dp"
178                 android:layout_gravity="center_vertical"
179                 android:src="@drawable/dom_storage_disabled"
180                 tools:ignore="contentDescription" />
181
182             <Switch
183                 android:id="@+id/domain_settings_dom_storage_switch"
184                 android:layout_height="wrap_content"
185                 android:layout_width="match_parent"
186                 android:layout_marginStart="8dp"
187                 android:layout_marginTop="14dp"
188                 android:layout_marginBottom="14dp"
189                 android:text="@string/dom_storage_enabled"
190                 android:textSize="18sp" />
191         </LinearLayout>
192
193         <!-- Form Data. -->
194         <LinearLayout
195             android:layout_height="wrap_content"
196             android:layout_width="match_parent"
197             android:orientation="horizontal">
198
199             <ImageView
200                 android:id="@+id/domain_settings_form_data_imageview"
201                 android:layout_height="wrap_content"
202                 android:layout_width="wrap_content"
203                 android:layout_marginTop="1dp"
204                 android:layout_marginEnd="10dp"
205                 android:layout_gravity="center_vertical"
206                 android:src="@drawable/form_data_disabled"
207                 tools:ignore="contentDescription" />
208
209             <Switch
210                 android:id="@+id/domain_settings_form_data_switch"
211                 android:layout_height="wrap_content"
212                 android:layout_width="match_parent"
213                 android:layout_marginStart="8dp"
214                 android:layout_marginTop="14dp"
215                 android:layout_marginBottom="14dp"
216                 android:text="@string/form_data_enabled"
217                 android:textSize="18sp" />
218         </LinearLayout>
219
220         <!-- User Agent. -->
221         <LinearLayout
222             android:layout_height="wrap_content"
223             android:layout_width="match_parent"
224             android:orientation="vertical"
225             android:layout_marginTop="14dp"
226             android:layout_marginBottom="14dp" >
227
228             <LinearLayout
229                 android:layout_height="wrap_content"
230                 android:layout_width="match_parent"
231                 android:orientation="horizontal">
232
233                 <ImageView
234                     android:layout_height="wrap_content"
235                     android:layout_width="wrap_content"
236                     android:layout_marginTop="1dp"
237                     android:layout_marginEnd="10dp"
238                     android:layout_gravity="center_vertical"
239                     android:src="@drawable/user_agent"
240                     android:tint="@color/blue_800"
241                     android:contentDescription="@string/user_agent" />
242
243                 <Spinner
244                     android:id="@+id/domain_settings_user_agent_spinner"
245                     android:layout_height="wrap_content"
246                     android:layout_width="match_parent"
247                     android:labelFor="@+id/domain_settings_custom_user_agent_edittext"/>
248             </LinearLayout>
249
250             <TextView
251                 android:id="@+id/domain_settings_user_agent_textview"
252                 android:layout_height="match_parent"
253                 android:layout_width="match_parent"
254                 android:layout_marginStart="43dp"
255                 android:layout_marginEnd="36dp"
256                 android:textSize="13sp"/>
257
258             <EditText
259                 android:id="@id/domain_settings_custom_user_agent_edittext"
260                 android:layout_height="wrap_content"
261                 android:layout_width="match_parent"
262                 android:layout_marginStart="38dp"
263                 android:layout_marginEnd="60dp"
264                 android:inputType="textUri" />
265         </LinearLayout>
266
267         <!-- Font Size. -->
268         <LinearLayout
269             android:layout_height="wrap_content"
270             android:layout_width="match_parent"
271             android:orientation="horizontal" >
272
273             <ImageView
274                 android:layout_height="wrap_content"
275                 android:layout_width="wrap_content"
276                 android:layout_marginTop="1dp"
277                 android:layout_marginEnd="10dp"
278                 android:layout_gravity="center_vertical"
279                 android:src="@drawable/font_size"
280                 android:tint="@color/blue_800"
281                 android:contentDescription="@string/font_size" />
282
283             <Spinner
284                 android:id="@+id/domain_settings_font_size_spinner"
285                 android:layout_height="wrap_content"
286                 android:layout_width="match_parent"
287                 android:layout_marginTop="14dp"
288                 android:layout_marginBottom="14dp"/>
289         </LinearLayout>
290     </LinearLayout>
291 </ScrollView>