]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/domain_settings.xml
1ea1417c46723b2a21824e0649911018787a8ecb
[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:id="@+id/domain_settings_javascript_imageview"
80                 android:layout_height="wrap_content"
81                 android:layout_width="wrap_content"
82                 android:layout_marginEnd="10dp"
83                 android:layout_gravity="center_vertical"
84                 android:src="@drawable/privacy_mode"
85                 tools:ignore="contentDescription" />
86
87             <Switch
88                 android:id="@+id/domain_settings_javascript_switch"
89                 android:layout_height="wrap_content"
90                 android:layout_width="match_parent"
91                 android:layout_marginStart="8dp"
92                 android:layout_marginTop="14dp"
93                 android:layout_marginBottom="14dp"
94                 android:text="@string/javascript_enabled"
95                 android:textSize="18sp" />
96         </LinearLayout>
97
98         <!-- First-Party Cookies. -->
99         <LinearLayout
100             android:layout_height="wrap_content"
101             android:layout_width="match_parent"
102             android:orientation="horizontal" >
103
104             <ImageView
105                 android:id="@+id/domain_settings_first_party_cookies_imageview"
106                 android:layout_height="wrap_content"
107                 android:layout_width="wrap_content"
108                 android:layout_marginTop="1dp"
109                 android:layout_marginEnd="10dp"
110                 android:layout_gravity="center_vertical"
111                 android:src="@drawable/cookies_enabled"
112                 android:tint="@color/domain_settings_icon_yellow_tint_selector"
113                 tools:ignore="contentDescription" />
114
115             <Switch
116                 android:id="@+id/domain_settings_first_party_cookies_switch"
117                 android:layout_height="wrap_content"
118                 android:layout_width="match_parent"
119                 android:layout_marginStart="8dp"
120                 android:layout_marginTop="14dp"
121                 android:layout_marginBottom="14dp"
122                 android:text="@string/first_party_cookies_enabled"
123                 android:textSize="18sp" />
124         </LinearLayout>
125
126         <!-- Third-Party Cookies. -->
127         <LinearLayout
128             android:layout_height="wrap_content"
129             android:layout_width="match_parent"
130             android:orientation="horizontal" >
131
132             <ImageView
133                 android:id="@+id/domain_settings_third_party_cookies_imageview"
134                 android:layout_height="wrap_content"
135                 android:layout_width="wrap_content"
136                 android:layout_marginTop="1dp"
137                 android:layout_marginEnd="10dp"
138                 android:layout_gravity="center_vertical"
139                 android:src="@drawable/cookies_enabled"
140                 android:tint="@color/domain_settings_icon_red_tint_selector"
141                 tools:ignore="contentDescription" />
142
143             <Switch
144                 android:id="@+id/domain_settings_third_party_cookies_switch"
145                 android:layout_height="wrap_content"
146                 android:layout_width="match_parent"
147                 android:layout_marginStart="8dp"
148                 android:layout_marginTop="14dp"
149                 android:layout_marginBottom="14dp"
150                 android:text="@string/third_party_cookies_enabled"
151                 android:textSize="18sp" />
152         </LinearLayout>
153
154         <!-- DOM Storage. -->
155         <LinearLayout
156             android:layout_height="wrap_content"
157             android:layout_width="match_parent"
158             android:orientation="horizontal" >
159
160             <ImageView
161                 android:id="@+id/domain_settings_dom_storage_imageview"
162                 android:layout_height="wrap_content"
163                 android:layout_width="wrap_content"
164                 android:layout_marginTop="1dp"
165                 android:layout_marginEnd="10dp"
166                 android:layout_gravity="center_vertical"
167                 android:src="@drawable/dom_storage_enabled"
168                 android:tint="@color/domain_settings_icon_yellow_tint_selector"
169                 tools:ignore="contentDescription" />
170
171             <Switch
172                 android:id="@+id/domain_settings_dom_storage_switch"
173                 android:layout_height="wrap_content"
174                 android:layout_width="match_parent"
175                 android:layout_marginStart="8dp"
176                 android:layout_marginTop="14dp"
177                 android:layout_marginBottom="14dp"
178                 android:text="@string/dom_storage_enabled"
179                 android:textSize="18sp" />
180         </LinearLayout>
181
182         <!-- Form Data. -->
183         <LinearLayout
184             android:layout_height="wrap_content"
185             android:layout_width="match_parent"
186             android:orientation="horizontal">
187
188             <ImageView
189                 android:id="@+id/domain_settings_form_data_imageview"
190                 android:layout_height="wrap_content"
191                 android:layout_width="wrap_content"
192                 android:layout_marginTop="1dp"
193                 android:layout_marginEnd="10dp"
194                 android:layout_gravity="center_vertical"
195                 android:src="@drawable/form_data_enabled"
196                 android:tint="@color/domain_settings_icon_yellow_tint_selector"
197                 tools:ignore="contentDescription" />
198
199             <Switch
200                 android:id="@+id/domain_settings_form_data_switch"
201                 android:layout_height="wrap_content"
202                 android:layout_width="match_parent"
203                 android:layout_marginStart="8dp"
204                 android:layout_marginTop="14dp"
205                 android:layout_marginBottom="14dp"
206                 android:text="@string/form_data_enabled"
207                 android:textSize="18sp" />
208         </LinearLayout>
209
210         <!-- User Agent. -->
211         <LinearLayout
212             android:layout_height="wrap_content"
213             android:layout_width="match_parent"
214             android:orientation="vertical"
215             android:layout_marginTop="14dp"
216             android:layout_marginBottom="14dp" >
217
218             <LinearLayout
219                 android:layout_height="wrap_content"
220                 android:layout_width="match_parent"
221                 android:orientation="horizontal">
222
223                 <ImageView
224                     android:layout_height="wrap_content"
225                     android:layout_width="wrap_content"
226                     android:layout_marginTop="1dp"
227                     android:layout_marginEnd="10dp"
228                     android:layout_gravity="center_vertical"
229                     android:src="@drawable/user_agent"
230                     android:tint="@color/blue_800"
231                     android:contentDescription="@string/user_agent" />
232
233                 <Spinner
234                     android:id="@+id/domain_settings_user_agent_spinner"
235                     android:layout_height="wrap_content"
236                     android:layout_width="match_parent"
237                     android:labelFor="@+id/domain_settings_custom_user_agent_edittext"/>
238             </LinearLayout>
239
240             <TextView
241                 android:id="@+id/domain_settings_user_agent_textview"
242                 android:layout_height="match_parent"
243                 android:layout_width="match_parent"
244                 android:layout_marginStart="43dp"
245                 android:layout_marginEnd="36dp"
246                 android:textSize="13sp"/>
247
248             <EditText
249                 android:id="@id/domain_settings_custom_user_agent_edittext"
250                 android:layout_height="wrap_content"
251                 android:layout_width="match_parent"
252                 android:layout_marginStart="38dp"
253                 android:layout_marginEnd="60dp"
254                 android:inputType="textUri" />
255         </LinearLayout>
256
257         <!-- Font Size. -->
258         <!-- 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. -->
259         <LinearLayout
260             android:layout_height="wrap_content"
261             android:layout_width="match_parent"
262             android:orientation="horizontal"
263             android:layout_marginBottom="14dp" >
264
265             <ImageView
266                 android:layout_height="wrap_content"
267                 android:layout_width="wrap_content"
268                 android:layout_marginTop="1dp"
269                 android:layout_marginEnd="10dp"
270                 android:layout_gravity="center_vertical"
271                 android:src="@drawable/font_size"
272                 android:tint="@color/blue_800"
273                 android:contentDescription="@string/font_size" />
274
275             <Spinner
276                 android:id="@+id/domain_settings_font_size_spinner"
277                 android:layout_height="wrap_content"
278                 android:layout_width="match_parent"
279                 android:layout_marginTop="14dp"
280                 android:layout_marginBottom="14dp"/>
281         </LinearLayout>
282     </LinearLayout>
283 </ScrollView>