OSDN Git Service

Update Eleven headers and namespace for open source
[android-x86/packages-apps-Eleven.git] / res / layout / activity_player_fragment.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3   Copyright (C) 2012 Andrew Neal
4   Copyright (C) 2014 The CyanogenMod Project
5
6   Licensed under the Apache License, Version 2.0 (the "License");
7   you may not use this file except in compliance with the License.
8   You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17 -->
18 <LinearLayout
19     xmlns:android="http://schemas.android.com/apk/res/android"
20     android:layout_width="match_parent"
21     android:layout_height="match_parent"
22     android:orientation="vertical">
23
24     <include
25         android:id="@+id/audio_player_header"
26         layout="@layout/audio_player_header_bar" />
27
28     <com.cyanogenmod.eleven.widgets.SquareFrame
29         android:layout_width="match_parent"
30         android:layout_height="match_parent">
31         <com.cyanogenmod.eleven.widgets.SquareViewPager
32             android:id="@+id/audio_player_album_art_viewpager"
33             android:layout_width="match_parent"
34             android:layout_height="match_parent" />
35         <include layout="@layout/loading_empty_container" />
36
37         <View
38             android:id="@+id/equalizerGradient"
39             android:layout_width="match_parent"
40             android:layout_height="match_parent"
41             android:background="@drawable/equalizer_background"
42             android:layout_gravity="bottom"/>
43
44         <com.cyanogenmod.eleven.widgets.EqualizerView
45             android:id="@+id/equalizerView"
46             android:gravity="bottom"
47             android:layout_gravity="bottom"
48             android:layout_width="match_parent"
49             android:layout_height="match_parent"
50             android:clipChildren="false"
51             android:clipToPadding="false"
52             android:visibility="visible" />
53
54         <TextView
55             android:id="@+id/audio_player_lyrics"
56             android:layout_gravity="center"
57             android:gravity="center"
58             android:layout_width="fill_parent"
59             android:layout_height="wrap_content"
60             android:minHeight="66dp"
61             android:paddingLeft="15dp"
62             android:paddingRight="15dp"
63             android:paddingTop="6dp"
64             android:paddingBottom="6dp"
65             android:background="@color/lyrics_background_color"
66             android:textColor="@color/white"
67             android:textSize="@dimen/text_size_small"/>
68     </com.cyanogenmod.eleven.widgets.SquareFrame>
69
70     <RelativeLayout
71         android:layout_width="fill_parent"
72         android:layout_height="fill_parent" >
73         <com.cyanogenmod.eleven.widgets.PlayPauseProgressButton
74             xmlns:android="http://schemas.android.com/apk/res/android"
75             android:id="@+id/playPauseProgressButton"
76             android:layout_width="@dimen/audio_player_controls_main_button_width"
77             android:layout_height="@dimen/audio_player_controls_main_button_height"
78             android:layout_centerInParent="true" >
79
80             <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
81             <com.cyanogenmod.eleven.widgets.PlayPauseButton
82                 android:id="@+id/action_button_play"
83                 android:layout_width="match_parent"
84                 android:layout_height="match_parent"
85                 android:layout_gravity="center"
86                 android:contentDescription="@string/accessibility_play"
87                 android:focusable="true"
88                 android:scaleType="centerCrop"
89                 android:src="@drawable/btn_playback_play" />
90
91             <ProgressBar
92                 android:id="@+id/progressBarBackground"
93                 style="?android:attr/progressBarStyleHorizontal"
94                 android:layout_width="match_parent"
95                 android:layout_height="match_parent"
96                 android:clickable="false"
97                 android:indeterminate="false"
98                 android:max="100"
99                 android:progress="100"
100                 android:progressDrawable="@drawable/now_playing_progress_background" />
101
102             <ProgressBar
103                 android:id="@+id/circularProgressBar"
104                 style="?android:attr/progressBarStyleHorizontal"
105                 android:layout_width="match_parent"
106                 android:layout_height="match_parent"
107                 android:clickable="false"
108                 android:indeterminate="false"
109                 android:max="100"
110                 android:progressDrawable="@drawable/now_playing_progress" />
111         </com.cyanogenmod.eleven.widgets.PlayPauseProgressButton>
112
113         <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
114         <!-- ANSWER: two issues (a) centerInside doesn't scale up, only down, use
115              fitCenter instead. Also, ImageButtons come with built-in padding, but
116              that only makes a visible difference when you are scaling the image.
117              so you have to set the padding to zero in order to get the result you expect -->
118         <!-- This is the left side of the progress bar - it has the previous
119         and shuffle button and the current time text -->
120         <RelativeLayout
121             android:layout_width="wrap_content"
122             android:layout_height="fill_parent"
123             android:layout_toLeftOf="@id/playPauseProgressButton">
124
125             <TextView
126                 android:id="@+id/audio_player_current_time"
127                 android:layout_width="52dp"
128                 android:layout_height="@dimen/audio_player_controls_end_button_height"
129                 android:gravity="left|center_vertical"
130                 android:layout_alignParentRight="true"
131                 android:layout_centerVertical="true"
132                 android:paddingLeft="@dimen/audio_player_time_text_padding"
133                 android:textColor="@color/audio_player_text_color"
134                 android:textSize="@dimen/audio_player_time_text_size"
135                 android:textStyle="bold"/>
136
137             <com.cyanogenmod.eleven.widgets.RepeatingImageButton
138                 android:id="@+id/action_button_previous"
139                 android:layout_width="@dimen/audio_player_controls_end_button_width"
140                 android:layout_height="@dimen/audio_player_controls_end_button_height"
141                 android:layout_toLeftOf="@id/audio_player_current_time"
142                 android:layout_centerVertical="true"
143                 android:scaleType="fitCenter"
144                 android:src="@drawable/btn_playback_previous" />
145
146             <!-- divider -->
147             <View
148                 android:layout_height="@dimen/audio_player_divider_height"
149                 android:layout_width="@dimen/audio_player_divider_length"
150                 android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
151                 android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
152                 android:layout_alignParentRight="true"
153                 android:layout_above="@id/audio_player_current_time"
154                 android:background="@color/now_playing_divider" />
155
156             <!-- divider -->
157             <View
158                 android:layout_height="@dimen/audio_player_divider_height"
159                 android:layout_width="@dimen/audio_player_divider_length"
160                 android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
161                 android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
162                 android:layout_alignParentRight="true"
163                 android:layout_below="@id/audio_player_current_time"
164                 android:background="@color/now_playing_divider" />
165
166             <com.cyanogenmod.eleven.widgets.BrowseButton
167                 android:id="@+id/action_button_browse"
168                 android:layout_width="@dimen/audio_player_controls_end_button_width"
169                 android:layout_height="@dimen/audio_player_controls_end_button_height"
170                 android:layout_above="@id/action_button_previous"
171                 android:layout_alignLeft="@id/action_button_previous"
172                 android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
173                 android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
174                 android:contentDescription="@string/accessibility_browse"
175                 android:focusable="true"
176                 android:scaleType="fitCenter"
177                 android:src="@drawable/btn_playback_browse" />
178
179             <com.cyanogenmod.eleven.widgets.ShuffleButton
180                 android:id="@+id/action_button_shuffle"
181                 android:layout_width="@dimen/audio_player_controls_end_button_width"
182                 android:layout_height="@dimen/audio_player_controls_end_button_height"
183                 android:layout_below="@id/action_button_previous"
184                 android:layout_alignLeft="@id/action_button_previous"
185                 android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
186                 android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
187                 android:contentDescription="@string/accessibility_shuffle"
188                 android:scaleType="fitCenter"
189                 android:src="@drawable/btn_playback_shuffle_all" />
190         </RelativeLayout>
191
192         <!-- This is the right side of the progress bar - it has the next
193         and repeat button and the total time text -->
194         <RelativeLayout
195             android:layout_width="wrap_content"
196             android:layout_height="fill_parent"
197             android:layout_toRightOf="@id/playPauseProgressButton">
198
199             <TextView
200                 android:id="@+id/audio_player_total_time"
201                 android:layout_width="52dp"
202                 android:layout_height="@dimen/audio_player_controls_end_button_height"
203                 android:layout_alignParentLeft="true"
204                 android:layout_centerVertical="true"
205                 android:paddingRight="@dimen/audio_player_time_text_padding"
206                 android:gravity="right|center_vertical"
207                 android:textColor="@color/audio_player_text_color"
208                 android:textSize="@dimen/audio_player_time_text_size"
209                 android:textStyle="bold"/>
210
211             <com.cyanogenmod.eleven.widgets.RepeatingImageButton
212                 android:id="@+id/action_button_next"
213                 android:layout_width="@dimen/audio_player_controls_end_button_width"
214                 android:layout_height="@dimen/audio_player_controls_end_button_height"
215                 android:layout_toRightOf="@id/audio_player_total_time"
216                 android:layout_centerVertical="true"
217                 android:scaleType="fitCenter"
218                 android:src="@drawable/btn_playback_next" />
219
220             <!-- divider -->
221             <View
222                 android:layout_height="@dimen/audio_player_divider_height"
223                 android:layout_width="@dimen/audio_player_divider_length"
224                 android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
225                 android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
226                 android:layout_alignParentLeft="true"
227                 android:layout_above="@id/audio_player_total_time"
228                 android:background="@color/now_playing_divider" />
229
230             <!-- divider -->
231             <View
232                 android:layout_height="@dimen/audio_player_divider_height"
233                 android:layout_width="@dimen/audio_player_divider_length"
234                 android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
235                 android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
236                 android:layout_alignParentLeft="true"
237                 android:layout_below="@id/audio_player_total_time"
238                 android:background="@color/now_playing_divider" />
239
240             <com.cyanogenmod.eleven.widgets.QueueButton
241                 android:id="@+id/action_button_queue"
242                 android:layout_width="@dimen/audio_player_controls_end_button_width"
243                 android:layout_height="@dimen/audio_player_controls_end_button_height"
244                 android:layout_above="@id/action_button_next"
245                 android:layout_alignRight="@id/action_button_next"
246                 android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
247                 android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
248                 android:contentDescription="@string/accessibility_queue"
249                 android:focusable="true"
250                 android:scaleType="fitCenter"
251                 android:src="@drawable/btn_queue_icon" />
252
253             <com.cyanogenmod.eleven.widgets.RepeatButton
254                 android:id="@+id/action_button_repeat"
255                 android:layout_width="@dimen/audio_player_controls_end_button_width"
256                 android:layout_height="@dimen/audio_player_controls_end_button_height"
257                 android:layout_below="@id/action_button_next"
258                 android:layout_alignRight="@id/action_button_next"
259                 android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
260                 android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
261                 android:contentDescription="@string/accessibility_repeat"
262                 android:focusable="true"
263                 android:scaleType="fitCenter"
264                 android:src="@drawable/btn_playback_repeat_all" />
265
266         </RelativeLayout>
267
268     </RelativeLayout>
269 </LinearLayout>