OSDN Git Service

Eleven: redlines for Now Playing screen
authorWilhelm Fitzpatrick <rafial@cyngn.com>
Fri, 17 Oct 2014 05:49:50 +0000 (22:49 -0700)
committerlinus_lee <llee@cyngn.com>
Thu, 20 Nov 2014 20:51:33 +0000 (12:51 -0800)
Change-Id: Iad45c6ebb4f4c541a18d4914c23caae4fa8f4ed4

32 files changed:
AndroidManifest.xml
res/drawable-hdpi/btn_add_to_playlist.png
res/drawable-hdpi/btn_playback_browse.png [new file with mode: 0644]
res/drawable-hdpi/ic_action_search.png
res/drawable-mdpi/btn_add_to_playlist.png
res/drawable-mdpi/btn_playback_browse.png [new file with mode: 0644]
res/drawable-mdpi/ic_action_search.png
res/drawable-xhdpi/btn_add_to_playlist.png
res/drawable-xhdpi/btn_playback_browse.png [new file with mode: 0644]
res/drawable-xhdpi/ic_action_search.png
res/drawable-xxhdpi/btn_add_to_playlist.png
res/drawable-xxhdpi/btn_playback_browse.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_action_search.png
res/drawable/now_playing_progress.xml [new file with mode: 0644]
res/drawable/now_playing_progress_background.xml [new file with mode: 0644]
res/layout/activity_base.xml
res/layout/activity_player_fragment.xml
res/layout/audio_player_header_bar.xml [new file with mode: 0644]
res/values/colors.xml
res/values/dimens.xml
res/values/strings.xml
src/com/cyngn/eleven/ui/HeaderBar.java
src/com/cyngn/eleven/ui/activities/SlidingPanelActivity.java
src/com/cyngn/eleven/ui/fragments/AudioPlayerFragment.java
src/com/cyngn/eleven/widgets/AudioActivityButton.java [new file with mode: 0644]
src/com/cyngn/eleven/widgets/AudioButton.java [new file with mode: 0644]
src/com/cyngn/eleven/widgets/BrowseButton.java [new file with mode: 0644]
src/com/cyngn/eleven/widgets/PlayPauseProgressButton.java
src/com/cyngn/eleven/widgets/QueueButton.java [new file with mode: 0644]
src/com/cyngn/eleven/widgets/RepeatButton.java
src/com/cyngn/eleven/widgets/RepeatingImageButton.java
src/com/cyngn/eleven/widgets/ShuffleButton.java

index bfb1fef..7878448 100644 (file)
@@ -20,7 +20,7 @@
 
     <!-- ICS to Jelly Bean -->
     <uses-sdk
-        android:minSdkVersion="16"
+        android:minSdkVersion="17"
         android:targetSdkVersion="20" />
 
     <!-- Used for caching and creating new playlists -->
index 604f123..4eefbf7 100644 (file)
Binary files a/res/drawable-hdpi/btn_add_to_playlist.png and b/res/drawable-hdpi/btn_add_to_playlist.png differ
diff --git a/res/drawable-hdpi/btn_playback_browse.png b/res/drawable-hdpi/btn_playback_browse.png
new file mode 100644 (file)
index 0000000..1487c5d
Binary files /dev/null and b/res/drawable-hdpi/btn_playback_browse.png differ
index a12393e..8ed13dc 100644 (file)
Binary files a/res/drawable-hdpi/ic_action_search.png and b/res/drawable-hdpi/ic_action_search.png differ
index 61df825..cbd99df 100644 (file)
Binary files a/res/drawable-mdpi/btn_add_to_playlist.png and b/res/drawable-mdpi/btn_add_to_playlist.png differ
diff --git a/res/drawable-mdpi/btn_playback_browse.png b/res/drawable-mdpi/btn_playback_browse.png
new file mode 100644 (file)
index 0000000..eb87853
Binary files /dev/null and b/res/drawable-mdpi/btn_playback_browse.png differ
index a920e50..a0b7b56 100644 (file)
Binary files a/res/drawable-mdpi/ic_action_search.png and b/res/drawable-mdpi/ic_action_search.png differ
index 63b3da8..7c3a5ab 100644 (file)
Binary files a/res/drawable-xhdpi/btn_add_to_playlist.png and b/res/drawable-xhdpi/btn_add_to_playlist.png differ
diff --git a/res/drawable-xhdpi/btn_playback_browse.png b/res/drawable-xhdpi/btn_playback_browse.png
new file mode 100644 (file)
index 0000000..c8bb9d4
Binary files /dev/null and b/res/drawable-xhdpi/btn_playback_browse.png differ
index c631b1d..6d50c31 100644 (file)
Binary files a/res/drawable-xhdpi/ic_action_search.png and b/res/drawable-xhdpi/ic_action_search.png differ
index ed39849..8290f78 100644 (file)
Binary files a/res/drawable-xxhdpi/btn_add_to_playlist.png and b/res/drawable-xxhdpi/btn_add_to_playlist.png differ
diff --git a/res/drawable-xxhdpi/btn_playback_browse.png b/res/drawable-xxhdpi/btn_playback_browse.png
new file mode 100644 (file)
index 0000000..96b37c8
Binary files /dev/null and b/res/drawable-xxhdpi/btn_playback_browse.png differ
index be447dc..6c518ca 100644 (file)
Binary files a/res/drawable-xxhdpi/ic_action_search.png and b/res/drawable-xxhdpi/ic_action_search.png differ
diff --git a/res/drawable/now_playing_progress.xml b/res/drawable/now_playing_progress.xml
new file mode 100644 (file)
index 0000000..a0f1d2e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2014 Cyanogen, Inc.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:innerRadiusRatio="2.601"
+    android:thicknessRatio="8.666"
+    android:shape="ring">
+    <solid android:color="@color/circular_progress_bar" />
+</shape>
diff --git a/res/drawable/now_playing_progress_background.xml b/res/drawable/now_playing_progress_background.xml
new file mode 100644 (file)
index 0000000..2aae94c
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2014 Cyanogen, Inc.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:innerRadiusRatio="2.601"
+    android:thicknessRatio="8.666"
+    android:shape="ring">
+    <solid android:color="@color/circular_progress_bar_background" />
+</shape>
index 9513a66..78c913c 100644 (file)
 
                     <include layout="@layout/bottom_action_bar" />
 
-                    <include
-                        android:id="@+id/firstHeaderBar"
-                        layout="@layout/header_bar" />
-
                     <fragment
                         android:id="@+id/audioPlayerFragment"
                         class="com.cyngn.eleven.ui.fragments.AudioPlayerFragment"
index 692f66f..961c41f 100644 (file)
 <?xml version="1.0" encoding="utf-8"?>
 <!--
   Copyright (C) 2012 Andrew Neal
+
   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.
 -->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent" >
+    android:layout_height="match_parent"
+    android:orientation="vertical">
 
-    <LinearLayout
+    <include
+        android:id="@+id/audio_player_header"
+        layout="@layout/audio_player_header_bar" />
+
+    <com.cyngn.eleven.widgets.SquareViewPager
+        android:id="@+id/audio_player_album_art_viewpager"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
+        android:layout_height="match_parent" />
+
+    <RelativeLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" >
+        <com.cyngn.eleven.widgets.PlayPauseProgressButton
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            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" >
 
-        <RelativeLayout
-            android:id="@+id/album_art_section"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_above="@android:id/progress"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentRight="true"
-            android:layout_alignParentTop="true" >
-
-            <com.cyngn.eleven.widgets.SquareViewPager
-                android:id="@+id/audio_player_album_art_viewpager"
+            <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
+            <com.cyngn.eleven.widgets.PlayPauseButton
+                android:id="@+id/action_button_play"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent" />
-
-        </RelativeLayout>
-
-        <!-- This is the add to playlist, track name and menu button -->
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:baselineAligned="false"
-            android:gravity="center_vertical"
-            android:orientation="horizontal"
-            android:paddingBottom="@dimen/audio_player_header_padding_bottom">
-
-            <ImageView
-                android:id="@+id/action_button_add_to_playlist"
-                android:layout_width="@dimen/audio_player_controls_top_button_width"
-                android:layout_height="@dimen/audio_player_controls_top_button_height"
-                android:layout_weight="0"
-                android:scaleType="centerInside"
-                android:src="@drawable/btn_add_to_playlist" />
+                android:layout_height="match_parent"
+                android:layout_gravity="center"
+                android:contentDescription="@string/accessibility_play"
+                android:focusable="true"
+                android:scaleType="centerCrop"
+                android:src="@drawable/btn_playback_play_med" />
+
+            <ProgressBar
+                android:id="@+id/progressBarBackground"
+                style="?android:attr/progressBarStyleHorizontal"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:clickable="false"
+                android:indeterminate="false"
+                android:max="100"
+                android:progress="100"
+                android:progressDrawable="@drawable/now_playing_progress_background" />
+
+            <ProgressBar
+                android:id="@+id/circularProgressBar"
+                style="?android:attr/progressBarStyleHorizontal"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:clickable="false"
+                android:indeterminate="false"
+                android:max="100"
+                android:progressDrawable="@drawable/now_playing_progress" />
+        </com.cyngn.eleven.widgets.PlayPauseProgressButton>
+
+        <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
+        <!-- ANSWER: two issues (a) centerInside doesn't scale up, only down, use
+             fitCenter instead. Also, ImageButtons come with built-in padding, but
+             that only makes a visible difference when you are scaling the image.
+             so you have to set the padding to zero in order to get the result you expect -->
+        <!-- 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_track_name"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:ellipsize="marquee"
-                android:fadingEdge="horizontal"
-                android:gravity="center_horizontal"
-                android:marqueeRepeatLimit="marquee_forever"
-                android:paddingLeft="@dimen/audio_player_track_name_padding_side"
-                android:paddingRight="@dimen/audio_player_track_name_padding_side"
-                android:scrollHorizontally="true"
-                android:singleLine="true"
+                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/audio_player_text_color"
-                android:textSize="@dimen/audio_player_track_text_size"
-                android:textStyle="bold" />
-
-            <ImageView
-                android:id="@+id/action_button_menu"
-                android:layout_width="@dimen/audio_player_controls_top_button_width"
-                android:layout_height="@dimen/audio_player_controls_top_button_height"
-                android:layout_weight="0"
-                android:scaleType="centerInside"
-                android:src="@drawable/menu_button_light" />
-        </LinearLayout>
+                android:textSize="@dimen/audio_player_time_text_size"
+                android:textStyle="bold"/>
+
+            <com.cyngn.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: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_marginBottom="@dimen/audio_player_divider_vertical_offset"
+                android:layout_alignParentRight="true"
+                android:layout_above="@id/audio_player_current_time"
+                android:background="@color/now_playing_divider" />
+
+            <!-- divider -->
+            <View
+                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_marginTop="@dimen/audio_player_divider_vertical_offset"
+                android:layout_alignParentRight="true"
+                android:layout_below="@id/audio_player_current_time"
+                android:background="@color/now_playing_divider" />
+
+            <com.cyngn.eleven.widgets.BrowseButton
+                android:id="@+id/action_button_browse"
+                android:layout_width="@dimen/audio_player_controls_end_button_width"
+                android:layout_height="@dimen/audio_player_controls_end_button_height"
+                android:layout_above="@id/action_button_previous"
+                android:layout_alignLeft="@id/action_button_previous"
+                android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
+                android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
+                android:contentDescription="@string/accessibility_browse"
+                android:focusable="true"
+                android:scaleType="fitCenter"
+                android:src="@drawable/btn_playback_browse" />
+
+            <com.cyngn.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_previous"
+                android:layout_alignLeft="@id/action_button_previous"
+                android:layout_marginLeft="@dimen/audio_player_controls_end_button_half_width"
+                android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
+                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="fill_parent"
-            android:layout_height="wrap_content">
-            <FrameLayout
-                android:id="@+id/play_pause_container"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerHorizontal="true"
-                android:layout_alignParentTop="true"
-                android:contentDescription="@string/accessibility_play">
-                <include
-                    android:layout_width="@dimen/audio_player_controls_main_button_width"
-                    android:layout_height="@dimen/audio_player_controls_main_button_height"
-                    layout="@layout/play_pause_progress_button"/>
-            </FrameLayout>
+            android:layout_width="wrap_content"
+            android:layout_height="fill_parent"
+            android:layout_toRightOf="@id/playPauseProgressButton">
 
-            <!-- TODO: Figure out why scaleType: centerInside isn't properly scaling up -->
-            <!-- 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="@dimen/audio_player_controls_side_width"
-                android:layout_height="fill_parent"
-                android:layout_toLeftOf="@id/play_pause_container"
-                android:paddingTop="@dimen/audio_player_control_padding_top">
-                <com.cyngn.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_alignParentTop="true"
-                    android:layout_alignParentLeft="true"
-                    android:scaleType="center"
-                    android:src="@drawable/btn_playback_previous" />
-
-                <TextView
-                    android:id="@+id/audio_player_current_time"
-                    android:layout_width="fill_parent"
-                    android:layout_height="@dimen/audio_player_controls_end_button_height"
-                    android:gravity="center_vertical"
-                    android:layout_toRightOf="@id/action_button_previous"
-                    android:paddingLeft="@dimen/audio_player_time_text_padding"
-                    android:textColor="@color/audio_player_text_color"
-                    android:textSize="@dimen/audio_player_time_text_size"
-                    android:textStyle="bold"/>
-
-                <com.cyngn.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_previous"
-                    android:layout_alignLeft="@id/audio_player_current_time"
-                    android:contentDescription="@string/accessibility_shuffle"
-                    android:scaleType="center"
-                    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="@dimen/audio_player_controls_side_width"
-                android:layout_height="fill_parent"
-                android:layout_toRightOf="@id/play_pause_container"
-                android:paddingTop="@dimen/audio_player_control_padding_top">
-                <com.cyngn.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_alignParentTop="true"
-                    android:layout_alignParentRight="true"
-                    android:scaleType="center"
-                    android:src="@drawable/btn_playback_next" />
-
-                <TextView
-                    android:id="@+id/audio_player_total_time"
-                    android:layout_width="fill_parent"
-                    android:layout_height="@dimen/audio_player_controls_end_button_height"
-                    android:layout_toLeftOf="@id/action_button_next"
-                    android:gravity="right|center_vertical"
-                    android:paddingRight="@dimen/audio_player_time_text_padding"
-                    android:textColor="@color/audio_player_text_color"
-                    android:textSize="@dimen/audio_player_time_text_size"
-                    android:textStyle="bold"/>
-
-                <com.cyngn.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/action_button_next"
-                    android:layout_alignRight="@id/audio_player_total_time"
-                    android:contentDescription="@string/accessibility_repeat"
-                    android:focusable="true"
-                    android:scaleType="center"
-                    android:src="@drawable/btn_playback_repeat_all" />
-
-            </RelativeLayout>
+            <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/audio_player_text_color"
+                android:textSize="@dimen/audio_player_time_text_size"
+                android:textStyle="bold"/>
+
+            <com.cyngn.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: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_marginBottom="@dimen/audio_player_divider_vertical_offset"
+                android:layout_alignParentLeft="true"
+                android:layout_above="@id/audio_player_total_time"
+                android:background="@color/now_playing_divider" />
+
+            <!-- divider -->
+            <View
+                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_marginTop="@dimen/audio_player_divider_vertical_offset"
+                android:layout_alignParentLeft="true"
+                android:layout_below="@id/audio_player_total_time"
+                android:background="@color/now_playing_divider" />
+
+            <com.cyngn.eleven.widgets.QueueButton
+                android:id="@+id/action_button_queue"
+                android:layout_width="@dimen/audio_player_controls_end_button_width"
+                android:layout_height="@dimen/audio_player_controls_end_button_height"
+                android:layout_above="@id/action_button_next"
+                android:layout_alignRight="@id/action_button_next"
+                android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
+                android:layout_marginBottom="@dimen/audio_player_secondary_control_offset"
+                android:contentDescription="@string/accessibility_queue"
+                android:focusable="true"
+                android:scaleType="fitCenter"
+                android:src="@drawable/btn_queue_icon" />
+
+            <com.cyngn.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/action_button_next"
+                android:layout_alignRight="@id/action_button_next"
+                android:layout_marginRight="@dimen/audio_player_controls_end_button_half_width"
+                android:layout_marginTop="@dimen/audio_player_secondary_control_offset"
+                android:contentDescription="@string/accessibility_repeat"
+                android:focusable="true"
+                android:scaleType="fitCenter"
+                android:src="@drawable/btn_playback_repeat_all" />
 
         </RelativeLayout>
-    </LinearLayout>
-</FrameLayout>
\ No newline at end of file
+
+    </RelativeLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/audio_player_header_bar.xml b/res/layout/audio_player_header_bar.xml
new file mode 100644 (file)
index 0000000..3ce250e
--- /dev/null
@@ -0,0 +1,86 @@
+<!--
+  Copyright (C) 2014 Cyanogen, Inc.
+-->
+
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="@dimen/header_bar_height"
+    android:orientation="horizontal"
+    android:paddingStart="@dimen/header_bar_padding_left"
+    android:paddingEnd="@dimen/header_bar_padding_right">
+
+    <LinearLayout
+        android:id="@+id/header_bar_button_container"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_centerVertical="true"
+        android:layout_alignParentEnd="true">
+
+        <ImageView
+            android:id="@+id/header_bar_add_button"
+            android:layout_width="@dimen/header_bar_custom_button_width"
+            android:layout_height="@dimen/header_bar_custom_button_height"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0"
+            android:layout_marginStart="@dimen/header_bar_button_padding"
+            android:layout_marginEnd="@dimen/header_bar_button_padding"
+            android:src="@drawable/btn_add_to_playlist"
+            android:scaleType="centerInside" />
+
+        <ImageView
+            android:id="@+id/header_bar_search_button"
+            android:layout_width="@dimen/header_bar_custom_button_width"
+            android:layout_height="@dimen/header_bar_custom_button_height"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0"
+            android:layout_marginStart="@dimen/header_bar_button_padding"
+            android:layout_marginEnd="@dimen/header_bar_button_padding"
+            android:src="@drawable/ic_action_search"
+            android:scaleType="centerInside" />
+
+        <ImageView
+            android:id="@+id/header_bar_menu_button"
+            android:layout_width="@dimen/header_bar_menu_button_width"
+            android:layout_height="@dimen/header_bar_menu_button_height"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0"
+            android:scaleType="centerInside"
+            android:layout_marginStart="@dimen/header_bar_button_padding"
+            android:src="@drawable/menu_button_light"/>
+    </LinearLayout>
+
+    <LinearLayout
+            android:id="@+id/header_bar_text_container"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_alignParentStart="true"
+            android:layout_centerVertical="true"
+            android:layout_toStartOf="@id/header_bar_button_container">
+
+        <TextView
+                android:id="@+id/header_bar_song_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:ellipsize="end"
+                android:maxLines="1"
+                android:textAllCaps="true"
+                android:textColor="@color/header_action_bar_text_color"
+                android:textSize="@dimen/text_size_medium"
+                android:textStyle="bold" />
+
+        <TextView
+                android:id="@+id/header_bar_artist_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingBottom="2dp"
+                android:ellipsize="end"
+                android:maxLines="1"
+                android:textAllCaps="true"
+                android:fontFamily="sans-serif-light"
+                android:textColor="@color/header_action_bar_text_color"
+                android:textSize="@dimen/text_size_micro" />
+    </LinearLayout>
+</RelativeLayout>
\ No newline at end of file
index 4c8b9c6..5ec19c6 100644 (file)
     <!-- search no results text color -->
     <color name="no_results">#ff231f20</color>
     <color name="no_results_light">@color/white</color>
+
+    <color name="now_playing_divider">#40ffffff</color>
 </resources>
index da8b015..e3b9539 100644 (file)
     <dimen name="playlist_detail_header_bottom_height">40.0dip</dimen>
 
     <!-- Audio player Buttons (play/pause/shuffle/repeat/next/previous)-->
-    <dimen name="audio_player_controls_end_button_width">30.0dip</dimen>
-    <dimen name="audio_player_controls_end_button_height">30.0dip</dimen>
-    <dimen name="audio_player_controls_main_button_width">80.0dip</dimen>
-    <dimen name="audio_player_controls_main_button_height">80.0dip</dimen>
+    <dimen name="audio_player_controls_end_button_width">34.0dip</dimen>
+    <dimen name="audio_player_controls_end_button_height">34.0dip</dimen>
+    <dimen name="audio_player_controls_end_button_half_width">17.0dip</dimen>
+    <dimen name="audio_player_controls_main_button_width">100.0dip</dimen>
+    <dimen name="audio_player_controls_main_button_height">100.0dip</dimen>
     <dimen name="audio_player_controls_top_button_width">26.0dip</dimen>
     <dimen name="audio_player_controls_top_button_height">30.0dip</dimen>
     <dimen name="audio_player_controls_side_width">83.0dip</dimen>
     <dimen name="audio_player_control_padding_top">26.0dip</dimen>
+    <dimen name="audio_player_secondary_control_offset">16dp</dimen>
 
     <!-- Audio player track text settings-->
     <dimen name="audio_player_track_name_padding_side">36.0dip</dimen>
     <dimen name="audio_player_track_text_size">14sp</dimen>
 
     <!-- Audio player time text settings-->
-    <dimen name="audio_player_time_text_padding">6.0dip</dimen>
-    <dimen name="audio_player_time_text_size">12sp</dimen>
+    <dimen name="audio_player_time_text_padding">3.0dip</dimen>
+    <dimen name="audio_player_time_text_size">@dimen/text_size_micro</dimen>
+
+    <dimen name="audio_player_divider_length">86.0dip</dimen>
+    <dimen name="audio_player_divider_height">1.0dip</dimen>
+    <dimen name="audio_player_divider_vertical_offset">8.0dip</dimen>
+    <dimen name="audio_player_divider_horizontal_offset">8.0dip</dimen>
 
     <!-- App Widgets -->
     <dimen name="app_widget_large_min_width">250.0dip</dimen>
     <dimen name="color_scheme_dialog_row_padding">8.0dip</dimen>
 
     <!-- Sliding Panel -->
-    <dimen name="sliding_panel_indicator_height">26.0dip</dimen>
+    <dimen name="sliding_panel_indicator_height">20.0dip</dimen>
     <dimen name="sliding_panel_shadow_height">0.0dip</dimen>
 
     <!-- Header Bar -->
+    <dimen name="header_bar_height">50.0dip</dimen>
     <dimen name="header_bar_up_width">30.0dip</dimen>
     <dimen name="header_bar_up_height">30.0dip</dimen>
-    <dimen name="header_bar_menu_button_width">30.0dip</dimen>
+    <dimen name="header_bar_menu_button_width">24.0dip</dimen>
     <dimen name="header_bar_menu_button_height">30.0dip</dimen>
     <dimen name="header_bar_custom_button_width">30.0dip</dimen>
     <dimen name="header_bar_custom_button_height">30.0dip</dimen>
     <dimen name="header_bar_button_padding_small">5.0dip</dimen>
     <dimen name="header_bar_button_padding_large">10.0dip</dimen>
+    <dimen name="header_bar_padding_left">16.0dp</dimen>
+    <dimen name="header_bar_padding_right">8.0dp</dimen>
+    <dimen name="header_bar_button_container_padding">8.0dp</dimen>
+    <dimen name="header_bar_button_padding">6.0dp</dimen>
 
     <!-- Title Page Indicator Settings -->
     <dimen name="tpi_height">50dp</dimen>
index 9ca8ab1..864ba9b 100644 (file)
     <string name="accessibility_repeat">Repeat</string>
     <string name="accessibility_repeat_all">Repeat all</string>
     <string name="accessibility_repeat_one">Repeat one</string>
+    <string name="accessibility_queue">Open Queue</string>
+    <string name="accessibility_browse">Browse Music</string>
 
     <!-- Toast messages -->
     <string name="set_as_ringtone">\'<xliff:g id="name" example="Alarm Bell">%s</xliff:g>\' set as ringtone</string>
index a0c4098..c8d1433 100644 (file)
@@ -172,7 +172,7 @@ public class HeaderBar extends LinearLayout implements View.OnClickListener,
     }
 
     /**
-     * @param text set the title text
+     * @param resId set the title text
      */
     public void setTitleText(int resId) {
         mTitleText.setText(resId);
index 6840fad..2cddd34 100644 (file)
@@ -16,7 +16,6 @@ import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
 import android.view.View;
-import android.view.ViewStub;
 import android.widget.LinearLayout;
 
 import com.cyngn.eleven.R;
@@ -36,7 +35,7 @@ import com.cyngn.eleven.widgets.BlurScrimImage;
  */
 public class SlidingPanelActivity extends BaseActivity {
 
-    enum Panel {
+    public enum Panel {
         Browse,
         MusicPlayer,
         Queue,
@@ -44,7 +43,6 @@ public class SlidingPanelActivity extends BaseActivity {
     }
 
     private SlidingUpPanelLayout mFirstPanel;
-    private HeaderBar mFirstHeaderBar;
     private SlidingUpPanelLayout mSecondPanel;
     protected Panel mTargetNavigatePanel;
 
@@ -122,9 +120,7 @@ public class SlidingPanelActivity extends BaseActivity {
             }
         });
 
-        // setup the header bar
-        mFirstHeaderBar = setupHeaderBar(R.id.firstHeaderBar, R.string.page_now_playing,
-                R.drawable.btn_queue_icon, mShowQueue, mShowBrowse);
+
     }
 
     private void setupSecondPanel() {
@@ -203,7 +199,7 @@ public class SlidingPanelActivity extends BaseActivity {
         showPanel(Panel.MusicPlayer);
     }
 
-    protected void showPanel(Panel panel) {
+    public void showPanel(Panel panel) {
         // TODO: Add ability to do this instantaneously as opposed to animate
         switch (panel) {
             case Browse:
@@ -249,7 +245,6 @@ public class SlidingPanelActivity extends BaseActivity {
     public void clearMetaInfo() {
         super.clearMetaInfo();
         mBlurScrimImage.transitionToDefaultState();
-        mFirstHeaderBar.setTitleText("");
     }
 
     @Override
@@ -258,9 +253,6 @@ public class SlidingPanelActivity extends BaseActivity {
 
         // load the blurred image
         mBlurScrimImage.loadBlurImage(ApolloUtils.getImageFetcher(this));
-
-        // Set the artist name
-        mFirstHeaderBar.setTitleText(MusicUtils.getArtistName());
     }
 
     protected AudioPlayerFragment getAudioPlayerFragment() {
index 87ce56c..b5aa0f0 100644 (file)
@@ -15,6 +15,9 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Message;
+import android.provider.MediaStore.Audio.Albums;
+import android.provider.MediaStore.Audio.Artists;
+import android.provider.MediaStore.Audio.Playlists;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
 import android.util.Log;
@@ -28,10 +31,6 @@ import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.PopupMenu;
 import android.widget.TextView;
-
-import android.provider.MediaStore.Audio.Playlists;
-import android.provider.MediaStore.Audio.Albums;
-import android.provider.MediaStore.Audio.Artists;
 import com.cyngn.eleven.MusicPlaybackService;
 import com.cyngn.eleven.R;
 import com.cyngn.eleven.adapters.AlbumArtPagerAdapter;
@@ -44,7 +43,9 @@ import com.cyngn.eleven.menu.FragmentMenuItems;
 import com.cyngn.eleven.utils.ApolloUtils;
 import com.cyngn.eleven.utils.MusicUtils;
 import com.cyngn.eleven.utils.NavUtils;
+import com.cyngn.eleven.widgets.BrowseButton;
 import com.cyngn.eleven.widgets.PlayPauseProgressButton;
+import com.cyngn.eleven.widgets.QueueButton;
 import com.cyngn.eleven.widgets.RepeatButton;
 import com.cyngn.eleven.widgets.RepeatingImageButton;
 import com.cyngn.eleven.widgets.ShuffleButton;
@@ -65,6 +66,16 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
     // fragment view
     private ViewGroup mRootView;
 
+    // Header views
+    private TextView mSongTitle;
+    private TextView mArtistName;
+
+    // Playlist Button
+    private ImageView mAddToPlaylistButton;
+
+    // Menu Button
+    private ImageView mMenuButton;
+
     // Message to refresh the time
     private static final int REFRESH_TIME = 1;
 
@@ -86,14 +97,8 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
     // Next button
     private RepeatingImageButton mNextButton;
 
-    // Playlist button
-    private ImageView mAddToPlaylistButton;
-
-    // Menu button
-    private ImageView mMenuButton;
-
-    // Track name
-    private TextView mTrackName;
+    private BrowseButton mBrowseButton;
+    private QueueButton mQueueButton;
 
     // Album art ListView
     private ViewPager mAlbumArtViewPager;
@@ -158,6 +163,10 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
                              final Bundle savedInstanceState) {
         // The View for the fragment's UI
         mRootView = (ViewGroup) inflater.inflate(R.layout.activity_player_fragment, null);
+
+        // Header title values
+        initHeaderBar();
+
         initPlaybackControls();
         return mRootView;
     }
@@ -255,27 +264,27 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
     }
 
     /**
-     * Initializes the items in the now playing screen
+     * Initializes the header bar
      */
-    @SuppressWarnings("deprecation")
-    private void initPlaybackControls() {
-        // Play and pause button
-        mPlayPauseProgressButton = (PlayPauseProgressButton)mRootView.findViewById(R.id.playPauseProgressButton);
-        // Shuffle button
-        mShuffleButton = (ShuffleButton)mRootView.findViewById(R.id.action_button_shuffle);
-        // Repeat button
-        mRepeatButton = (RepeatButton)mRootView.findViewById(R.id.action_button_repeat);
-        // Previous button
-        mPreviousButton = (RepeatingImageButton)mRootView.findViewById(R.id.action_button_previous);
-        // Next button
-        mNextButton = (RepeatingImageButton)mRootView.findViewById(R.id.action_button_next);
-        // Track name
-        mTrackName = (TextView)mRootView.findViewById(R.id.audio_player_track_name);
-        mTrackName.setSelected(true);
-        mTrackName.setOnClickListener(mOpenAlbumProfile);
+    private void initHeaderBar() {
+        // Title text
+        mSongTitle = (TextView) mRootView.findViewById(R.id.header_bar_song_title);
+        mArtistName = (TextView) mRootView.findViewById(R.id.header_bar_artist_title);
+
+        // Buttons
+        // Search Button
+        View v = mRootView.findViewById(R.id.header_bar_search_button);
+        v.setBackground(new HoloSelector(getActivity()));
+        v.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                NavUtils.openSearch(getActivity(), "");
+            }
+        });
 
+        // Add to Playlist Button
         // Setup the playlist button - add a click listener to show the context
-        mAddToPlaylistButton = (ImageView)mRootView.findViewById(R.id.action_button_add_to_playlist);
+        mAddToPlaylistButton = (ImageView) mRootView.findViewById(R.id.header_bar_add_button);
         mAddToPlaylistButton.setBackground(new HoloSelector(getActivity()));
 
         // Create the context menu when requested
@@ -297,8 +306,9 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
             }
         });
 
+        // Add the menu button
         // menu button
-        mMenuButton = (ImageView)mRootView.findViewById(R.id.action_button_menu);
+        mMenuButton = (ImageView) mRootView.findViewById(R.id.header_bar_menu_button);
         mMenuButton.setBackground(new HoloSelector(getActivity()));
         mMenuButton.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -306,7 +316,21 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
                 showPopupMenu();
             }
         });
+    }
 
+    /**
+     * Initializes the items in the now playing screen
+     */
+    private void initPlaybackControls() {
+        mPlayPauseProgressButton = (PlayPauseProgressButton)mRootView.findViewById(R.id.playPauseProgressButton);
+        mShuffleButton = (ShuffleButton)mRootView.findViewById(R.id.action_button_shuffle);
+        mRepeatButton = (RepeatButton)mRootView.findViewById(R.id.action_button_repeat);
+        mPreviousButton = (RepeatingImageButton)mRootView.findViewById(R.id.action_button_previous);
+        mNextButton = (RepeatingImageButton)mRootView.findViewById(R.id.action_button_next);
+        mBrowseButton = (BrowseButton)mRootView.findViewById(R.id.action_button_browse);
+        mBrowseButton.setActivity(getActivity());
+        mQueueButton = (QueueButton)mRootView.findViewById(R.id.action_button_queue);
+        mQueueButton.setActivity(getActivity());
 
         // Album art view pager
         mAlbumArtViewPager = (ViewPager)mRootView.findViewById(R.id.audio_player_album_art_viewpager);
@@ -341,9 +365,9 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
         // Total time
         mTotalTime = (TextView)mRootView.findViewById(R.id.audio_player_total_time);
 
-        // Set the repeat listner for the previous button
+        // Set the repeat listener for the previous button
         mPreviousButton.setRepeatListener(mRewindListener);
-        // Set the repeat listner for the next button
+        // Set the repeat listener for the next button
         mNextButton.setRepeatListener(mFastForwardListener);
 
         mPlayPauseProgressButton.enableAndShow();
@@ -354,7 +378,8 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
      */
     private void updateNowPlayingInfo() {
         // Set the track name
-        mTrackName.setText(MusicUtils.getTrackName());
+        mSongTitle.setText(MusicUtils.getTrackName());
+        mArtistName.setText(MusicUtils.getArtistName());
 
         // Set the total time
         String totalTime = MusicUtils.makeShortTimeString(getActivity(), MusicUtils.duration() / 1000);
@@ -592,7 +617,6 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
             final long pos = mPosOverride < 0 ? MusicUtils.position() : mPosOverride;
             if (pos >= 0 && MusicUtils.duration() > 0) {
                 refreshCurrentTimeText(pos);
-                final int progress = (int)(1000 * pos / MusicUtils.duration());
 
                 if (mFromTouch) {
                     return 500;
@@ -652,18 +676,6 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection {
         }
     };
 
-    /**
-     * Opens to the current album profile
-     */
-    private final View.OnClickListener mOpenAlbumProfile = new View.OnClickListener() {
-
-        @Override
-        public void onClick(final View v) {
-            NavUtils.openAlbumProfile(getActivity(), MusicUtils.getAlbumName(),
-                    MusicUtils.getArtistName(), MusicUtils.getCurrentAlbumId());
-        }
-    };
-
     public void showPopupMenu() {
         // create the popup menu
         if (mPopupMenu == null) {
diff --git a/src/com/cyngn/eleven/widgets/AudioActivityButton.java b/src/com/cyngn/eleven/widgets/AudioActivityButton.java
new file mode 100644 (file)
index 0000000..bab45aa
--- /dev/null
@@ -0,0 +1,18 @@
+package com.cyngn.eleven.widgets;
+import android.content.Context;
+import android.support.v4.app.FragmentActivity;
+import android.util.AttributeSet;
+
+import com.cyngn.eleven.ui.activities.SlidingPanelActivity;
+
+public abstract class AudioActivityButton extends AudioButton {
+    protected SlidingPanelActivity mActivity;
+
+    public AudioActivityButton(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public void setActivity(FragmentActivity activity) {
+        mActivity = (SlidingPanelActivity)activity;
+    }
+}
\ No newline at end of file
diff --git a/src/com/cyngn/eleven/widgets/AudioButton.java b/src/com/cyngn/eleven/widgets/AudioButton.java
new file mode 100644 (file)
index 0000000..42bf013
--- /dev/null
@@ -0,0 +1,39 @@
+package com.cyngn.eleven.widgets;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnLongClickListener;
+import android.widget.ImageButton;
+
+import com.cyngn.eleven.utils.ApolloUtils;
+import com.cyngn.eleven.widgets.theme.HoloSelector;
+
+public abstract class AudioButton extends ImageButton implements OnClickListener, OnLongClickListener {
+    public static float ACTIVE_ALPHA = 1.0f;
+    public static float INACTIVE_ALPHA = 0.4f;
+
+    @SuppressWarnings("deprecation")
+    public AudioButton(final Context context, final AttributeSet attrs) {
+        super(context, attrs);
+        // Theme the selector
+        setPadding(0, 0, 0, 0);
+        setBackgroundDrawable(new HoloSelector(context));
+        // Control playback (cycle shuffle)
+        setOnClickListener(this);
+        // Show the cheat sheet
+        setOnLongClickListener(this);
+    }
+
+    @Override
+    public boolean onLongClick(final View view) {
+        if (TextUtils.isEmpty(view.getContentDescription())) {
+            return false;
+        } else {
+            ApolloUtils.showCheatSheet(view);
+            return true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/com/cyngn/eleven/widgets/BrowseButton.java b/src/com/cyngn/eleven/widgets/BrowseButton.java
new file mode 100644 (file)
index 0000000..825f841
--- /dev/null
@@ -0,0 +1,19 @@
+package com.cyngn.eleven.widgets;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.cyngn.eleven.ui.activities.SlidingPanelActivity;
+
+public class BrowseButton extends AudioActivityButton {
+
+    public BrowseButton(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    public void onClick(View view) {
+        mActivity.showPanel(SlidingPanelActivity.Panel.Browse);
+    }
+}
\ No newline at end of file
index f50d340..05d57cc 100644 (file)
@@ -5,6 +5,7 @@ package com.cyngn.eleven.widgets;
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.widget.FrameLayout;
 import android.widget.ProgressBar;
 
@@ -49,7 +50,8 @@ public class PlayPauseProgressButton extends FrameLayout {
         // Make the play pause button size dependent on the container size
         int horizontalPadding = getMeasuredWidth() / 4;
         int verticalPadding = getMeasuredHeight() / 4;
-        mPlayPauseButton.setPadding(horizontalPadding, horizontalPadding,
+        mPlayPauseButton.setPadding(
+                horizontalPadding, horizontalPadding,
                 verticalPadding, verticalPadding);
 
         // rotate the progress bar 90 degrees counter clockwise so that the
diff --git a/src/com/cyngn/eleven/widgets/QueueButton.java b/src/com/cyngn/eleven/widgets/QueueButton.java
new file mode 100644 (file)
index 0000000..43404ce
--- /dev/null
@@ -0,0 +1,19 @@
+package com.cyngn.eleven.widgets;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.cyngn.eleven.ui.activities.SlidingPanelActivity;
+
+public class QueueButton extends AudioActivityButton {
+
+    public QueueButton(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    public void onClick(View view) {
+        mActivity.showPanel(SlidingPanelActivity.Panel.Queue);
+    }
+}
\ No newline at end of file
index 962ce06..707523b 100644 (file)
 package com.cyngn.eleven.widgets;
 
 import android.content.Context;
-import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
 import android.widget.ImageButton;
 
 import com.cyngn.eleven.MusicPlaybackService;
 import com.cyngn.eleven.R;
-import com.cyngn.eleven.utils.ApolloUtils;
 import com.cyngn.eleven.utils.MusicUtils;
-import com.cyngn.eleven.widgets.theme.HoloSelector;
 
 /**
  * A custom {@link ImageButton} that represents the "repeat" button.
  * 
  * @author Andrew Neal (andrewdneal@gmail.com)
  */
-public class RepeatButton extends ImageButton implements OnClickListener, OnLongClickListener {
-    public static float ACTIVE_ALPHA = 1.0f;
-    public static float INACTIVE_ALPHA = 0.4f;
-
-    /**
-     * @param context The {@link Context} to use
-     * @param attrs The attributes of the XML tag that is inflating the view.
-     */
-    @SuppressWarnings("deprecation")
+public class RepeatButton extends AudioButton {
     public RepeatButton(final Context context, final AttributeSet attrs) {
         super(context, attrs);
-        // Set the selector
-        setBackgroundDrawable(new HoloSelector(context));
-        // Control playback (cycle repeat modes)
-        setOnClickListener(this);
-        // Show the cheat sheet
-        setOnLongClickListener(this);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void onClick(final View v) {
         MusicUtils.cycleRepeat();
         updateRepeatState();
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean onLongClick(final View view) {
-        if (TextUtils.isEmpty(view.getContentDescription())) {
-            return false;
-        } else {
-            ApolloUtils.showCheatSheet(view);
-            return true;
-        }
-    }
-
-    /**
-     * Sets the correct drawable for the repeat state.
-     */
+    /** Sets the correct drawable for the repeat state. */
     public void updateRepeatState() {
         switch (MusicUtils.getRepeatMode()) {
             case MusicPlaybackService.REPEAT_ALL:
@@ -95,4 +58,4 @@ public class RepeatButton extends ImageButton implements OnClickListener, OnLong
                 break;
         }
     }
-}
+}
\ No newline at end of file
index 0becdb4..f5440a5 100644 (file)
@@ -32,16 +32,6 @@ import com.cyngn.eleven.widgets.theme.HoloSelector;
  */
 public class RepeatingImageButton extends ImageButton implements OnClickListener {
 
-    /**
-     * Next button theme resource
-     */
-    private static final String NEXT = "btn_playback_next";
-
-    /**
-     * Previous button theme resource
-     */
-    private static final String PREVIOUS = "btn_playback_previous";
-
     private static final long sInterval = 400;
 
     private long mStartTime;
@@ -58,6 +48,7 @@ public class RepeatingImageButton extends ImageButton implements OnClickListener
     public RepeatingImageButton(final Context context, final AttributeSet attrs) {
         super(context, attrs);
         // Theme the selector
+        setPadding(0, 0, 0, 0);
         setBackgroundDrawable(new HoloSelector(context));
         setFocusable(true);
         setLongClickable(true);
index 3efdb90..83a5200 100644 (file)
 package com.cyngn.eleven.widgets;
 
 import android.content.Context;
-import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.widget.ImageButton;
 
 import com.cyngn.eleven.MusicPlaybackService;
 import com.cyngn.eleven.R;
-import com.cyngn.eleven.utils.ApolloUtils;
 import com.cyngn.eleven.utils.MusicUtils;
-import com.cyngn.eleven.widgets.theme.HoloSelector;
 
 /**
  * @author Andrew Neal (andrewdneal@gmail.com)
  */
-public class ShuffleButton extends ImageButton implements OnClickListener, OnLongClickListener {
-    public static float ACTIVE_ALPHA = 1.0f;
-    public static float INACTIVE_ALPHA = 0.4f;
-
-    /**
-     * @param context The {@link Context} to use
-     * @param attrs The attributes of the XML tag that is inflating the view.
-     */
-    @SuppressWarnings("deprecation")
+public class ShuffleButton extends AudioButton {
     public ShuffleButton(final Context context, final AttributeSet attrs) {
         super(context, attrs);
-        // Theme the selector
-        setBackgroundDrawable(new HoloSelector(context));
-        // Control playback (cycle shuffle)
-        setOnClickListener(this);
-        // Show the cheat sheet
-        setOnLongClickListener(this);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void onClick(final View v) {
         MusicUtils.cycleShuffle();
         updateShuffleState();
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean onLongClick(final View view) {
-        if (TextUtils.isEmpty(view.getContentDescription())) {
-            return false;
-        } else {
-            ApolloUtils.showCheatSheet(view);
-            return true;
-        }
-    }
-
-    /**
-     * Sets the correct drawable for the shuffle state.
-     */
+    /** Sets the correct drawable for the shuffle state. */
     public void updateShuffleState() {
         switch (MusicUtils.getShuffleMode()) {
             case MusicPlaybackService.SHUFFLE_NORMAL:
@@ -90,5 +52,4 @@ public class ShuffleButton extends ImageButton implements OnClickListener, OnLon
                 break;
         }
     }
-
-}
+}
\ No newline at end of file