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