OSDN Git Service

3ecdc3780a7828bce0d9c8581eb4b3ec2ba50bbd
[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             android:alpha="0.0"/>
69     </com.cyanogenmod.eleven.widgets.SquareFrame>
70
71     <RelativeLayout
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" >
80
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" />
91
92             <ProgressBar
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"
99                 android:max="100"
100                 android:progress="100"
101                 android:progressDrawable="@drawable/now_playing_progress_background" />
102
103             <ProgressBar
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"
110                 android:max="100"
111                 android:progressDrawable="@drawable/now_playing_progress" />
112         </com.cyanogenmod.eleven.widgets.PlayPauseProgressButton>
113
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 -->
121         <RelativeLayout
122             android:layout_width="wrap_content"
123             android:layout_height="fill_parent"
124             android:layout_toLeftOf="@id/playPauseProgressButton">
125
126             <TextView
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"/>
137
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" />
146
147             <!-- divider -->
148             <View
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" />
156
157             <!-- divider -->
158             <View
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" />
166
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" />
179
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" />
191         </RelativeLayout>
192
193         <!-- This is the right side of the progress bar - it has the next
194         and repeat button and the total time text -->
195         <RelativeLayout
196             android:layout_width="wrap_content"
197             android:layout_height="fill_parent"
198             android:layout_toRightOf="@id/playPauseProgressButton">
199
200             <TextView
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"/>
211
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" />
220
221             <!-- divider -->
222             <View
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" />
230
231             <!-- divider -->
232             <View
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" />
240
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" />
253
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" />
266
267         </RelativeLayout>
268
269     </RelativeLayout>
270 </LinearLayout>