1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (C) 2012 Andrew Neal
4 Copyright (C) 2014 The CyanogenMod Project
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
10 http://www.apache.org/licenses/LICENSE-2.0
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.
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">
25 android:id="@+id/audio_player_header"
26 layout="@layout/audio_player_header_bar" />
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" />
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"/>
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" />
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"
69 </com.cyanogenmod.eleven.widgets.SquareFrame>
72 android:layout_width="fill_parent"
73 android:layout_height="fill_parent"
74 android:background="@android:color/transparent" >
75 <com.cyanogenmod.eleven.widgets.PlayPauseProgressButton
76 android:id="@+id/playPauseProgressButton"
77 android:layout_width="@dimen/audio_player_controls_main_button_width"
78 android:layout_height="@dimen/audio_player_controls_main_button_height"
79 android:layout_centerInParent="true" >
81 <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
82 <com.cyanogenmod.eleven.widgets.PlayPauseButton
83 android:id="@+id/action_button_play"
84 android:layout_width="match_parent"
85 android:layout_height="match_parent"
86 android:layout_gravity="center"
87 android:contentDescription="@string/accessibility_play"
88 android:focusable="true"
89 android:scaleType="centerCrop"
90 android:src="@drawable/btn_playback_play" />
93 android:id="@+id/progressBarBackground"
94 style="?android:attr/progressBarStyleHorizontal"
95 android:layout_width="match_parent"
96 android:layout_height="match_parent"
97 android:clickable="false"
98 android:indeterminate="false"
100 android:progress="100"
101 android:progressDrawable="@drawable/now_playing_progress_background" />
104 android:id="@+id/circularProgressBar"
105 style="?android:attr/progressBarStyleHorizontal"
106 android:layout_width="match_parent"
107 android:layout_height="match_parent"
108 android:clickable="false"
109 android:indeterminate="false"
111 android:progressDrawable="@drawable/now_playing_progress" />
112 </com.cyanogenmod.eleven.widgets.PlayPauseProgressButton>
114 <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
115 <!-- ANSWER: two issues (a) centerInside doesn't scale up, only down, use
116 fitCenter instead. Also, ImageButtons come with built-in padding, but
117 that only makes a visible difference when you are scaling the image.
118 so you have to set the padding to zero in order to get the result you expect -->
119 <!-- This is the left side of the progress bar - it has the previous
120 and shuffle button and the current time text -->
122 android:layout_width="wrap_content"
123 android:layout_height="fill_parent"
124 android:layout_toLeftOf="@id/playPauseProgressButton">
127 android:id="@+id/audio_player_current_time"
128 android:layout_width="52dp"
129 android:layout_height="@dimen/audio_player_controls_end_button_height"
130 android:gravity="left|center_vertical"
131 android:layout_alignParentRight="true"
132 android:layout_centerVertical="true"
133 android:paddingLeft="@dimen/audio_player_time_text_padding"
134 android:textColor="@color/audio_player_text_color"
135 android:textSize="@dimen/audio_player_time_text_size"
136 android:textStyle="bold"/>
138 <com.cyanogenmod.eleven.widgets.RepeatingImageButton
139 android:id="@+id/action_button_previous"
140 android:layout_width="@dimen/audio_player_controls_end_button_width"
141 android:layout_height="@dimen/audio_player_controls_end_button_height"
142 android:layout_toLeftOf="@id/audio_player_current_time"
143 android:layout_centerVertical="true"
144 android:scaleType="fitCenter"
145 android:src="@drawable/btn_playback_previous" />
149 android:layout_height="@dimen/audio_player_divider_height"
150 android:layout_width="@dimen/audio_player_divider_length"
151 android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
152 android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
153 android:layout_alignParentRight="true"
154 android:layout_above="@id/audio_player_current_time"
155 android:background="@color/now_playing_divider" />
159 android:layout_height="@dimen/audio_player_divider_height"
160 android:layout_width="@dimen/audio_player_divider_length"
161 android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
162 android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
163 android:layout_alignParentRight="true"
164 android:layout_below="@id/audio_player_current_time"
165 android:background="@color/now_playing_divider" />
167 <com.cyanogenmod.eleven.widgets.BrowseButton
168 android:id="@+id/action_button_browse"
169 android:layout_width="@dimen/audio_player_controls_end_button_width"
170 android:layout_height="@dimen/audio_player_controls_end_button_height"
171 android:layout_above="@id/action_button_previous"
172 android:layout_alignLeft="@id/action_button_previous"
173 android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
174 android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
175 android:contentDescription="@string/accessibility_browse"
176 android:focusable="true"
177 android:scaleType="fitCenter"
178 android:src="@drawable/btn_playback_browse" />
180 <com.cyanogenmod.eleven.widgets.ShuffleButton
181 android:id="@+id/action_button_shuffle"
182 android:layout_width="@dimen/audio_player_controls_end_button_width"
183 android:layout_height="@dimen/audio_player_controls_end_button_height"
184 android:layout_below="@id/action_button_previous"
185 android:layout_alignLeft="@id/action_button_previous"
186 android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
187 android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
188 android:contentDescription="@string/accessibility_shuffle"
189 android:scaleType="fitCenter"
190 android:src="@drawable/btn_playback_shuffle_all" />
193 <!-- This is the right side of the progress bar - it has the next
194 and repeat button and the total time text -->
196 android:layout_width="wrap_content"
197 android:layout_height="fill_parent"
198 android:layout_toRightOf="@id/playPauseProgressButton">
201 android:id="@+id/audio_player_total_time"
202 android:layout_width="52dp"
203 android:layout_height="@dimen/audio_player_controls_end_button_height"
204 android:layout_alignParentLeft="true"
205 android:layout_centerVertical="true"
206 android:paddingRight="@dimen/audio_player_time_text_padding"
207 android:gravity="right|center_vertical"
208 android:textColor="@color/audio_player_text_color"
209 android:textSize="@dimen/audio_player_time_text_size"
210 android:textStyle="bold"/>
212 <com.cyanogenmod.eleven.widgets.RepeatingImageButton
213 android:id="@+id/action_button_next"
214 android:layout_width="@dimen/audio_player_controls_end_button_width"
215 android:layout_height="@dimen/audio_player_controls_end_button_height"
216 android:layout_toRightOf="@id/audio_player_total_time"
217 android:layout_centerVertical="true"
218 android:scaleType="fitCenter"
219 android:src="@drawable/btn_playback_next" />
223 android:layout_height="@dimen/audio_player_divider_height"
224 android:layout_width="@dimen/audio_player_divider_length"
225 android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
226 android:layout_marginBottom="@dimen/audio_player_divider_vertical_offset"
227 android:layout_alignParentLeft="true"
228 android:layout_above="@id/audio_player_total_time"
229 android:background="@color/now_playing_divider" />
233 android:layout_height="@dimen/audio_player_divider_height"
234 android:layout_width="@dimen/audio_player_divider_length"
235 android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
236 android:layout_marginTop="@dimen/audio_player_divider_vertical_offset"
237 android:layout_alignParentLeft="true"
238 android:layout_below="@id/audio_player_total_time"
239 android:background="@color/now_playing_divider" />
241 <com.cyanogenmod.eleven.widgets.QueueButton
242 android:id="@+id/action_button_queue"
243 android:layout_width="@dimen/audio_player_controls_end_button_width"
244 android:layout_height="@dimen/audio_player_controls_end_button_height"
245 android:layout_above="@id/action_button_next"
246 android:layout_alignRight="@id/action_button_next"
247 android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
248 android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
249 android:contentDescription="@string/accessibility_queue"
250 android:focusable="true"
251 android:scaleType="fitCenter"
252 android:src="@drawable/btn_queue_icon" />
254 <com.cyanogenmod.eleven.widgets.RepeatButton
255 android:id="@+id/action_button_repeat"
256 android:layout_width="@dimen/audio_player_controls_end_button_width"
257 android:layout_height="@dimen/audio_player_controls_end_button_height"
258 android:layout_below="@id/action_button_next"
259 android:layout_alignRight="@id/action_button_next"
260 android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
261 android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
262 android:contentDescription="@string/accessibility_repeat"
263 android:focusable="true"
264 android:scaleType="fitCenter"
265 android:src="@drawable/btn_playback_repeat_all" />