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