Revision control
Copy as Markdown
<?xml version="1.0" encoding="utf-8"?>
<data>
<import type="android.view.View" />
<import type="org.mozilla.vrbrowser.utils.UrlUtils" />
<variable
name="viewmodel"
type="org.mozilla.vrbrowser.ui.viewmodel.WindowViewModel" />
<variable
name="widget"
type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget" />
<variable
name="delegate"
type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget.Delegate" />
<variable
name="isMediaPlaying"
type="boolean" />
<variable
name="isMediaAvailable"
type="boolean" />
</data>
<LinearLayout
android:layout_width="@dimen/title_bar_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/title_bar"
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@{(viewmodel.isPrivateSession ? @drawable/title_bar_background_private : @drawable/title_bar_background)}"
android:clickable="true"
android:focusable="true"
android:gravity="center_horizontal"
android:onClick="@{(view) -> delegate != null ? delegate.onTitleClicked(widget) : void}"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="@+id/insecureIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:contentDescription="SSL icon"
android:duplicateParentState="true"
android:padding="5dp"
android:src="@drawable/ic_icon_security_state_insecure"
android:tint="@color/rhino"
app:visibleGone="@{viewmodel.isInsecureVisible}" />
<TextView
android:id="@+id/url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="Page URL"
android:duplicateParentState="true"
android:ellipsize="none"
android:fadingEdgeLength="80dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:requiresFadingEdge="horizontal"
android:singleLine="true"
android:textColor="@color/fog"
tools:text="@{viewmodel.titleBarUrl}" />
</LinearLayout>
<org.mozilla.vrbrowser.ui.views.UIButton
android:id="@+id/mediaButton"
style="?attr/navigationBarButtonStyle"
android:src="@{viewmodel.isMediaPlaying ? @drawable/ic_icon_media_pause : @drawable/ic_icon_media_play}"
android:onClick="@{(view) -> viewmodel.isMediaPlaying ? delegate.onMediaPauseClicked(widget) : delegate.onMediaPlayClicked(widget)}"
android:tooltipText="@{viewmodel.isMediaPlaying ? @string/media_pause_tooltip : @string/media_resume_tooltip}"
android:visibility="@{viewmodel.isMediaAvailable ? View.VISIBLE : View.GONE}"
app:privateMode="@{viewmodel.isPrivateSession}"/>
</LinearLayout>
</layout>