OLD | NEW |
1 <?xml version="1.0" encoding="utf-8"?> | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. | 2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. --> | 4 found in the LICENSE file. --> |
5 | 5 |
6 <!-- | 6 <!-- |
7 Notification layout for media controls. | 7 Notification layout for media controls. Could have one or two buttons |
| 8 depending on the corresponding media. |
| 9 Local playback notification has one play/pause button on L+ but two buttons, |
| 10 play/pause and stop button, on earlier Android versions as the notification |
| 11 can't be dismissed by the swiping gesture. |
| 12 Cast notification always has the stop button that stops casting but only has |
| 13 the play/pause button if the Cast application controlled by the notification |
| 14 supports play/pause. |
| 15 The notification button ids are numbered from the right, so "R.id.button1" is |
| 16 always present and "R.id.button2" may have the visibility GONE. |
8 _______________________________________________________ | 17 _______________________________________________________ |
9 | | | | | 18 | | | | |
10 | | Playing [media title] | | | 19 | | [media title] | | |
11 | ICON | =====0============================= | || | | 20 | ICON |======================================| || | |
12 | | [www.example.com] | | | 21 | | [www.example.com] | | |
13 |________|______________________________________|_____| | 22 |________|______________________________________|_____| |
| 23 _______________________________________________________ |
| 24 | | | | | |
| 25 | | [Cast device name] | | | |
| 26 | ICON |================================| || | X | |
| 27 | | [www.example.com] | | | |
| 28 |________|________________________________|_____|_____| |
14 --> | 29 --> |
15 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 30 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
16 android:layout_width="match_parent" | 31 android:layout_width="match_parent" |
17 android:layout_height="wrap_content" | 32 android:layout_height="wrap_content" |
18 android:gravity="center_vertical"> | 33 android:gravity="center_vertical"> |
19 | 34 |
20 <FrameLayout | 35 <FrameLayout |
21 android:layout_width="@android:dimen/notification_large_icon_width" | 36 android:layout_width="@android:dimen/notification_large_icon_width" |
22 android:layout_height="@android:dimen/notification_large_icon_height" > | 37 android:layout_height="@android:dimen/notification_large_icon_height" > |
23 | 38 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 android:layout_width="match_parent" | 72 android:layout_width="match_parent" |
58 android:layout_height="wrap_content" | 73 android:layout_height="wrap_content" |
59 android:layout_gravity="start" | 74 android:layout_gravity="start" |
60 android:ellipsize="end" | 75 android:ellipsize="end" |
61 android:singleLine="true" | 76 android:singleLine="true" |
62 style="@style/MediaNotificationText"/> | 77 style="@style/MediaNotificationText"/> |
63 | 78 |
64 </LinearLayout> | 79 </LinearLayout> |
65 | 80 |
66 <ImageButton | 81 <ImageButton |
67 android:id="@+id/playpause" | 82 android:id="@+id/button2" |
68 android:src="@drawable/ic_vidcontrol_play" | 83 android:src="@drawable/ic_vidcontrol_play" |
69 android:layout_width="wrap_content" | 84 android:layout_width="40dp" |
| 85 android:layout_height="match_parent" |
| 86 android:layout_marginStart="8dp" |
| 87 android:gravity="center" |
| 88 android:padding="8dp" |
| 89 android:scaleType="center" |
| 90 android:background="?android:attr/selectableItemBackground" |
| 91 android:contentDescription="@null" |
| 92 android:visibility="gone"/> |
| 93 |
| 94 <ImageButton |
| 95 android:id="@+id/button1" |
| 96 android:src="@drawable/ic_vidcontrol_stop" |
| 97 android:layout_width="40dp" |
70 android:layout_height="match_parent" | 98 android:layout_height="match_parent" |
71 android:layout_marginEnd="8dp" | 99 android:layout_marginEnd="8dp" |
72 android:gravity="center" | 100 android:gravity="center" |
73 android:padding="12dp" | 101 android:padding="8dp" |
74 android:scaleType="center" | 102 android:scaleType="center" |
75 android:background="?android:attr/selectableItemBackground" | 103 android:background="?android:attr/selectableItemBackground" |
76 android:contentDescription="@null"/> | 104 android:contentDescription="@null"/> |
77 | 105 |
78 <ImageButton | |
79 android:id="@+id/stop" | |
80 android:src="@drawable/ic_vidcontrol_stop" | |
81 android:layout_width="wrap_content" | |
82 android:layout_height="match_parent" | |
83 android:layout_marginEnd="8dp" | |
84 android:gravity="center" | |
85 android:padding="12dp" | |
86 android:scaleType="center" | |
87 android:background="?android:attr/selectableItemBackground" | |
88 android:contentDescription="@string/accessibility_stop" | |
89 android:visibility="gone"/> | |
90 | |
91 </LinearLayout> | 106 </LinearLayout> |
OLD | NEW |