-
Notifications
You must be signed in to change notification settings - Fork 215
/
WindowViewModel.java
641 lines (522 loc) · 24 KB
/
WindowViewModel.java
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
package org.mozilla.vrbrowser.ui.viewmodel;
import android.app.Application;
import android.content.res.Resources;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.ObservableBoolean;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MediatorLiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.VRBrowserApplication;
import org.mozilla.vrbrowser.browser.SettingsStore;
import org.mozilla.vrbrowser.ui.widgets.Windows;
import org.mozilla.vrbrowser.utils.ServoUtils;
import org.mozilla.vrbrowser.utils.UrlUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.concurrent.Executor;
public class WindowViewModel extends AndroidViewModel {
private Executor mUIThreadExecutor;
private int mURLProtocolColor;
private int mURLWebsiteColor;
private MutableLiveData<Spannable> url;
private MutableLiveData<String> hint;
private MutableLiveData<ObservableBoolean> isWindowVisible;
private MutableLiveData<Windows.WindowPlacement> placement;
private MutableLiveData<ObservableBoolean> isOnlyWindow;
private MutableLiveData<ObservableBoolean> isFullscreen;
private MediatorLiveData<ObservableBoolean> isTopBarVisible;
private MutableLiveData<ObservableBoolean> isResizeMode;
private MutableLiveData<ObservableBoolean> isPrivateSession;
private MediatorLiveData<ObservableBoolean> showClearButton;
private MutableLiveData<ObservableBoolean> isInsecure;
private MutableLiveData<ObservableBoolean> isActiveWindow;
private MediatorLiveData<ObservableBoolean> isTitleBarVisible;
private MutableLiveData<ObservableBoolean> isBookmarksVisible;
private MutableLiveData<ObservableBoolean> isHistoryVisible;
private MediatorLiveData<ObservableBoolean> isLibraryVisible;
private MutableLiveData<ObservableBoolean> isLoading;
private MutableLiveData<ObservableBoolean> isMicrophoneEnabled;
private MutableLiveData<ObservableBoolean> isBookmarked;
private MutableLiveData<ObservableBoolean> isFocused;
private MutableLiveData<ObservableBoolean> isUrlEmpty;
private MutableLiveData<ObservableBoolean> isPopUpAvailable;
private MutableLiveData<ObservableBoolean> canGoForward;
private MutableLiveData<ObservableBoolean> canGoBack;
private MutableLiveData<ObservableBoolean> isInVRVideo;
private MutableLiveData<ObservableBoolean> autoEnteredVRVideo;
private MediatorLiveData<ObservableBoolean> isServoAvailable;
private MediatorLiveData<String> titleBarUrl;
private MediatorLiveData<ObservableBoolean> isInsecureVisible;
private MutableLiveData<ObservableBoolean> isMediaAvailable;
private MutableLiveData<ObservableBoolean> isMediaPlaying;
private MediatorLiveData<String> navigationBarUrl;
public WindowViewModel(Application application) {
super(application);
mUIThreadExecutor = ((VRBrowserApplication)application).getExecutors().mainThread();
TypedValue typedValue = new TypedValue();
Resources.Theme theme = application.getTheme();
theme.resolveAttribute(R.attr.urlProtocolColor, typedValue, true);
mURLProtocolColor = typedValue.data;
theme.resolveAttribute(R.attr.urlWebsiteColor, typedValue, true);
mURLWebsiteColor = typedValue.data;
url = new MutableLiveData<>(new SpannableString(""));
hint = new MutableLiveData<>("");
isWindowVisible = new MutableLiveData<>(new ObservableBoolean(true));
placement = new MutableLiveData<>(Windows.WindowPlacement.FRONT);
isOnlyWindow = new MutableLiveData<>(new ObservableBoolean(false));
isFullscreen = new MutableLiveData<>(new ObservableBoolean(false));
isResizeMode = new MutableLiveData<>(new ObservableBoolean(false));
isPrivateSession = new MutableLiveData<>(new ObservableBoolean(false));
isTopBarVisible = new MediatorLiveData<>();
isTopBarVisible.addSource(isOnlyWindow, mIsTopBarVisibleObserver);
isTopBarVisible.addSource(isFullscreen, mIsTopBarVisibleObserver);
isTopBarVisible.addSource(isResizeMode, mIsTopBarVisibleObserver);
isTopBarVisible.addSource(isPrivateSession, mIsTopBarVisibleObserver);
isTopBarVisible.addSource(isWindowVisible, mIsTopBarVisibleObserver);
isTopBarVisible.setValue(new ObservableBoolean(true));
showClearButton = new MediatorLiveData<>();
showClearButton.addSource(isOnlyWindow, mShowClearButtonObserver);
showClearButton.addSource(isPrivateSession, mShowClearButtonObserver);
showClearButton.addSource(isResizeMode, mShowClearButtonObserver);
showClearButton.addSource(isFullscreen, mShowClearButtonObserver);
showClearButton.addSource(isWindowVisible, mShowClearButtonObserver);
showClearButton.setValue(new ObservableBoolean(false));
isInsecure = new MutableLiveData<>(new ObservableBoolean(false));
isActiveWindow = new MutableLiveData<>(new ObservableBoolean(false));
isTitleBarVisible = new MediatorLiveData<>();
isTitleBarVisible.addSource(isFullscreen, mIsTitleBarVisibleObserver);
isTitleBarVisible.addSource(isResizeMode, mIsTitleBarVisibleObserver);
isTitleBarVisible.addSource(isActiveWindow, mIsTitleBarVisibleObserver);
isTitleBarVisible.addSource(isWindowVisible, mIsTitleBarVisibleObserver);
isTitleBarVisible.addSource(isOnlyWindow, mIsTitleBarVisibleObserver);
isTitleBarVisible.setValue(new ObservableBoolean(true));
isBookmarksVisible = new MutableLiveData<>(new ObservableBoolean(false));
isHistoryVisible = new MutableLiveData<>(new ObservableBoolean(false));
isLibraryVisible = new MediatorLiveData<>();
isLibraryVisible.addSource(isBookmarksVisible, mIsLibraryVisibleObserver);
isLibraryVisible.addSource(isHistoryVisible, mIsLibraryVisibleObserver);
isLibraryVisible.setValue(new ObservableBoolean(false));
isLoading = new MutableLiveData<>(new ObservableBoolean(false));
isMicrophoneEnabled = new MutableLiveData<>(new ObservableBoolean(true));
isBookmarked = new MutableLiveData<>(new ObservableBoolean(false));
isFocused = new MutableLiveData<>(new ObservableBoolean(false));
isUrlEmpty = new MutableLiveData<>(new ObservableBoolean(true));
isPopUpAvailable = new MutableLiveData<>(new ObservableBoolean(false));
canGoForward = new MutableLiveData<>(new ObservableBoolean(false));
canGoBack = new MutableLiveData<>(new ObservableBoolean(false));
isInVRVideo = new MutableLiveData<>(new ObservableBoolean(false));
autoEnteredVRVideo = new MutableLiveData<>(new ObservableBoolean(false));
isServoAvailable = new MediatorLiveData<>();
isServoAvailable.addSource(url, mIsServoAvailableObserver);
isServoAvailable.setValue(new ObservableBoolean(false));
titleBarUrl = new MediatorLiveData<>();
titleBarUrl.addSource(url, mTitleBarUrlObserver);
titleBarUrl.setValue("");
isInsecureVisible = new MediatorLiveData<>();
isInsecureVisible.addSource(isInsecure, mIsInsecureVisibleObserver);
isInsecureVisible.addSource(isPrivateSession, mIsInsecureVisibleObserver);
isInsecureVisible.addSource(isLibraryVisible, mIsInsecureVisibleObserver);
isInsecureVisible.setValue(new ObservableBoolean(false));
isMediaAvailable = new MutableLiveData<>(new ObservableBoolean(false));
isMediaPlaying = new MutableLiveData<>(new ObservableBoolean(false));
navigationBarUrl = new MediatorLiveData<>();
navigationBarUrl.addSource(url, mNavigationBarUrlObserver);
navigationBarUrl.setValue("");
}
private Observer<ObservableBoolean> mIsTopBarVisibleObserver = new Observer<ObservableBoolean>() {
@Override
public void onChanged(ObservableBoolean o) {
if (isFullscreen.getValue().get() || isResizeMode.getValue().get() || !isWindowVisible.getValue().get()) {
isTopBarVisible.postValue(new ObservableBoolean(false));
} else {
if (isOnlyWindow.getValue().get()) {
isTopBarVisible.postValue(new ObservableBoolean(isPrivateSession.getValue().get()));
} else {
isTopBarVisible.postValue(new ObservableBoolean(true));
}
}
}
};
private Observer<ObservableBoolean> mShowClearButtonObserver = new Observer<ObservableBoolean>() {
@Override
public void onChanged(ObservableBoolean o) {
showClearButton.postValue(new ObservableBoolean(isWindowVisible.getValue().get() &&
isPrivateSession.getValue().get() && isOnlyWindow.getValue().get() &&
!isResizeMode.getValue().get() && !isFullscreen.getValue().get()));
}
};
private Observer<ObservableBoolean> mIsTitleBarVisibleObserver = new Observer<ObservableBoolean>() {
@Override
public void onChanged(ObservableBoolean o) {
if (isFullscreen.getValue().get() || isResizeMode.getValue().get() || isActiveWindow.getValue().get()) {
isTitleBarVisible.postValue(new ObservableBoolean(false));
} else {
isTitleBarVisible.postValue(new ObservableBoolean(isWindowVisible.getValue().get() && !isOnlyWindow.getValue().get()));
}
}
};
private Observer<ObservableBoolean> mIsLibraryVisibleObserver = new Observer<ObservableBoolean>() {
@Override
public void onChanged(ObservableBoolean o) {
isLibraryVisible.postValue(new ObservableBoolean(isBookmarksVisible.getValue().get() || isHistoryVisible.getValue().get()));
// We use this to force dispatch a title bar and navigation bar URL refresh when library is opened
url.postValue(url.getValue());
}
};
private Observer<Spannable> mIsServoAvailableObserver = new Observer<Spannable>() {
@Override
public void onChanged(Spannable url) {
boolean isPrefEnabled = SettingsStore.getInstance(getApplication()).isServoEnabled();
boolean isUrlWhiteListed = ServoUtils.isUrlInServoWhiteList(getApplication(), url.toString());
isServoAvailable.postValue(new ObservableBoolean(isPrefEnabled && isUrlWhiteListed));
}
};
private Observer<Spannable> mTitleBarUrlObserver = new Observer<Spannable>() {
@Override
public void onChanged(Spannable aUrl) {
String url = aUrl.toString();
if (isBookmarksVisible.getValue().get()) {
url = getApplication().getString(R.string.url_bookmarks_title);
} else if (isHistoryVisible.getValue().get()) {
url = getApplication().getString(R.string.url_history_title);
} else {
if (UrlUtils.isPrivateAboutPage(getApplication(), url) ||
(UrlUtils.isDataUri(url) && isPrivateSession.getValue().get())) {
url = getApplication().getString(R.string.private_browsing_title);
} else if (UrlUtils.isHomeUri(getApplication(), aUrl.toString())) {
url = getApplication().getString(R.string.url_home_title, getApplication().getString(R.string.app_name));
} else if (UrlUtils.isBlankUri(getApplication(), aUrl.toString())) {
url = "";
}
}
titleBarUrl.postValue(UrlUtils.titleBarUrl(url));
}
};
private Observer<ObservableBoolean> mIsInsecureVisibleObserver = new Observer<ObservableBoolean>() {
@Override
public void onChanged(ObservableBoolean o) {
String aUrl = url.getValue().toString();
if (isInsecure.getValue().get()) {
if (UrlUtils.isPrivateAboutPage(getApplication(), aUrl) ||
(UrlUtils.isDataUri(aUrl) && isPrivateSession.getValue().get()) ||
UrlUtils.isHomeUri(getApplication(), aUrl) ||
isLibraryVisible.getValue().get() ||
UrlUtils.isBlankUri(getApplication(), aUrl)) {
isInsecureVisible.postValue(new ObservableBoolean(false));
} else {
isInsecureVisible.postValue(new ObservableBoolean(true));
}
} else {
isInsecureVisible.postValue(new ObservableBoolean(false));
}
}
};
private Observer<Spannable> mNavigationBarUrlObserver = new Observer<Spannable>() {
@Override
public void onChanged(Spannable aUrl) {
String url = aUrl.toString();
if (UrlUtils.isPrivateAboutPage(getApplication(), url) ||
(UrlUtils.isDataUri(url) && isPrivateSession.getValue().get()) ||
UrlUtils.isHomeUri(getApplication(), aUrl.toString()) ||
isLibraryVisible.getValue().get() ||
UrlUtils.isBlankUri(getApplication(), aUrl.toString())) {
navigationBarUrl.postValue("");
} else {
navigationBarUrl.postValue(url);
}
hint.postValue(getHintValue());
}
};
public void refresh() {
url.postValue(url.getValue());
hint.postValue(getHintValue());
isWindowVisible.postValue(isWindowVisible.getValue());
placement.postValue(placement.getValue());
isOnlyWindow.postValue(isOnlyWindow.getValue());
isFullscreen.postValue(isFullscreen.getValue());
isResizeMode.postValue(isResizeMode.getValue());
isPrivateSession.postValue(isPrivateSession.getValue());
isInsecure.postValue(isInsecure.getValue());
isLoading.postValue(isLoading.getValue());
isMicrophoneEnabled.postValue(isMicrophoneEnabled.getValue());
isBookmarked.postValue(isBookmarked.getValue());
isFocused.postValue(isFocused.getValue());
isUrlEmpty.postValue(isUrlEmpty.getValue());
isPopUpAvailable.postValue(isPopUpAvailable.getValue());
canGoForward.postValue(canGoForward.getValue());
canGoBack.postValue(canGoBack.getValue());
isInVRVideo.postValue(isInVRVideo.getValue());
autoEnteredVRVideo.postValue(autoEnteredVRVideo.getValue());
titleBarUrl.setValue(titleBarUrl.getValue());
isMediaAvailable.postValue(isMediaAvailable.getValue());
isMediaPlaying.postValue(isMediaPlaying.getValue());
}
@NonNull
public MutableLiveData<Spannable> getUrl() {
if (url == null) {
url = new MutableLiveData<>(new SpannableString(""));
}
return url;
}
public void setUrl(@Nullable String url) {
if (url == null) {
return;
}
setUrl(new SpannableString(url));
}
public void setUrl(@Nullable Spannable url) {
if (url == null) {
return;
}
String aURL = url.toString();
if (isLibraryVisible.getValue().get()) {
return;
}
int index = -1;
try {
aURL = URLDecoder.decode(aURL, "UTF-8");
} catch (UnsupportedEncodingException | IllegalArgumentException e) {
e.printStackTrace();
aURL = "";
}
if (aURL.startsWith("jar:")) {
return;
} else if (aURL.startsWith("resource:") || UrlUtils.isHomeUri(getApplication().getBaseContext(), aURL)) {
aURL = "";
} else if (aURL.startsWith("data:") && isPrivateSession.getValue().get()) {
aURL = "";
} else if (aURL.startsWith(getApplication().getBaseContext().getString(R.string.about_blank))) {
aURL = "";
} else {
index = aURL.indexOf("://");
}
// Update the URL bar only if the URL is different than the current one and
// the URL bar is not focused to avoid override user input
if (!getUrl().getValue().toString().equalsIgnoreCase(aURL) && !getIsFocused().getValue().get()) {
this.url.postValue(new SpannableString(aURL));
if (index > 0) {
SpannableString spannable = new SpannableString(aURL);
ForegroundColorSpan color1 = new ForegroundColorSpan(mURLProtocolColor);
ForegroundColorSpan color2 = new ForegroundColorSpan(mURLWebsiteColor);
spannable.setSpan(color1, 0, index + 3, 0);
spannable.setSpan(color2, index + 3, aURL.length(), 0);
this.url.postValue(url);
} else {
this.url.postValue(url);
}
}
this.url.postValue(url);
}
@NonNull
public MutableLiveData<String> getHint() {
return hint;
}
private String getHintValue() {
if (isBookmarksVisible.getValue().get()) {
return getApplication().getString(R.string.url_bookmarks_title);
} else if (isHistoryVisible.getValue().get()) {
return getApplication().getString(R.string.url_history_title);
} else {
return getApplication().getString(R.string.search_placeholder);
}
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsWindowVisible() {
return isWindowVisible;
}
public void setIsWindowVisible(boolean isWindowVisible) {
this.isWindowVisible.postValue(new ObservableBoolean(isWindowVisible));
}
@NonNull
public MutableLiveData<Windows.WindowPlacement> getPlacement() {
return placement;
}
public void setPlacement(Windows.WindowPlacement placement) {
this.placement.postValue(placement);
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsOnlyWindow() {
return isOnlyWindow;
}
public void setIsOnlyWindow(boolean isOnlyWindow) {
this.isOnlyWindow.postValue(new ObservableBoolean(isOnlyWindow));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsFullscreen() {
return isFullscreen;
}
public void setIsFullscreen(boolean isFullscreen) {
this.isFullscreen.postValue(new ObservableBoolean(isFullscreen));
}
@NonNull
public MediatorLiveData<ObservableBoolean> getIsTopBarVisible() {
return isTopBarVisible;
}
public void setIsTopBarVisible(boolean isTopBarVisible) {
this.isTopBarVisible.postValue(new ObservableBoolean(isTopBarVisible));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsResizeMode() {
return isResizeMode;
}
public void setIsResizeMode(boolean isResizeMode) {
this.isResizeMode.postValue(new ObservableBoolean(isResizeMode));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsPrivateSession() {
return isPrivateSession;
}
public void setIsPrivateSession(boolean isPrivateSession) {
this.isPrivateSession.postValue(new ObservableBoolean(isPrivateSession));
}
@NonNull
public MutableLiveData<ObservableBoolean> getShowClearButton() {
return showClearButton;
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsInsecure() {
return isInsecure;
}
public void setIsInsecure(boolean isInsecure) {
this.isInsecure.postValue(new ObservableBoolean(isInsecure));
}
@NonNull
public MediatorLiveData<ObservableBoolean> getIsTitleBarVisible() {
return isTitleBarVisible;
}
public void setIsTitleBarVisible(boolean isTitleBarVisible) {
this.isTitleBarVisible.postValue(new ObservableBoolean(isTitleBarVisible));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsActiveWindow() {
return isActiveWindow;
}
public void setIsActiveWindow(boolean isActiveWindow) {
this.isActiveWindow.postValue(new ObservableBoolean(isActiveWindow));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsBookmraksVisible() {
return isBookmarksVisible;
}
public void setIsBookmarksVisible(boolean isBookmarksVisible) {
this.isBookmarksVisible.postValue(new ObservableBoolean(isBookmarksVisible));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsHistoryVisible() {
return isHistoryVisible;
}
public void setIsHistoryVisible(boolean isHistoryVisible) {
this.isHistoryVisible.postValue(new ObservableBoolean(isHistoryVisible));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsLibraryVisible() {
return isLibraryVisible;
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsLoading() {
return isLoading;
}
public void setIsLoading(boolean isLoading) {
this.isLoading.postValue(new ObservableBoolean(isLoading));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsMicrophoneEnabled() {
return isMicrophoneEnabled;
}
public void setIsMicrophoneEnabled(boolean isMicrophoneEnabled) {
this.isMicrophoneEnabled.postValue(new ObservableBoolean(isMicrophoneEnabled));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsBookmarked() {
return isBookmarked;
}
public void setIsBookmarked(boolean isBookmarked) {
this.isBookmarked.postValue(new ObservableBoolean(isBookmarked));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsFocused() {
return isFocused;
}
public void setIsFocused(boolean isFocused) {
this.isFocused.postValue(new ObservableBoolean(isFocused));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsUrlEmpty() {
return isUrlEmpty;
}
public void setIsUrlEmpty(boolean isUrlEmpty) {
this.isUrlEmpty.postValue(new ObservableBoolean(isUrlEmpty));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsPopUpAvailable() {
return isPopUpAvailable;
}
public void setIsPopUpAvailable(boolean isPopUpAvailable) {
this.isPopUpAvailable.postValue(new ObservableBoolean(isPopUpAvailable));
}
@NonNull
public MutableLiveData<ObservableBoolean> getCanGoForward() {
return canGoForward;
}
public void setCanGoForward(boolean canGoForward) {
this.canGoForward.postValue(new ObservableBoolean(canGoForward));
}
@NonNull
public MutableLiveData<ObservableBoolean> getCanGoBack() {
return canGoBack;
}
public void setCanGoBack(boolean canGoBack) {
this.canGoBack.postValue(new ObservableBoolean(canGoBack));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsInVRVideo() {
return isInVRVideo;
}
public void setIsInVRVideo(boolean isInVRVideo) {
this.isInVRVideo.postValue(new ObservableBoolean(isInVRVideo));
}
@NonNull
public MutableLiveData<ObservableBoolean> getAutoEnteredVRVideo() {
return autoEnteredVRVideo;
}
public void setAutoEnteredVRVideo(boolean autoEnteredVRVideo) {
this.autoEnteredVRVideo.postValue(new ObservableBoolean(autoEnteredVRVideo));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsServoAvailable() {
return isServoAvailable;
}
@NonNull
public MediatorLiveData<String> getTitleBarUrl() {
return titleBarUrl;
}
@NonNull
public MediatorLiveData<ObservableBoolean> getIsInsecureVisible() {
return isInsecureVisible;
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsMediaAvailable() {
return isMediaAvailable;
}
public void setIsMediaAvailable(boolean isMediaAvailable) {
this.isMediaAvailable.postValue(new ObservableBoolean(isMediaAvailable));
}
@NonNull
public MutableLiveData<ObservableBoolean> getIsMediaPlaying() {
return isMediaPlaying;
}
public void setIsMediaPlaying(boolean isMediaPlaying) {
this.isMediaPlaying.postValue(new ObservableBoolean(isMediaPlaying));
}
@NonNull
public MutableLiveData<String> getNavigationBarUrl() {
return navigationBarUrl;
}
}