keyguard_transport_control_view.xml revision 5b50a25e6d12bdc641a3b48ba9e7c02d63bf00cd
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="@drawable/ic_lockscreen_player_background">
30        <!-- Use ImageView for its cropping features; otherwise could be android:background -->
31        <ImageView
32            android:id="@+id/albumart"
33            android:layout_width="match_parent"
34            android:layout_height="match_parent"
35            android:layout_gravity="fill"
36            android:scaleType="centerCrop"
37            android:adjustViewBounds="false"
38        />
39    </FrameLayout>
40
41    <LinearLayout
42        android:orientation="vertical"
43        android:layout_width="match_parent"
44        android:layout_height="wrap_content"
45        android:layout_gravity="bottom">
46        <TextView
47            android:id="@+id/title"
48            android:layout_width="match_parent"
49            android:layout_height="wrap_content"
50            android:layout_marginTop="8dip"
51            android:layout_marginStart="16dip"
52            android:layout_marginEnd="16dip"
53            android:gravity="center_horizontal"
54            android:singleLine="true"
55            android:ellipsize="end"
56            android:textAppearance="?android:attr/textAppearanceMedium"
57        />
58        <LinearLayout
59            android:layout_width="match_parent"
60            android:layout_height="wrap_content"
61            android:orientation="horizontal"
62            android:layout_marginTop="5dip">
63            <FrameLayout
64                android:layout_width="wrap_content"
65                android:layout_height="wrap_content"
66                android:layout_weight="1">
67                <ImageView
68                    android:id="@+id/btn_prev"
69                    android:layout_width="wrap_content"
70                    android:layout_height="wrap_content"
71                    android:layout_gravity="center"
72                    android:src="@drawable/ic_media_previous"
73                    android:clickable="true"
74                    android:background="?android:attr/selectableItemBackground"
75                    android:padding="10dip"
76                    android:contentDescription="@string/lockscreen_transport_prev_description"/>
77            </FrameLayout>
78            <FrameLayout
79                android:layout_width="wrap_content"
80                android:layout_height="wrap_content"
81                android:layout_weight="1">
82                <ImageView
83                    android:id="@+id/btn_play"
84                    android:layout_width="wrap_content"
85                    android:layout_height="wrap_content"
86                    android:layout_gravity="center"
87                    android:clickable="true"
88                    android:src="@drawable/ic_media_play"
89                    android:background="?android:attr/selectableItemBackground"
90                    android:padding="10dip"
91                    android:contentDescription="@string/lockscreen_transport_play_description"/>
92            </FrameLayout>
93            <FrameLayout
94                android:layout_width="wrap_content"
95                android:layout_height="wrap_content"
96                android:layout_weight="1">
97                <ImageView
98                    android:id="@+id/btn_next"
99                    android:layout_width="wrap_content"
100                    android:layout_height="wrap_content"
101                    android:layout_gravity="center"
102                    android:clickable="true"
103                    android:src="@drawable/ic_media_next"
104                    android:background="?android:attr/selectableItemBackground"
105                    android:padding="10dip"
106                    android:contentDescription="@string/lockscreen_transport_next_description"/>
107            </FrameLayout>
108        </LinearLayout>
109    </LinearLayout>
110
111</com.android.internal.policy.impl.keyguard.KeyguardTransportControlView>