summaryrefslogtreecommitdiffstats
path: root/res/layout/main_playback_controls.xml
blob: cee200f753d6c0dd288740e732181eaa0d801f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2012 Andrew Neal
  Copyright (C) 2014 The CyanogenMod Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    card_view:cardCornerRadius="2dp"
    card_view:contentPadding="8dp"
    card_view:cardElevation="4dp"
    card_view:cardUseCompatPadding="true"
    card_view:cardBackgroundColor="@color/semitransparent_black" >
    <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

        <include
            android:contentDescription="@string/accessibility_play"
            android:id="@+id/playPauseProgressButton"
            android:layout_width="@dimen/audio_player_controls_main_button_width"
            android:layout_height="@dimen/audio_player_controls_main_button_height"
            android:layout_centerInParent="true"
            android:background="@drawable/fab_accent"
            android:gravity="center_horizontal"
            layout="@layout/play_pause_progress_button" />

        <!-- This is the left side of the progress bar - it has the previous
        and shuffle button and the current time text -->
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_toLeftOf="@id/playPauseProgressButton">

            <TextView
                android:id="@+id/audio_player_current_time"
                android:layout_width="52dp"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:gravity="left|center_vertical"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:paddingLeft="@dimen/audio_player_time_text_padding"
                android:textColor="@color/white"
                android:textSize="@dimen/audio_player_time_text_size"
                android:textStyle="bold"/>

            <com.cyanogenmod.eleven.widgets.RepeatingImageButton
                android:id="@+id/action_button_previous"
                android:layout_width="@dimen/audio_player_controls_end_button_width"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:layout_toLeftOf="@id/audio_player_current_time"
                android:layout_centerVertical="true"
                android:scaleType="fitCenter"
                android:src="@drawable/btn_playback_previous" />

            <!-- divider -->
            <View
                android:id="@+id/action_button_left_bottom_divider"
                android:layout_height="@dimen/audio_player_divider_height"
                android:layout_width="@dimen/audio_player_divider_length"
                android:layout_marginRight="@dimen/audio_player_divider_horizontal_offset"
                android:layout_alignParentRight="true"
                android:layout_below="@id/audio_player_current_time"
                android:background="@color/now_playing_divider" />

            <com.cyanogenmod.eleven.widgets.ShuffleButton
                android:id="@+id/action_button_shuffle"
                android:layout_width="@dimen/audio_player_controls_end_button_width"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:layout_below="@id/action_button_left_bottom_divider"
                android:layout_alignLeft="@id/action_button_previous"
                android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
                android:contentDescription="@string/accessibility_shuffle"
                android:scaleType="fitCenter"
                android:src="@drawable/btn_playback_shuffle_all" />
        </RelativeLayout>

        <!-- This is the right side of the progress bar - it has the next
        and repeat button and the total time text -->
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_toRightOf="@id/playPauseProgressButton">

            <TextView
                android:id="@+id/audio_player_total_time"
                android:layout_width="52dp"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:paddingRight="@dimen/audio_player_time_text_padding"
                android:gravity="right|center_vertical"
                android:textColor="@color/white"
                android:textSize="@dimen/audio_player_time_text_size"
                android:textStyle="bold"/>

            <com.cyanogenmod.eleven.widgets.RepeatingImageButton
                android:id="@+id/action_button_next"
                android:layout_width="@dimen/audio_player_controls_end_button_width"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:layout_toRightOf="@id/audio_player_total_time"
                android:layout_centerVertical="true"
                android:scaleType="fitCenter"
                android:src="@drawable/btn_playback_next" />

            <!-- divider -->
            <View
                android:id="@+id/action_button_right_bottom_divider"
                android:layout_height="@dimen/audio_player_divider_height"
                android:layout_width="@dimen/audio_player_divider_length"
                android:layout_marginLeft="@dimen/audio_player_divider_horizontal_offset"
                android:layout_alignParentLeft="true"
                android:layout_below="@id/audio_player_total_time" />

            <com.cyanogenmod.eleven.widgets.RepeatButton
                android:id="@+id/action_button_repeat"
                android:layout_width="@dimen/audio_player_controls_end_button_width"
                android:layout_height="@dimen/audio_player_controls_end_button_height"
                android:layout_below="@id/audio_player_total_time"
                android:layout_alignRight="@id/action_button_next"
                android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
                android:contentDescription="@string/accessibility_repeat"
                android:focusable="true"
                android:scaleType="fitCenter"
                android:src="@drawable/btn_playback_repeat_all" />

        </RelativeLayout>

    </RelativeLayout>
</android.support.v7.widget.CardView>