1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2011 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<!-- This is a view to control music playback in keyguard. -->
18<com.android.internal.policy.impl.keyguard.KeyguardTransportControlView
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="wrap_content"
21    android:layout_height="wrap_content"
22    android:gravity="center_horizontal"
23    android:id="@+id/keyguard_transport_control">
24
25    <!-- FrameLayout used as scrim to show between album art and buttons -->
26    <FrameLayout
27        android:layout_width="match_parent"
28        android:layout_height="match_parent"
29        android:foreground="@*android:drawable/ic_lockscreen_player_background"
30        android:contentDescription="@*android:string/keygaurd_accessibility_media_controls">
31        <!-- Use ImageView for its cropping features; otherwise could be android:background -->
32        <ImageView
33            android:id="@+id/albumart"
34            android:layout_width="match_parent"
35            android:layout_height="match_parent"
36            android:layout_gravity="fill"
37            android:scaleType="centerCrop"
38            android:adjustViewBounds="false"
39        />
40    </FrameLayout>
41
42    <LinearLayout
43        android:orientation="vertical"
44        android:layout_width="match_parent"
45        android:layout_height="wrap_content"
46        android:layout_gravity="bottom">
47        <TextView
48            android:id="@+id/title"
49            android:layout_width="match_parent"
50            android:layout_height="wrap_content"
51            android:layout_marginTop="8dip"
52            android:layout_marginStart="16dip"
53            android:layout_marginEnd="16dip"
54            android:gravity="center_horizontal"
55            android:singleLine="true"
56            android:ellipsize="end"
57            android:textAppearance="?android:attr/textAppearanceMedium"
58        />
59        <LinearLayout
60            android:layout_width="match_parent"
61            android:layout_height="wrap_content"
62            android:orientation="horizontal"
63            android:layout_marginTop="5dip">
64            <FrameLayout
65                android:layout_width="wrap_content"
66                android:layout_height="wrap_content"
67                android:layout_weight="1">
68                <ImageView
69                    android:id="@+id/btn_prev"
70                    android:layout_width="wrap_content"
71                    android:layout_height="wrap_content"
72                    android:layout_gravity="center"
73                    android:src="@*android:drawable/ic_media_previous"
74                    android:clickable="true"
75                    android:background="?android:attr/selectableItemBackground"
76                    android:padding="10dip"
77                    android:contentDescription="@*android:string/lockscreen_transport_prev_description"/>
78            </FrameLayout>
79            <FrameLayout
80                android:layout_width="wrap_content"
81                android:layout_height="wrap_content"
82                android:layout_weight="1">
83                <ImageView
84                    android:id="@+id/btn_play"
85                    android:layout_width="wrap_content"
86                    android:layout_height="wrap_content"
87                    android:layout_gravity="center"
88                    android:clickable="true"
89                    android:src="@*android:drawable/ic_media_play"
90                    android:background="?android:attr/selectableItemBackground"
91                    android:padding="10dip"
92                    android:contentDescription="@*android:string/lockscreen_transport_play_description"/>
93            </FrameLayout>
94            <FrameLayout
95                android:layout_width="wrap_content"
96                android:layout_height="wrap_content"
97                android:layout_weight="1">
98                <ImageView
99                    android:id="@+id/btn_next"
100                    android:layout_width="wrap_content"
101                    android:layout_height="wrap_content"
102                    android:layout_gravity="center"
103                    android:clickable="true"
104                    android:src="@*android:drawable/ic_media_next"
105                    android:background="?android:attr/selectableItemBackground"
106                    android:padding="10dip"
107                    android:contentDescription="@*android:string/lockscreen_transport_next_description"/>
108            </FrameLayout>
109        </LinearLayout>
110    </LinearLayout>
111
112</com.android.internal.policy.impl.keyguard.KeyguardTransportControlView>