layout_player_controller_vod_p.xml
4.76 KB
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
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.databinding.ObservableField"/>
<import type="android.databinding.ObservableBoolean"/>
<import type="android.databinding.ObservableLong"/>
<import type="com.cnlive.gundam.video.utils.PlayerUtils"/>
<import type="com.cnlive.gundam.video.view.PlayerControllerView"/>
<import type="android.view.View"/>
<variable
name="title"
type="ObservableField<String>"/>
<variable
name="showController"
type="ObservableBoolean"/>
<variable
name="isPlay"
type="ObservableBoolean"/>
<variable
name="curProgress"
type="ObservableLong"/>
<variable
name="durProgress"
type="ObservableLong"/>
<variable
name="playerControllerView"
type="PlayerControllerView"/>
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#44000000"
android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginLeft="50dp"
android:gravity="center"
android:textColor="@android:color/white"
android:text="@{title.get()}" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/bottomLayout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#44000000"
android:layout_alignParentBottom="true"
android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}">
<ImageView
android:id="@+id/playBtn"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="10dp"
android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}"
android:onClick="@{playerControllerView.onClick}"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/curTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/playBtn"
android:text="@{PlayerUtils.stringForTime(curProgress.get() / 1000)}"
android:textColor="@android:color/white"
android:layout_centerVertical="true"/>
<SeekBar
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/curTime"
android:layout_toLeftOf="@+id/durTime"
android:progress="@{(int)(curProgress.get() / 1000)}"
android:max="@{(int)(durProgress.get() / 1000)}"
android:layout_centerVertical="true"
android:onSeekBarChangeListener="@{playerControllerView}"/>
<TextView
android:id="@+id/durTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{PlayerUtils.stringForTime(durProgress.get() / 1000)}"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/fullScreen"
android:textColor="@android:color/white"
android:layout_centerVertical="true"/>
<ImageView
android:id="@+id/fullScreen"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/player_full_screen"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:onClick="@{playerControllerView.onClick}"/>
</RelativeLayout>
<ImageView
android:id="@+id/back"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/player_back"
android:layout_marginLeft="10dp"
android:onClick="@{playerControllerView.onClick}"/>
</RelativeLayout>
</layout>