|
3 | 3 | xmlns:tools="http://schemas.android.com/tools"> |
4 | 4 |
|
5 | 5 | <data> |
6 | | - <variable name="widget" type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget"/> |
7 | | - <variable name="delegate" type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget.Delegate"/> |
8 | | - </data> |
9 | 6 |
|
| 7 | + <import type="android.view.View" /> |
| 8 | + |
| 9 | + <variable |
| 10 | + name="widget" |
| 11 | + type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget" /> |
| 12 | + |
| 13 | + <variable |
| 14 | + name="delegate" |
| 15 | + type="org.mozilla.vrbrowser.ui.widgets.TitleBarWidget.Delegate" /> |
| 16 | + |
| 17 | + <variable |
| 18 | + name="isMediaPlaying" |
| 19 | + type="boolean" /> |
| 20 | + |
| 21 | + <variable |
| 22 | + name="isMediaAvailable" |
| 23 | + type="boolean" /> |
| 24 | + </data> |
10 | 25 |
|
11 | 26 | <LinearLayout |
12 | | - android:id="@+id/title_bar" |
13 | | - style="?attr/navigationBarStyle" |
14 | | - android:background="@drawable/title_bar_background" |
15 | | - android:layout_width="300dp" |
16 | | - android:layout_height="40dp" |
| 27 | + android:layout_width="@dimen/title_bar_width" |
| 28 | + android:layout_height="wrap_content" |
17 | 29 | android:layout_gravity="center" |
18 | 30 | android:gravity="center_horizontal" |
19 | | - android:orientation="horizontal" |
20 | | - android:focusable="true" |
21 | | - android:clickable="true" |
22 | | - android:onClick="@{(view) -> delegate != null ? delegate.onTitleClicked(widget) : void}" |
23 | | - android:padding="10dp"> |
24 | | - |
25 | | - <ImageView |
26 | | - android:id="@+id/insecureIcon" |
27 | | - android:layout_width="30dp" |
28 | | - android:layout_height="30dp" |
29 | | - android:layout_gravity="center_vertical" |
30 | | - android:contentDescription="SSL icon" |
31 | | - android:padding="5dp" |
32 | | - android:duplicateParentState="true" |
33 | | - android:tint="@color/rhino" |
34 | | - android:visibility="gone" |
35 | | - android:src="@drawable/ic_icon_security_state_insecure" /> |
36 | | - |
37 | | - <TextView |
38 | | - android:id="@+id/url" |
39 | | - android:paddingStart="5dp" |
40 | | - android:paddingEnd="5dp" |
41 | | - android:layout_width="wrap_content" |
42 | | - android:layout_height="wrap_content" |
43 | | - android:layout_gravity="center_vertical" |
44 | | - android:duplicateParentState="true" |
45 | | - android:contentDescription="Page URL" |
46 | | - android:ellipsize="none" |
47 | | - android:fadingEdgeLength="80dp" |
48 | | - android:requiresFadingEdge="horizontal" |
49 | | - android:singleLine="true" |
50 | | - tools:text="http://mozilla.org" /> |
| 31 | + android:orientation="horizontal"> |
| 32 | + |
| 33 | + <LinearLayout |
| 34 | + android:id="@+id/title_bar" |
| 35 | + style="?attr/navigationBarStyle" |
| 36 | + android:layout_width="260dp" |
| 37 | + android:layout_height="match_parent" |
| 38 | + android:layout_gravity="center" |
| 39 | + android:background="@drawable/title_bar_background" |
| 40 | + android:clickable="true" |
| 41 | + android:focusable="true" |
| 42 | + android:gravity="center_horizontal" |
| 43 | + android:onClick="@{(view) -> delegate != null ? delegate.onTitleClicked(widget) : void}" |
| 44 | + android:orientation="horizontal" |
| 45 | + android:padding="10dp"> |
| 46 | + |
| 47 | + <ImageView |
| 48 | + android:id="@+id/insecureIcon" |
| 49 | + android:layout_width="30dp" |
| 50 | + android:layout_height="30dp" |
| 51 | + android:layout_gravity="center_vertical" |
| 52 | + android:contentDescription="SSL icon" |
| 53 | + android:duplicateParentState="true" |
| 54 | + android:padding="5dp" |
| 55 | + android:src="@drawable/ic_icon_security_state_insecure" |
| 56 | + android:tint="@color/rhino" |
| 57 | + android:visibility="gone" /> |
| 58 | + |
| 59 | + <TextView |
| 60 | + android:id="@+id/url" |
| 61 | + android:layout_width="wrap_content" |
| 62 | + android:layout_height="wrap_content" |
| 63 | + android:layout_gravity="center_vertical" |
| 64 | + android:contentDescription="Page URL" |
| 65 | + android:duplicateParentState="true" |
| 66 | + android:ellipsize="none" |
| 67 | + android:fadingEdgeLength="80dp" |
| 68 | + android:paddingStart="5dp" |
| 69 | + android:paddingEnd="5dp" |
| 70 | + android:requiresFadingEdge="horizontal" |
| 71 | + android:singleLine="true" |
| 72 | + tools:text="http://mozilla.org" /> |
| 73 | + </LinearLayout> |
| 74 | + |
| 75 | + <org.mozilla.vrbrowser.ui.views.UIButton |
| 76 | + android:id="@+id/mediaButton" |
| 77 | + style="?attr/navigationBarButtonStyle" |
| 78 | + android:src="@{isMediaPlaying ? @drawable/ic_icon_media_pause : @drawable/ic_icon_media_play}" |
| 79 | + android:onClick="@{(view) -> isMediaPlaying ? delegate.onMediaPauseClicked(widget) : delegate.onMediaPlayClicked(widget)}" |
| 80 | + android:tooltipText="@{isMediaPlaying ? @string/media_pause_tooltip : @string/media_resume_tooltip}" |
| 81 | + android:visibility="@{isMediaAvailable ? View.VISIBLE : View.GONE}" /> |
51 | 82 | </LinearLayout> |
52 | 83 | </layout> |
0 commit comments