-
Notifications
You must be signed in to change notification settings - Fork 215
/
navigation_url.xml
256 lines (239 loc) · 16.4 KB
/
navigation_url.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="org.mozilla.vrbrowser.utils.UrlUtils"/>
<import type="org.mozilla.vrbrowser.ui.views.CustomInlineAutocompleteEditText" />
<variable
name="viewmodel"
type="org.mozilla.vrbrowser.ui.viewmodel.WindowViewModel" />
<variable
name="settingsViewmodel"
type="org.mozilla.vrbrowser.ui.viewmodel.SettingsViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:addStatesFromChildren="true">
<RelativeLayout
android:id="@+id/navigation_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:background="@{viewmodel.isPrivateSession ? @drawable/url_background_private : @drawable/url_background}"
android:foreground="@{viewmodel.isPrivateSession ? @drawable/url_background_private_outline : @drawable/url_background_outline}">
<LinearLayout
android:id="@+id/startButtonsLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_marginStart="2dp"
android:addStatesFromChildren="true"
android:orientation="horizontal"
app:visibleGone="@{!viewmodel.isFocused && viewmodel.isUrlBarButtonsVisible}">
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/tracking"
style="@style/urlBarIconThemeStart"
android:paddingStart="6dp"
android:paddingEnd="2dp"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:src="@{viewmodel.isTrackingEnabled ? @drawable/ic_icon_tracking_enabled : @drawable/ic_icon_tracking_disabled}"
tools:src="@drawable/ic_icon_tracking_enabled"
app:privateMode="@{viewmodel.isPrivateSession}"
android:tint="@color/fog"
app:visibleGone="@{!UrlUtils.isPrivateAboutPage(context, viewmodel.url.toString()) && settingsViewmodel.isTrackingProtectionEnabled && !UrlUtils.isContentFeed(context, viewmodel.url.toString())}"
android:tooltipText="@{viewmodel.isTrackingEnabled ? @string/tracking_allowed_tooltip : @string/tracking_disabled_tooltip}" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:visibleGone="@{viewmodel.isDrmUsed}">
<LinearLayout
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/rhino"
visibleGone="@{settingsViewmodel.isTrackingProtectionEnabled}" />
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/drm"
style="@style/urlBarIconTheme"
android:layout_width="@{!settingsViewmodel.isTrackingProtectionEnabled ? @dimen/url_bar_first_item_width : @dimen/url_bar_item_width}"
app:regularModeBackground="@{!settingsViewmodel.isTrackingProtectionEnabled ? @drawable/url_button_start : @drawable/url_button}"
app:privateModeBackground="@{!settingsViewmodel.isTrackingProtectionEnabled ? @drawable/url_button_start_private : @drawable/url_button_private}"
android:paddingStart="@{settingsViewmodel.isTrackingProtectionEnabled ? @dimen/navigation_bar_icon_padding_small : @dimen/navigation_bar_icon_padding_big}"
android:paddingEnd="2dp"
android:src="@{settingsViewmodel.isDrmEnabled ? @drawable/ic_icon_drm_allowed : @drawable/ic_icon_drm_blocked}"
tools:src="@drawable/ic_icon_drm_allowed"
android:tint="@color/fog"
android:tooltipText="@{settingsViewmodel.isDrmEnabled ? @string/drm_enabled_tooltip : @string/drm_disabled_tooltip}"
app:privateMode="@{viewmodel.isPrivateSession}" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:visibleGone="@{settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpAvailable}">
<LinearLayout
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/rhino"
visibleGone="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)}" />
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/popup"
style="@style/urlBarIconTheme"
android:layout_width="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @dimen/url_bar_first_item_width : @dimen/url_bar_item_width}"
app:regularModeBackground="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @drawable/url_button_start : @drawable/url_button}"
app:privateModeBackground="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @drawable/url_button_start_private : @drawable/url_button_private}"
android:paddingStart="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed) ? @dimen/navigation_bar_icon_padding_small : @dimen/navigation_bar_icon_padding_big}"
android:paddingEnd="2dp"
android:src="@{viewmodel.isPopUpBlocked ? @drawable/ic_icon_popup_blocked : @drawable/ic_icon_popup}"
tools:src="@drawable/ic_icon_popup_blocked"
android:tint="@color/fog"
android:tooltipText="@string/popup_tooltip"
app:privateMode="@{viewmodel.isPrivateSession}" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:visibleGone="@{settingsViewmodel.isWebXREnabled && viewmodel.isWebXRUsed}">
<LinearLayout
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/rhino"
visibleGone="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)}"/>
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/webxr"
style="@style/urlBarIconTheme"
android:layout_width="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @dimen/url_bar_first_item_width : @dimen/url_bar_item_width}"
app:regularModeBackground="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @drawable/url_button_start : @drawable/url_button}"
app:privateModeBackground="@{(!settingsViewmodel.isTrackingProtectionEnabled && !(settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) && !(settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed)) ? @drawable/url_button_start_private : @drawable/url_button_private}"
android:paddingStart="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed) ? @dimen/navigation_bar_icon_padding_small : @dimen/navigation_bar_icon_padding_big}"
android:paddingEnd="2dp"
android:src="@{viewmodel.isWebXRBlocked ? @drawable/ic_icon_webxr_blocked : @drawable/ic_icon_webxr_allowed}"
tools:src="@drawable/ic_icon_webxr_blocked"
app:privateMode="@{viewmodel.isPrivateSession}"
android:tint="@color/fog"
android:tooltipText="@{viewmodel.isWebXRBlocked ? @string/webxr_blocked_tooltip : @string/webxr_allowed_tooltip}" />
</LinearLayout>
<View
android:layout_width="4dp"
android:layout_height="match_parent"
app:visibleGone="@{!viewmodel.isUrlBarIconsVisible}"/>
</LinearLayout>
<View
android:id="@+id/padding"
android:layout_width="15dp"
android:layout_height="match_parent"
android:layout_toEndOf="@id/startButtonsLayout"
app:visibleGone="@{!viewmodel.isUrlBarButtonsVisible || viewmodel.isFocused}"/>
<LinearLayout
android:id="@+id/icons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_toEndOf="@id/padding"
android:layout_centerVertical="true"
app:visibleGone="@{viewmodel.isUrlBarIconsVisible && !viewmodel.isFocused}">
<ImageView
android:id="@+id/loadingView"
android:layout_width="24dp"
android:layout_height="24dp"
android:paddingEnd="5dp"
android:contentDescription="Loading animation"
android:src="@drawable/loading_shape"
app:visibleGone="@{viewmodel.isLoading}" />
<ImageView
android:id="@+id/insecureIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="SSL icon"
android:src="@drawable/ic_icon_security_state_insecure"
app:visibleGone="@{viewmodel.isInsecureVisible}" />
</LinearLayout>
<org.mozilla.vrbrowser.ui.views.CustomInlineAutocompleteEditText
android:id="@+id/urlEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingEnd="10dp"
android:layout_toStartOf="@id/endButtonsLayout"
android:layout_toEndOf="@id/icons"
android:foreground="@{viewmodel.isUrlEmpty ? (viewmodel.isPrivateSession ? @drawable/url_bar_hint_fading_edge_private : @drawable/url_bar_hint_fading_edge) : null}"
android:foregroundGravity="fill_vertical|right"
android:ems="10"
android:fadingEdgeLength="40dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:hint="@{viewmodel.hint}"
android:imeOptions="actionGo"
android:inputType="textUri"
android:requiresFadingEdge="horizontal"
android:selectAllOnFocus="true"
android:textColor="@color/fog"
android:textColorHighlight="@color/azure"
android:textIsSelectable="true"
android:textSize="16sp"
android:text="@{viewmodel.navigationBarUrl}"
app:autocompleteBackgroundColor="@color/azure" />
<LinearLayout
android:id="@+id/endButtonsLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical|end"
android:addStatesFromChildren="true"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_marginEnd="2dp"
android:orientation="horizontal">
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/microphoneButton"
style="@style/urlBarIconTheme"
android:layout_width="@{(viewmodel.isLibraryVisible || viewmodel.isUrlEmpty) ? @dimen/url_bar_last_item_width : @dimen/url_bar_item_width}"
android:background="@{(viewmodel.isLibraryVisible || viewmodel.isUrlEmpty) ? (viewmodel.isPrivateSession ? @drawable/url_button_end_private : @drawable/url_button_end) : (viewmodel.isPrivateSession ? @drawable/url_button_private : @drawable/url_button)}"
android:src="@drawable/ic_icon_microphone"
android:tint="@color/fog"
android:tooltipText="@string/voice_search_tooltip"
app:privateMode="@{viewmodel.isPrivateSession}"
app:visibleGone="@{viewmodel.isMicrophoneEnabled && !viewmodel.isFocused}"/>
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/bookmarkButton"
style="@style/urlBarIconThemeEnd"
android:src="@{viewmodel.isBookmarked ? @drawable/ic_icon_bookmarked_active : @drawable/ic_icon_bookmarked}"
android:tint="@color/fog"
android:tooltipText="@{viewmodel.isBookmarked ? @string/remove_bookmark_tooltip : @string/bookmark_tooltip}"
app:privateMode="@{viewmodel.isPrivateSession}"
app:visibleGone="@{!(viewmodel.isLibraryVisible || viewmodel.isUrlEmpty) && !viewmodel.isFocused}"
tools:src="@drawable/ic_icon_bookmarked" />
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/clearButton"
style="@style/urlBarIconThemeEnd"
android:src="@drawable/ic_icon_clear"
android:tint="@color/fog"
android:tooltipText="@string/clear_tooltip"
app:privateMode="@{viewmodel.isPrivateSession}"
app:visibleGone="@{viewmodel.isFocused && !viewmodel.isUrlEmpty}" />
</LinearLayout>
</RelativeLayout>
</FrameLayout>
</layout>