OSDN Git Service

Merge "Add Landscape support to Eleven" into cm-12.1
[android-x86/packages-apps-Eleven.git] / res / layout / main_playback_controls.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 <RelativeLayout
19     xmlns:android="http://schemas.android.com/apk/res/android"
20     android:layout_width="fill_parent"
21     android:layout_height="fill_parent"
22     android:background="@android:color/transparent" >
23     <com.cyanogenmod.eleven.widgets.PlayPauseProgressButton
24         android:id="@+id/playPauseProgressButton"
25         android:layout_width="@dimen/audio_player_controls_main_button_width"
26         android:layout_height="@dimen/audio_player_controls_main_button_height"
27         android:layout_centerInParent="true" >
28
29         <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
30         <com.cyanogenmod.eleven.widgets.PlayPauseButton
31             android:id="@+id/action_button_play"
32             android:layout_width="match_parent"
33             android:layout_height="match_parent"
34             android:layout_gravity="center"
35             android:contentDescription="@string/accessibility_play"
36             android:focusable="true"
37             android:scaleType="centerCrop"
38             android:src="@drawable/btn_playback_play" />
39
40         <ProgressBar
41             android:id="@+id/progressBarBackground"
42             style="?android:attr/progressBarStyleHorizontal"
43             android:layout_width="match_parent"
44             android:layout_height="match_parent"
45             android:clickable="false"
46             android:indeterminate="false"
47             android:max="100"
48             android:progress="100"
49             android:progressDrawable="@drawable/now_playing_progress_background" />
50
51         <ProgressBar
52             android:id="@+id/circularProgressBar"
53             style="?android:attr/progressBarStyleHorizontal"
54             android:layout_width="match_parent"
55             android:layout_height="match_parent"
56             android:clickable="false"
57             android:indeterminate="false"
58             android:max="100"
59             android:progressDrawable="@drawable/now_playing_progress" />
60     </com.cyanogenmod.eleven.widgets.PlayPauseProgressButton>
61
62     <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
63     <!-- ANSWER: two issues (a) centerInside doesn't scale up, only down, use
64          fitCenter instead. Also, ImageButtons come with built-in padding, but
65          that only makes a visible difference when you are scaling the image.
66          so you have to set the padding to zero in order to get the result you expect -->
67     <!-- This is the left side of the progress bar - it has the previous
68     and shuffle button and the current time text -->
69     <RelativeLayout
70         android:layout_width="wrap_content"
71         android:layout_height="fill_parent"
72         android:layout_toLeftOf="@id/playPauseProgressButton">
73
74         <TextView
75             android:id="@+id/audio_player_current_time"
76             android:layout_width="52dp"
77             android:layout_height="@dimen/audio_player_controls_end_button_height"
78             android:gravity="left|center_vertical"
79             android:layout_alignParentRight="true"
80             android:layout_centerVertical="true"
81             android:paddingLeft="@dimen/audio_player_time_text_padding"
82             android:textColor="@color/audio_player_text_color"
83             android:textSize="@dimen/audio_player_time_text_size"
84             android:textStyle="bold"/>
85
86         <com.cyanogenmod.eleven.widgets.RepeatingImageButton
87             android:id="@+id/action_button_previous"
88             android:layout_width="@dimen/audio_player_controls_end_button_width"
89             android:layout_height="@dimen/audio_player_controls_end_button_height"
90             android:layout_toLeftOf="@id/audio_player_current_time"
91             android:layout_centerVertical="true"
92             android:scaleType="fitCenter"
93             android:src="@drawable/btn_playback_previous" />
94
95         <!-- divider -->
96         <View
97             android:id="@+id/action_button_left_top_divider"
98             android:layout_height="@dimen/audio_player_divider_height"
99             android:layout_width="@dimen/audio_player_divider_length"
100             android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
101             android:layout_alignParentRight="true"
102             android:layout_above="@id/audio_player_current_time"
103             android:background="@color/now_playing_divider" />
104
105         <!-- divider -->
106         <View
107             android:id="@+id/action_button_left_bottom_divider"
108             android:layout_height="@dimen/audio_player_divider_height"
109             android:layout_width="@dimen/audio_player_divider_length"
110             android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
111             android:layout_alignParentRight="true"
112             android:layout_below="@id/audio_player_current_time"
113             android:background="@color/now_playing_divider" />
114
115         <com.cyanogenmod.eleven.widgets.BrowseButton
116             android:id="@+id/action_button_browse"
117             android:layout_width="@dimen/audio_player_controls_end_button_width"
118             android:layout_height="@dimen/audio_player_controls_end_button_height"
119             android:layout_above="@id/action_button_left_top_divider"
120             android:layout_alignLeft="@id/action_button_previous"
121             android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
122             android:contentDescription="@string/accessibility_browse"
123             android:focusable="true"
124             android:scaleType="fitCenter"
125             android:src="@drawable/btn_playback_browse" />
126
127         <com.cyanogenmod.eleven.widgets.ShuffleButton
128             android:id="@+id/action_button_shuffle"
129             android:layout_width="@dimen/audio_player_controls_end_button_width"
130             android:layout_height="@dimen/audio_player_controls_end_button_height"
131             android:layout_below="@id/action_button_left_bottom_divider"
132             android:layout_alignLeft="@id/action_button_previous"
133             android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
134             android:contentDescription="@string/accessibility_shuffle"
135             android:scaleType="fitCenter"
136             android:src="@drawable/btn_playback_shuffle_all" />
137     </RelativeLayout>
138
139     <!-- This is the right side of the progress bar - it has the next
140     and repeat button and the total time text -->
141     <RelativeLayout
142         android:layout_width="wrap_content"
143         android:layout_height="fill_parent"
144         android:layout_toRightOf="@id/playPauseProgressButton">
145
146         <TextView
147             android:id="@+id/audio_player_total_time"
148             android:layout_width="52dp"
149             android:layout_height="@dimen/audio_player_controls_end_button_height"
150             android:layout_alignParentLeft="true"
151             android:layout_centerVertical="true"
152             android:paddingRight="@dimen/audio_player_time_text_padding"
153             android:gravity="right|center_vertical"
154             android:textColor="@color/audio_player_text_color"
155             android:textSize="@dimen/audio_player_time_text_size"
156             android:textStyle="bold"/>
157
158         <com.cyanogenmod.eleven.widgets.RepeatingImageButton
159             android:id="@+id/action_button_next"
160             android:layout_width="@dimen/audio_player_controls_end_button_width"
161             android:layout_height="@dimen/audio_player_controls_end_button_height"
162             android:layout_toRightOf="@id/audio_player_total_time"
163             android:layout_centerVertical="true"
164             android:scaleType="fitCenter"
165             android:src="@drawable/btn_playback_next" />
166
167         <!-- divider -->
168         <View
169             android:id="@+id/action_button_right_top_divider"
170             android:layout_height="@dimen/audio_player_divider_height"
171             android:layout_width="@dimen/audio_player_divider_length"
172             android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
173             android:layout_alignParentLeft="true"
174             android:layout_above="@id/audio_player_total_time"
175             android:background="@color/now_playing_divider" />
176
177         <!-- divider -->
178         <View
179             android:id="@+id/action_button_right_bottom_divider"
180             android:layout_height="@dimen/audio_player_divider_height"
181             android:layout_width="@dimen/audio_player_divider_length"
182             android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
183             android:layout_alignParentLeft="true"
184             android:layout_below="@id/audio_player_total_time"
185             android:background="@color/now_playing_divider" />
186
187         <com.cyanogenmod.eleven.widgets.QueueButton
188             android:id="@+id/action_button_queue"
189             android:layout_width="@dimen/audio_player_controls_end_button_width"
190             android:layout_height="@dimen/audio_player_controls_end_button_height"
191             android:layout_above="@id/action_button_right_top_divider"
192             android:layout_alignRight="@id/action_button_next"
193             android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
194             android:contentDescription="@string/accessibility_queue"
195             android:focusable="true"
196             android:scaleType="fitCenter"
197             android:src="@drawable/btn_queue_icon" />
198
199         <com.cyanogenmod.eleven.widgets.RepeatButton
200             android:id="@+id/action_button_repeat"
201             android:layout_width="@dimen/audio_player_controls_end_button_width"
202             android:layout_height="@dimen/audio_player_controls_end_button_height"
203             android:layout_below="@id/action_button_right_bottom_divider"
204             android:layout_alignRight="@id/action_button_next"
205             android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
206             android:contentDescription="@string/accessibility_repeat"
207             android:focusable="true"
208             android:scaleType="fitCenter"
209             android:src="@drawable/btn_playback_repeat_all" />
210
211     </RelativeLayout>
212
213 </RelativeLayout>