OSDN Git Service

Eleven: materialize
authorlinuxx <io.nolinuxnoparty@gmail.com>
Wed, 10 Dec 2014 17:25:02 +0000 (18:25 +0100)
committerSteve Kondik <shade@chemlab.org>
Sat, 27 Dec 2014 12:30:57 +0000 (12:30 +0000)
-Material Ui theme
-New launcher icon
-Better tabs

Change-Id: I712ac2eb5256841cf89d198eed775ce8afe9d09c

107 files changed:
Android.mk
AndroidManifest.xml
assets/licenses.html
res/color/tab_text_color.xml [new file with mode: 0644]
res/color/vpi__dark_theme.xml [deleted file]
res/color/vpi__light_theme.xml [deleted file]
res/drawable-hdpi/cardcontainer.9.png [deleted file]
res/drawable-hdpi/gray_circle.png [deleted file]
res/drawable-hdpi/ic_action_back.png [deleted file]
res/drawable-hdpi/ic_action_back_padded.png [deleted file]
res/drawable-hdpi/ic_launcher.png
res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png [deleted file]
res/drawable-hdpi/vpi__tab_selected_holo.9.png [deleted file]
res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png [deleted file]
res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png [deleted file]
res/drawable-hdpi/vpi__tab_unselected_holo.9.png [deleted file]
res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png [deleted file]
res/drawable-mdpi/cardcontainer.9.png [deleted file]
res/drawable-mdpi/gray_circle.png [deleted file]
res/drawable-mdpi/ic_action_back.png [deleted file]
res/drawable-mdpi/ic_action_back_padded.png [deleted file]
res/drawable-mdpi/ic_launcher.png
res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png [deleted file]
res/drawable-mdpi/vpi__tab_selected_holo.9.png [deleted file]
res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png [deleted file]
res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png [deleted file]
res/drawable-mdpi/vpi__tab_unselected_holo.9.png [deleted file]
res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png [deleted file]
res/drawable-xhdpi/cardcontainer.9.png [deleted file]
res/drawable-xhdpi/gray_circle.png [deleted file]
res/drawable-xhdpi/ic_action_back.png [deleted file]
res/drawable-xhdpi/ic_action_back_padded.png [deleted file]
res/drawable-xhdpi/ic_launcher.png
res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png [deleted file]
res/drawable-xhdpi/vpi__tab_selected_holo.9.png [deleted file]
res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png [deleted file]
res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png [deleted file]
res/drawable-xhdpi/vpi__tab_unselected_holo.9.png [deleted file]
res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png [deleted file]
res/drawable-xxhdpi/cardcontainer.9.png [deleted file]
res/drawable-xxhdpi/gray_circle.png [deleted file]
res/drawable-xxhdpi/ic_action_back.png [deleted file]
res/drawable-xxhdpi/ic_action_back_padded.png [deleted file]
res/drawable-xxhdpi/ic_launcher.png
res/drawable-xxxhdpi/ic_launcher.png [new file with mode: 0644]
res/drawable/action_bar.xml [deleted file]
res/drawable/audio_player_pager_container.xml [deleted file]
res/drawable/bottom_shadow.xml
res/drawable/gray_circle.xml [new file with mode: 0644]
res/drawable/selectable_background.xml [moved from res/drawable/tabpageindicator.xml with 66% similarity]
res/drawable/selectable_background_light.xml [new file with mode: 0644]
res/drawable/tpi_background.xml [deleted file]
res/drawable/view_pager_tab_background.xml [new file with mode: 0644]
res/drawable/vpi__tab_indicator.xml [deleted file]
res/layout/action_bar.xml [deleted file]
res/layout/activity_album_detail.xml
res/layout/activity_base.xml
res/layout/activity_player_fragment.xml
res/layout/app_widget_large.xml
res/layout/app_widget_large_alternate.xml
res/layout/app_widget_small.xml
res/layout/artist_detail_album.xml
res/layout/audio_player_header_bar.xml
res/layout/bottom_action_bar.xml
res/layout/fragment_music_browser_phone.xml
res/layout/grid_base.xml
res/layout/grid_items_normal.xml
res/layout/header_bar.xml
res/layout/list_item_queue.xml
res/layout/play_pause_progress_button.xml
res/values/colors.xml
res/values/dimens.xml
res/values/styles.xml
res/values/themeconfig.xml [deleted file]
res/values/vpi__attrs.xml [deleted file]
res/values/vpi__colors.xml [deleted file]
res/values/vpi__defaults.xml [deleted file]
res/values/vpi__styles.xml [deleted file]
res/xml/settings.xml
src/com/cyanogenmod/eleven/ui/HeaderBar.java
src/com/cyanogenmod/eleven/ui/activities/BaseActivity.java
src/com/cyanogenmod/eleven/ui/activities/HomeActivity.java
src/com/cyanogenmod/eleven/ui/activities/SearchActivity.java
src/com/cyanogenmod/eleven/ui/activities/SettingsActivity.java
src/com/cyanogenmod/eleven/ui/activities/SlidingPanelActivity.java
src/com/cyanogenmod/eleven/ui/fragments/AlbumFragment.java
src/com/cyanogenmod/eleven/ui/fragments/ArtistFragment.java
src/com/cyanogenmod/eleven/ui/fragments/AudioPlayerFragment.java
src/com/cyanogenmod/eleven/ui/fragments/BaseFragment.java
src/com/cyanogenmod/eleven/ui/fragments/SongFragment.java
src/com/cyanogenmod/eleven/ui/fragments/phone/MusicBrowserPhoneFragment.java
src/com/cyanogenmod/eleven/widgets/AudioButton.java
src/com/cyanogenmod/eleven/widgets/PlayPauseButton.java
src/com/cyanogenmod/eleven/widgets/PopupMenuButton.java
src/com/cyanogenmod/eleven/widgets/RepeatingImageButton.java
src/com/cyanogenmod/eleven/widgets/ViewPagerTabStrip.java [new file with mode: 0644]
src/com/cyanogenmod/eleven/widgets/ViewPagerTabs.java [new file with mode: 0644]
src/com/cyanogenmod/eleven/widgets/theme/HoloSelector.java [deleted file]
src/com/viewpagerindicator/CirclePageIndicator.java [deleted file]
src/com/viewpagerindicator/IconPageIndicator.java [deleted file]
src/com/viewpagerindicator/IconPagerAdapter.java [deleted file]
src/com/viewpagerindicator/IcsLinearLayout.java [deleted file]
src/com/viewpagerindicator/LinePageIndicator.java [deleted file]
src/com/viewpagerindicator/PageIndicator.java [deleted file]
src/com/viewpagerindicator/TabPageIndicator.java [deleted file]
src/com/viewpagerindicator/TitlePageIndicator.java [deleted file]
src/com/viewpagerindicator/UnderlinePageIndicator.java [deleted file]

index c0af5f5..17708a5 100644 (file)
@@ -6,15 +6,23 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_SRC_FILES := src/com/cyanogenmod/eleven/IElevenService.aidl
 LOCAL_SRC_FILES += $(call all-java-files-under, src)
 
+LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, res) \
+frameworks/support/v7/cardview/res
+
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v8-renderscript \
     android-support-v7-palette \
+    android-support-v7-cardview \
     android-common \
     android-visualizer \
     eleven_support_v4 \
     eleven_recyclerview \
     guava
 
+LOCAL_AAPT_FLAGS := \
+    --auto-add-overlay \
+    --extra-packages android.support.v7.cardview
+
 LOCAL_PACKAGE_NAME := Eleven
 LOCAL_OVERRIDES_PACKAGES := Music
 
index 3db8502..77089fb 100644 (file)
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.cyanogenmod.eleven"
     android:versionCode="2"
-    android:versionName="1.1" >
+    android:versionName="2.0" >
 
     <uses-sdk
-        android:minSdkVersion="17"
+        android:minSdkVersion="21"
         android:targetSdkVersion="21" />
 
     <!-- Used for caching and creating new playlists -->
@@ -41,7 +41,7 @@
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
     <!-- Used to check if the app is in the background -->
     <uses-permission android:name="android.permission.GET_TASKS" />
-    <!-- Allows Apollo to read from External Storage -->
+    <!-- Allows Eleven to read from External Storage -->
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 
     <!-- Audio Visualizer Permissions -->
             android:name="com.cyanogenmod.eleven.ui.activities.SearchActivity"
             android:windowSoftInputMode="adjustResize"
             android:exported="true"
-            android:theme="@style/Theme.ActionBarIcon"
+            android:theme="@style/Eleven.Theme"
             android:screenOrientation="portrait">
             <intent-filter>
                 <action android:name="android.intent.action.SEARCH" />
index 61a5d29..e238ddc 100644 (file)
@@ -2,7 +2,6 @@
 <h3>Notices for files:</h3>
 <ul>
 <li>ActionBarSherlock</li>
-<li>ViewPagerIndicator</li>
 <li>NineOldAndroids.jar</li>
 </ul>
 <pre>
@@ -87,4 +86,4 @@
  * limitations under the License.
  */
 </pre>
-</body></html>
\ No newline at end of file
+</body></html>
diff --git a/res/color/tab_text_color.xml b/res/color/tab_text_color.xml
new file mode 100644 (file)
index 0000000..c22b81d
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2014 The Android Open Source 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
+  -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/white" android:state_selected="true"/>
+    <item android:color="@color/header_action_bar_text_color" />
+</selector>
diff --git a/res/color/vpi__dark_theme.xml b/res/color/vpi__dark_theme.xml
deleted file mode 100644 (file)
index 3e7a08f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false" android:color="@color/vpi__bright_foreground_disabled_holo_dark"/>
-    <item android:state_window_focused="false" android:color="@color/vpi__bright_foreground_holo_dark"/>
-    <item android:state_pressed="true" android:color="@color/vpi__bright_foreground_holo_dark"/>
-    <item android:state_selected="true" android:color="@color/vpi__bright_foreground_holo_dark"/>
-    <!--item android:state_activated="true" android:color="@color/vpi__bright_foreground_holo_dark"/-->
-    <item android:color="@color/vpi__bright_foreground_holo_dark"/> <!-- not selected -->
-</selector>
diff --git a/res/color/vpi__light_theme.xml b/res/color/vpi__light_theme.xml
deleted file mode 100644 (file)
index f955db7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false" android:color="@color/vpi__bright_foreground_disabled_holo_light"/>
-    <item android:state_window_focused="false" android:color="@color/vpi__bright_foreground_holo_light"/>
-    <item android:state_pressed="true" android:color="@color/vpi__bright_foreground_holo_light"/>
-    <item android:state_selected="true" android:color="@color/vpi__bright_foreground_holo_light"/>
-    <!--item android:state_activated="true" android:color="@color/vpi__bright_foreground_holo_light"/-->
-    <item android:color="@color/vpi__bright_foreground_holo_light"/> <!-- not selected -->
-    
-</selector>
-
diff --git a/res/drawable-hdpi/cardcontainer.9.png b/res/drawable-hdpi/cardcontainer.9.png
deleted file mode 100644 (file)
index 246064e..0000000
Binary files a/res/drawable-hdpi/cardcontainer.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/gray_circle.png b/res/drawable-hdpi/gray_circle.png
deleted file mode 100644 (file)
index 1dc80c3..0000000
Binary files a/res/drawable-hdpi/gray_circle.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_back.png b/res/drawable-hdpi/ic_action_back.png
deleted file mode 100644 (file)
index 07f8e70..0000000
Binary files a/res/drawable-hdpi/ic_action_back.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_back_padded.png b/res/drawable-hdpi/ic_action_back_padded.png
deleted file mode 100644 (file)
index c4bca67..0000000
Binary files a/res/drawable-hdpi/ic_action_back_padded.png and /dev/null differ
index 4b5b1da..d9a2ebd 100644 (file)
Binary files a/res/drawable-hdpi/ic_launcher.png and b/res/drawable-hdpi/ic_launcher.png differ
diff --git a/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png b/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png
deleted file mode 100644 (file)
index 673e3bf..0000000
Binary files a/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/vpi__tab_selected_holo.9.png b/res/drawable-hdpi/vpi__tab_selected_holo.9.png
deleted file mode 100644 (file)
index d57df98..0000000
Binary files a/res/drawable-hdpi/vpi__tab_selected_holo.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png b/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png
deleted file mode 100644 (file)
index 6278eef..0000000
Binary files a/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png b/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png
deleted file mode 100644 (file)
index 294991d..0000000
Binary files a/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/vpi__tab_unselected_holo.9.png b/res/drawable-hdpi/vpi__tab_unselected_holo.9.png
deleted file mode 100644 (file)
index 19532ab..0000000
Binary files a/res/drawable-hdpi/vpi__tab_unselected_holo.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png b/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png
deleted file mode 100644 (file)
index aadc6f8..0000000
Binary files a/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/cardcontainer.9.png b/res/drawable-mdpi/cardcontainer.9.png
deleted file mode 100644 (file)
index 2e6032b..0000000
Binary files a/res/drawable-mdpi/cardcontainer.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/gray_circle.png b/res/drawable-mdpi/gray_circle.png
deleted file mode 100644 (file)
index 2060b47..0000000
Binary files a/res/drawable-mdpi/gray_circle.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_action_back.png b/res/drawable-mdpi/ic_action_back.png
deleted file mode 100644 (file)
index c715ca0..0000000
Binary files a/res/drawable-mdpi/ic_action_back.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_action_back_padded.png b/res/drawable-mdpi/ic_action_back_padded.png
deleted file mode 100644 (file)
index cca0e8a..0000000
Binary files a/res/drawable-mdpi/ic_action_back_padded.png and /dev/null differ
index 340e2a2..d5958d5 100644 (file)
Binary files a/res/drawable-mdpi/ic_launcher.png and b/res/drawable-mdpi/ic_launcher.png differ
diff --git a/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png b/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png
deleted file mode 100644 (file)
index c9972e7..0000000
Binary files a/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/vpi__tab_selected_holo.9.png b/res/drawable-mdpi/vpi__tab_selected_holo.9.png
deleted file mode 100644 (file)
index 587337c..0000000
Binary files a/res/drawable-mdpi/vpi__tab_selected_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png b/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png
deleted file mode 100644 (file)
index 155c4fc..0000000
Binary files a/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png b/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png
deleted file mode 100644 (file)
index f0cecd1..0000000
Binary files a/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/vpi__tab_unselected_holo.9.png b/res/drawable-mdpi/vpi__tab_unselected_holo.9.png
deleted file mode 100644 (file)
index a2dbf42..0000000
Binary files a/res/drawable-mdpi/vpi__tab_unselected_holo.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png b/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png
deleted file mode 100644 (file)
index b1223fe..0000000
Binary files a/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/cardcontainer.9.png b/res/drawable-xhdpi/cardcontainer.9.png
deleted file mode 100644 (file)
index e019df0..0000000
Binary files a/res/drawable-xhdpi/cardcontainer.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/gray_circle.png b/res/drawable-xhdpi/gray_circle.png
deleted file mode 100644 (file)
index e1f13a7..0000000
Binary files a/res/drawable-xhdpi/gray_circle.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_action_back.png b/res/drawable-xhdpi/ic_action_back.png
deleted file mode 100644 (file)
index 4e9f3c6..0000000
Binary files a/res/drawable-xhdpi/ic_action_back.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_action_back_padded.png b/res/drawable-xhdpi/ic_action_back_padded.png
deleted file mode 100644 (file)
index 5ee9938..0000000
Binary files a/res/drawable-xhdpi/ic_action_back_padded.png and /dev/null differ
index 2a1f0c3..fdc404c 100644 (file)
Binary files a/res/drawable-xhdpi/ic_launcher.png and b/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png b/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png
deleted file mode 100644 (file)
index 03cfb09..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/vpi__tab_selected_holo.9.png b/res/drawable-xhdpi/vpi__tab_selected_holo.9.png
deleted file mode 100644 (file)
index e4229f2..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_selected_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png b/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png
deleted file mode 100644 (file)
index e862cb1..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png b/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png
deleted file mode 100644 (file)
index f3a5cbd..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png b/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png
deleted file mode 100644 (file)
index 9465173..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png b/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png
deleted file mode 100644 (file)
index f1eb673..0000000
Binary files a/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/cardcontainer.9.png b/res/drawable-xxhdpi/cardcontainer.9.png
deleted file mode 100644 (file)
index 1048fc8..0000000
Binary files a/res/drawable-xxhdpi/cardcontainer.9.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/gray_circle.png b/res/drawable-xxhdpi/gray_circle.png
deleted file mode 100644 (file)
index c66c198..0000000
Binary files a/res/drawable-xxhdpi/gray_circle.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/ic_action_back.png b/res/drawable-xxhdpi/ic_action_back.png
deleted file mode 100644 (file)
index 6c3811f..0000000
Binary files a/res/drawable-xxhdpi/ic_action_back.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/ic_action_back_padded.png b/res/drawable-xxhdpi/ic_action_back_padded.png
deleted file mode 100644 (file)
index 17b95f7..0000000
Binary files a/res/drawable-xxhdpi/ic_action_back_padded.png and /dev/null differ
index cadb80a..5ab5a51 100644 (file)
Binary files a/res/drawable-xxhdpi/ic_launcher.png and b/res/drawable-xxhdpi/ic_launcher.png differ
diff --git a/res/drawable-xxxhdpi/ic_launcher.png b/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..5af81e7
Binary files /dev/null and b/res/drawable-xxxhdpi/ic_launcher.png differ
diff --git a/res/drawable/action_bar.xml b/res/drawable/action_bar.xml
deleted file mode 100644 (file)
index e7747c5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?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.
--->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:drawable="@color/action_bar"></item>
-
-</selector>
\ No newline at end of file
diff --git a/res/drawable/audio_player_pager_container.xml b/res/drawable/audio_player_pager_container.xml
deleted file mode 100644 (file)
index e7747c5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?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.
--->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:drawable="@color/action_bar"></item>
-
-</selector>
\ No newline at end of file
index 6aca232..7b6385c 100644 (file)
@@ -6,9 +6,9 @@
   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.
@@ -23,4 +23,4 @@
         android:endColor="@color/transparent"
         android:startColor="@color/black" />
 
-</shape>
\ No newline at end of file
+</shape>
diff --git a/res/drawable/gray_circle.xml b/res/drawable/gray_circle.xml
new file mode 100644 (file)
index 0000000..719b3a6
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+     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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+    android:insetLeft="1dp"
+    android:insetRight="1dp"
+    android:insetTop="1dp"
+    android:insetBottom="1dp">
+
+    <shape android:shape="oval">
+        <solid android:color="#90a4ae" />
+    </shape>
+
+</inset>
similarity index 66%
rename from res/drawable/tabpageindicator.xml
rename to res/drawable/selectable_background.xml
index 2e2baaa..cc32cb7 100644 (file)
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
+<!-- Copyright (C) 2014 The Android Open Source 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.
@@ -14,7 +14,5 @@
      limitations under the License.
 -->
 
-<!-- This shows the drawble when selected, but otherwise shows nothing -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_selected="true" android:drawable="@drawable/vpi__tab_selected_holo" />
-</selector>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="@color/white" />
diff --git a/res/drawable/selectable_background_light.xml b/res/drawable/selectable_background_light.xml
new file mode 100644 (file)
index 0000000..ed49ae5
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="@color/primary" />
diff --git a/res/drawable/tpi_background.xml b/res/drawable/tpi_background.xml
deleted file mode 100644 (file)
index d19513b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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.
--->
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/bg_stripes_dark"
-    android:tileMode="repeat" />
diff --git a/res/drawable/view_pager_tab_background.xml b/res/drawable/view_pager_tab_background.xml
new file mode 100644 (file)
index 0000000..f9e09d4
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    ~ Copyright (C) 2014 The Android Open Source 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
+-->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="@color/tab_ripple_color">
+    <item android:id="@android:id/mask">
+        <color android:color="@android:color/white" />
+    </item>
+</ripple>
diff --git a/res/drawable/vpi__tab_indicator.xml b/res/drawable/vpi__tab_indicator.xml
deleted file mode 100644 (file)
index 520d08c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <!-- Non focused states -->
-    <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/vpi__tab_unselected_holo" />
-    <item android:state_focused="false" android:state_selected="true"  android:state_pressed="false" android:drawable="@drawable/vpi__tab_selected_holo" />
-
-    <!-- Focused states -->
-    <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/vpi__tab_unselected_focused_holo" />
-    <item android:state_focused="true" android:state_selected="true"  android:state_pressed="false" android:drawable="@drawable/vpi__tab_selected_focused_holo" />
-
-    <!-- Pressed -->
-    <!--    Non focused states -->
-    <item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/vpi__tab_unselected_pressed_holo" />
-    <item android:state_focused="false" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/vpi__tab_selected_pressed_holo" />
-
-    <!--    Focused states -->
-    <item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/vpi__tab_unselected_pressed_holo" />
-    <item android:state_focused="true" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/vpi__tab_selected_pressed_holo" />
-</selector>
diff --git a/res/layout/action_bar.xml b/res/layout/action_bar.xml
deleted file mode 100644 (file)
index 7cac41b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:enabled="false"
-    android:orientation="horizontal"
-    android:paddingEnd="8dip" >
-
-    <ImageView
-        android:id="@+id/up"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical|start"
-        android:contentDescription="@null"
-        android:visibility="gone" />
-
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical|start"
-        android:orientation="vertical" >
-
-        <TextView
-            android:id="@+id/action_bar_title"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:ellipsize="end"
-            android:singleLine="true"
-            android:textSize="@dimen/text_size_medium" />
-
-        <TextView
-            android:id="@+id/action_bar_subtitle"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="-3dp"
-            android:ellipsize="end"
-            android:singleLine="true"
-            android:textSize="@dimen/text_size_small"
-            android:visibility="gone" />
-    </LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
index ed77578..e00136a 100644 (file)
@@ -9,7 +9,8 @@
         android:layout_height="108dp"
         android:layout_alignParentTop="true"
         android:layout_alignParentLeft="true"
-        android:background="@color/page_header_background" >
+        android:background="@color/page_header_background"
+        android:elevation="2dp" >
 
         <ImageView
             android:id="@+id/album_art"
index e9eeced..8426ffa 100644 (file)
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:background="@color/background_color"
+<com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:sothree="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/sliding_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:gravity="bottom"
+    sothree:panelHeight="@dimen/bottom_action_bar_height"
+    sothree:slidePanelOffset="@dimen/bottom_action_bar_height"
+    sothree:dragView="@+id/firstPanelDragArea"
+    sothree:dragViewClickable="false"
+    sothree:shadowHeight="@dimen/sliding_panel_shadow_height">
+
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <Toolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?android:attr/actionBarSize"
+            android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar"
+            android:popupTheme="@android:style/Theme.Material.Light"
+            android:elevation="@dimen/action_bar_elevation" />
+
+        <FrameLayout
+            android:id="@+id/activity_base_content"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+    </FrameLayout>
 
     <com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout
-        xmlns:sothree="http://schemas.android.com/apk/res-auto"
-        android:id="@+id/sliding_layout"
+        android:id="@+id/sliding_layout2"
+        android:background="@color/background_color"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:gravity="bottom"
-        sothree:panelHeight="@dimen/bottom_action_bar_height"
-        sothree:slidePanelOffset="@dimen/bottom_action_bar_height"
-        sothree:dragView="@+id/firstPanelDragArea"
-        sothree:dragViewClickable="false"
+        sothree:fadeColor="@color/transparent"
+        sothree:directOffset="true"
+        sothree:panelHeight="@dimen/sliding_panel_indicator_height"
+        sothree:dragView="@+id/secondPanelDragArea"
         sothree:shadowHeight="@dimen/sliding_panel_shadow_height">
 
-        <FrameLayout
-            android:id="@+id/activity_base_content"
-            android:layout_width="match_parent"
+        <include android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:paddingTop="?android:attr/actionBarSize" />
+            layout="@layout/blur_scrim_image" />
 
-        <com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout
-            xmlns:sothree="http://schemas.android.com/apk/res-auto"
-            android:id="@+id/sliding_layout2"
-            android:background="@color/background_color"
+        <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:gravity="bottom"
-            sothree:fadeColor="@color/transparent"
-            sothree:directOffset="true"
-            sothree:panelHeight="@dimen/sliding_panel_indicator_height"
-            sothree:dragView="@+id/secondPanelDragArea"
-            sothree:shadowHeight="@dimen/sliding_panel_shadow_height">
+            android:orientation="vertical">
 
-            <include android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                layout="@layout/blur_scrim_image" />
-
-            <RelativeLayout
+            <LinearLayout
+                android:id="@+id/firstPanelDragArea"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:orientation="vertical">
 
-                <LinearLayout
-                    android:id="@+id/firstPanelDragArea"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
-
-                    <include layout="@layout/bottom_action_bar" />
+                <include layout="@layout/bottom_action_bar" />
 
-                    <fragment
-                        android:id="@+id/audioPlayerFragment"
-                        class="com.cyanogenmod.eleven.ui.fragments.AudioPlayerFragment"
-                        android:layout_width="match_parent"
-                        android:layout_height="0dip"
-                        android:layout_weight="1" />
-                </LinearLayout>
-            </RelativeLayout>
+                <fragment
+                    android:id="@+id/audioPlayerFragment"
+                    class="com.cyanogenmod.eleven.ui.fragments.AudioPlayerFragment"
+                    android:layout_width="match_parent"
+                    android:layout_height="0dip"
+                    android:layout_weight="1" />
+            </LinearLayout>
+        </RelativeLayout>
 
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
             <LinearLayout
+                android:id="@+id/secondPanelDragArea"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:orientation="vertical">
-                <LinearLayout
-                    android:id="@+id/secondPanelDragArea"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
 
-                    <ImageView
-                        android:id="@+id/secondPanelDragIndicator"
-                        android:layout_width="wrap_content"
-                        android:layout_height="@dimen/sliding_panel_indicator_height"
-                        android:layout_gravity="center_horizontal"
-                        android:scaleType="centerInside"
-                        android:src="@drawable/drag_indicator" />
+                <ImageView
+                    android:id="@+id/secondPanelDragIndicator"
+                    android:layout_width="wrap_content"
+                    android:layout_height="@dimen/sliding_panel_indicator_height"
+                    android:layout_gravity="center_horizontal"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/drag_indicator" />
 
-                    <include
-                        android:id="@+id/secondHeaderBar"
-                        layout="@layout/header_bar" />
-                </LinearLayout>
-
-                <fragment
-                    android:id="@+id/queueFragment"
-                    class="com.cyanogenmod.eleven.ui.fragments.QueueFragment"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dip"
-                    android:layout_weight="1" />
+                <include
+                    android:id="@+id/secondHeaderBar"
+                    layout="@layout/header_bar" />
             </LinearLayout>
-        </com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout>
+
+            <fragment
+                android:id="@+id/queueFragment"
+                class="com.cyanogenmod.eleven.ui.fragments.QueueFragment"
+                android:layout_width="match_parent"
+                android:layout_height="0dip"
+                android:layout_weight="1" />
+        </LinearLayout>
     </com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout>
-</LinearLayout>
\ No newline at end of file
+</com.cyanogenmod.eleven.slidinguppanel.SlidingUpPanelLayout>
index f0c8b9b..3ecdc37 100644 (file)
@@ -70,9 +70,9 @@
 
     <RelativeLayout
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent" >
+        android:layout_height="fill_parent"
+        android:background="@android:color/transparent" >
         <com.cyanogenmod.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"
         </RelativeLayout>
 
     </RelativeLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
index 70b5d64..bda04b9 100644 (file)
@@ -6,9 +6,9 @@
   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.
index 22f0d4e..b7790ae 100644 (file)
@@ -6,9 +6,9 @@
   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.
index 6eadef4..3020c82 100644 (file)
@@ -6,9 +6,9 @@
   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.
index b985618..296ec6e 100644 (file)
@@ -1,49 +1,59 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.v7.widget.CardView
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="104dp"
     android:layout_height="148dp"
     android:layout_marginRight="8dp"
-    android:background="@drawable/cardcontainer" >
-
-    <ImageView
-        android:id="@+id/album_art"
-        android:layout_width="104dp"
-        android:layout_height="104dp"
-        android:layout_alignParentTop="true"
-        android:layout_alignParentLeft="true"
-        android:scaleType="centerCrop" />
-
-    <com.cyanogenmod.eleven.widgets.PopupMenuButton
-        android:id="@+id/overflow"
-        android:layout_width="@dimen/overflow_width"
-        android:layout_height="match_parent"
-        android:layout_below="@id/album_art"
-        android:layout_alignParentRight="true"
-        android:layout_marginBottom="1dp"
-        android:gravity="center_vertical"
-        android:src="@drawable/menu_button" />
-
-    <LinearLayout
+    android:foreground="@drawable/selectable_background"
+    android:elevation="3dp">
+
+    <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:gravity="center_vertical"
-        android:layout_below="@id/album_art"
-        android:layout_toLeftOf="@id/overflow"
-        android:layout_alignParentLeft="true"
-        android:layout_marginLeft="8dp" >
-
-        <TextView
-            android:id="@+id/title"
-            style="@style/ListItemMainText.Single"
-            android:textSize="@dimen/text_size_micro"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
+        android:layout_height="match_parent">
+
+        <ImageView
+            android:id="@+id/album_art"
+            android:layout_width="104dp"
+            android:layout_height="104dp"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentLeft="true"
+            android:scaleType="centerCrop" />
 
-        <TextView
-            android:id="@+id/year"
-            style="@style/ListItemSecondaryText.Single"
-            android:textSize="@dimen/text_size_extra_micro"
+        <com.cyanogenmod.eleven.widgets.PopupMenuButton
+            android:id="@+id/overflow"
+            android:layout_width="@dimen/overflow_width"
+            android:layout_height="match_parent"
+            android:layout_below="@id/album_art"
+            android:layout_alignParentRight="true"
+            android:layout_marginBottom="1dp"
+            android:gravity="center_vertical"
+            android:src="@drawable/menu_button" />
+
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-    </LinearLayout>
-</RelativeLayout>
\ No newline at end of file
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:gravity="center_vertical"
+            android:layout_below="@id/album_art"
+            android:layout_toLeftOf="@id/overflow"
+            android:layout_alignParentLeft="true"
+            android:layout_marginLeft="8dp" >
+
+            <TextView
+                android:id="@+id/title"
+                style="@style/ListItemMainText.Single"
+                android:textSize="@dimen/text_size_micro"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+            <TextView
+                android:id="@+id/year"
+                style="@style/ListItemSecondaryText.Single"
+                android:textSize="@dimen/text_size_extra_micro"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+        </LinearLayout>
+
+    </RelativeLayout>
+
+</android.support.v7.widget.CardView>
index 13d58d7..6b73ff3 100644 (file)
@@ -20,7 +20,9 @@
     android:layout_height="@dimen/header_bar_height"
     android:orientation="horizontal"
     android:paddingStart="@dimen/header_bar_padding_left"
-    android:paddingEnd="@dimen/header_bar_padding_right">
+    android:paddingEnd="@dimen/header_bar_padding_right"
+    android:elevation="@dimen/action_bar_elevation"
+    android:background="@android:color/transparent">
 
     <LinearLayout
         android:id="@+id/header_bar_button_container"
@@ -38,6 +40,7 @@
             android:layout_weight="0"
             android:layout_marginStart="@dimen/header_bar_button_padding"
             android:layout_marginEnd="@dimen/header_bar_button_padding"
+            android:background="@drawable/selectable_background"
             android:src="@drawable/btn_add_to_playlist"
             android:scaleType="centerInside" />
 
@@ -49,6 +52,7 @@
             android:layout_weight="0"
             android:layout_marginStart="@dimen/header_bar_button_padding"
             android:layout_marginEnd="@dimen/header_bar_button_padding"
+            android:background="@drawable/selectable_background"
             android:src="@drawable/ic_action_search"
             android:scaleType="centerInside" />
 
@@ -60,6 +64,7 @@
             android:layout_weight="0"
             android:scaleType="centerInside"
             android:layout_marginStart="@dimen/header_bar_button_padding"
+            android:background="@drawable/selectable_background"
             android:src="@drawable/menu_button_light"/>
     </LinearLayout>
 
                 android:textColor="@color/header_action_bar_text_color"
                 android:textSize="@dimen/text_size_micro" />
     </LinearLayout>
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
index dd7b242..fd0d680 100644 (file)
@@ -6,9 +6,9 @@
   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.
@@ -24,6 +24,8 @@
     android:layout_gravity="bottom"
     android:clickable="true"
     android:orientation="horizontal"
+    android:elevation="@dimen/action_bar_elevation"
+    android:background="@android:color/transparent"
     tools:ignore="ContentDescription" >
 
     <com.cyanogenmod.eleven.widgets.SquareImageView
@@ -64,4 +66,4 @@
             android:layout_height="@dimen/bab_progress_size"
             layout="@layout/play_pause_progress_button" />
     </FrameLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
index cb780d3..ccb1b99 100644 (file)
@@ -6,9 +6,9 @@
   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.
         android:layout_width="match_parent"
         android:layout_height="match_parent" >
 
-        <com.viewpagerindicator.TabPageIndicator
+        <com.cyanogenmod.eleven.widgets.ViewPagerTabs
             android:id="@+id/fragment_home_phone_pager_titles"
-            android:background="@color/tpi_background_color"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/tpi_height" />
+            android:layout_height="@dimen/tpi_height"
+            android:elevation="@dimen/action_bar_elevation"
+            style="@style/HeaderTabTextStyle" />
 
         <android.support.v4.view.ViewPager
             android:id="@+id/fragment_home_phone_pager"
@@ -37,4 +38,4 @@
             android:layout_below="@+id/fragment_home_phone_pager_titles" />
     </RelativeLayout>
 
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
index 694ae5e..b59a0e4 100644 (file)
@@ -6,9 +6,9 @@
   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.
         android:layout_height="match_parent"
         android:paddingLeft="@dimen/list_item_general_margin"
         android:paddingRight="@dimen/list_item_general_margin"
+        android:paddingTop="4dp"
+        android:paddingBottom="4dp"
         android:cacheColorHint="@color/transparent"
         android:drawSelectorOnTop="true"
         android:fadingEdge="vertical"
+        android:clipToPadding="false"
         android:fastScrollEnabled="true"
         android:horizontalSpacing="@dimen/grid_item_horizontal_spacing"
         android:scrollbarStyle="outsideOverlay"
         android:scrollbars="vertical"
         android:verticalSpacing="@dimen/grid_item_vertical_spacing" />
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
index 6a4dab3..014db85 100644 (file)
@@ -6,58 +6,66 @@
   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
+
+  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.
 -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.v7.widget.CardView
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:gravity="center_vertical" >
-
-    <include layout="@layout/square_image_view" />
+    android:elevation="3dp">
 
-    <RelativeLayout
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/grid_bottom_height"
-        android:layout_below="@+id/square_view"
-        android:background="@drawable/cardcontainer"
-        android:paddingLeft="@dimen/grid_item_padding_left" >
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <include layout="@layout/square_image_view" />
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:layout_centerVertical="true"
-            android:layout_toLeftOf="@+id/popup_menu_button">
-
-            <TextView
-                android:id="@+id/line_one"
-                style="@style/ListItemMainText.Grid.Single"
-                android:paddingBottom="1dp"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
-
-            <TextView
-                android:id="@+id/line_two"
-                style="@style/ListItemSecondaryText.Grid.Single"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
+            android:layout_height="@dimen/grid_bottom_height"
+            android:paddingLeft="@dimen/grid_item_padding_left"
+            android:orientation="horizontal">
+
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:layout_gravity="center_vertical"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/line_one"
+                    style="@style/ListItemMainText.Grid.Single"
+                    android:paddingBottom="1dp"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content" />
+
+                <TextView
+                    android:id="@+id/line_two"
+                    style="@style/ListItemSecondaryText.Grid.Single"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content" />
+
+            </LinearLayout>
+
+            <com.cyanogenmod.eleven.widgets.PopupMenuButton
+                android:id="@+id/popup_menu_button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:paddingRight="@dimen/grid_item_padding_right"
+                android:src="@drawable/menu_button" />
+
         </LinearLayout>
 
-        <com.cyanogenmod.eleven.widgets.PopupMenuButton
-            android:id="@id/popup_menu_button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:layout_centerVertical="true"
-            android:paddingRight="@dimen/grid_item_padding_right"
-            android:src="@drawable/menu_button" />
-    </RelativeLayout>
-
-</RelativeLayout>
\ No newline at end of file
+    </LinearLayout>
+
+</android.support.v7.widget.CardView>
index 5a44147..ed79e03 100644 (file)
@@ -22,7 +22,9 @@
     android:orientation="horizontal"
     android:paddingStart="@dimen/drag_and_drop_width"
     android:paddingEnd="@dimen/header_bar_padding_right"
-    android:background="@color/header_action_bar_color">
+    android:background="@color/header_action_bar_color"
+    android:elevation="@dimen/action_bar_elevation"
+    android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar">
 
     <ImageView
         android:id="@+id/header_bar_up"
@@ -32,6 +34,7 @@
         android:layout_weight="0"
         android:layout_marginRight="@dimen/header_bar_button_padding"
         android:scaleType="centerCrop"
+        android:background="@drawable/selectable_background"
         android:src="@drawable/btn_header_collapse"/>
 
     <TextView
@@ -55,6 +58,7 @@
         android:layout_marginStart="@dimen/header_bar_button_padding"
         android:layout_marginEnd="@dimen/header_bar_button_padding"
         android:src="@drawable/ic_action_search"
+        android:background="@drawable/selectable_background"
         android:scaleType="centerInside" />
 
     <ImageView
@@ -65,6 +69,7 @@
         android:layout_weight="0"
         android:scaleType="centerInside"
         android:layout_marginStart="@dimen/header_bar_button_padding"
+        android:background="@drawable/selectable_background"
         android:src="@drawable/menu_button_light"/>
 
-</com.cyanogenmod.eleven.ui.HeaderBar>
\ No newline at end of file
+</com.cyanogenmod.eleven.ui.HeaderBar>
index 25deca2..1c1f835 100644 (file)
@@ -19,7 +19,8 @@
     android:gravity="center_vertical"
     android:minHeight="@dimen/item_normal_height"
     android:paddingTop="@dimen/list_item_padding_top"
-    android:paddingBottom="@dimen/list_item_padding_bottom">
+    android:paddingBottom="@dimen/list_item_padding_bottom"
+    android:background="@android:color/transparent">
 
     <ImageView
         android:id="@+id/image"
@@ -72,4 +73,4 @@
         android:layout_alignParentRight="true"
         android:layout_centerVertical="true"
         android:src="@drawable/menu_button_light" />
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
index 3e692d2..13805ea 100644 (file)
@@ -6,7 +6,7 @@
      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
+     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,
@@ -53,5 +53,4 @@
         android:max="100"
         android:progressDrawable="@drawable/circular_drawable" />
 
-
 </com.cyanogenmod.eleven.widgets.PlayPauseProgressButton>
index 43683fa..300f287 100644 (file)
@@ -6,15 +6,20 @@
      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
+     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.
- -->
+-->
 <resources>
+    <!-- Material -->
+    <color name="primary">#607D8B</color>
+    <color name="primary_dark">#455A64</color>
+    <color name="primary_light">#78909C</color>
+    <color name="accent">#3f51b5</color>
 
     <!-- light color -->
     <color name="background_color">#ffe4e9ed</color>
     <color name="transparent">#00000000</color>
 
     <!-- Black -->
-    <color name="black">#ff000000</color>
+    <color name="black">#212121</color>
 
     <!-- White -->
-    <color name="white">#ffffffff</color>
+    <color name="white">#fafafa</color>
 
     <!-- Standard Text Color -->
     <color name="default_text_color">#cc231f20</color>
@@ -38,9 +43,6 @@
     <!-- Transparent white -->
     <color name="transparent_white">#ffcccccc</color>
 
-    <!-- A darkish color used for the action bar -->
-    <color name="action_bar_color">#ff0d0d0d</color>
-
     <!-- A light, Holo shade of blue -->
     <color name="holo_blue_light">#ff33b5e5</color>
 
@@ -89,9 +91,9 @@
     <color name="grid_list_item_text_color">#b3231f20</color>
 
     <!-- Top title page colors -->
-    <color name="tpi_background_color">#fff4f4f4</color>
-    <color name="tpi_text_color">#bf3d4049</color>
-    <color name="tpi_selected_text_color">#bf3d4049</color>
+    <color name="tab_ripple_color">#ffffff</color>
+    <color name="tab_accent_color">#ffffff</color>
+    <color name="tab_selected_underline_color">#ffffff</color>
 
     <!-- Search Colors -->
     <color name="search_hint_color">#4cffffff</color>
     <color name="letter_tile_default_color">#cccccc</color>
     <color name="letter_tile_font_color">#ffffff</color>
     <array name="letter_tile_colors">
-        <item>#883397</item>
-        <item>#4B498C</item>
-        <item>#4E5BA7</item>
-        <item>#41A4F4</item>
-        <item>#10887C</item>
-        <item>#689144</item>
-        <item>#B9BF45</item>
-        <item>#757578</item>
+        <item>#9C27B0</item>
+        <item>#2196F3</item>
+        <item>#3F51B5</item>
+        <item>#009688</item>
+        <item>#8BC34A</item>
+        <item>#F44336</item>
+        <item>#9E9E9E</item>
+        <item>#FF5722</item>
+        <item>#795548</item>
     </array>
 
     <array name="letter_tile_vibrant_dark_colors">
-        <item>#b74bc9</item>
-        <item>#6967bf</item>
-        <item>#2a315a</item>
-        <item>#07497d</item>
-        <item>#0c6c64</item>
-        <item>#415a2a</item>
-        <item>#5f6322</item>
-        <item>#505052</item>
+        <item>#7B1FA2</item>
+        <item>#1976D2</item>
+        <item>#303F9F</item>
+        <item>#00796B</item>
+        <item>#689F38</item>
+        <item>#D32F2F</item>
+        <item>#616161</item>
+        <item>#E64A19</item>
+        <item>#5D4037</item>
     </array>
 </resources>
index 8ea7096..38314c2 100644 (file)
     <!-- Text sizes -->
     <dimen name="text_size_extra_micro">10.0sp</dimen>
     <dimen name="text_size_micro">12.0sp</dimen>
-    <dimen name="text_size_small">14.0sp</dimen>
-    <dimen name="text_size_medium">16.0sp</dimen>
-    <dimen name="text_size_large">18.0sp</dimen>
-    <dimen name="text_size_x_large">24.0sp</dimen>
-    <dimen name="text_size_dayum">36.0sp</dimen>
+    <dimen name="text_size_small">12.0sp</dimen>
+    <dimen name="text_size_medium">14.0sp</dimen>
+    <dimen name="text_size_large">16.0sp</dimen>
+    <dimen name="text_size_x_large">22.0sp</dimen>
+    <dimen name="text_size_dayum">34.0sp</dimen>
 
     <!-- Frequently used spacing between elements in many layouts -->
-    <dimen name="standard_padding">10.0dip</dimen>
+    <dimen name="standard_padding">16.0dip</dimen>
 
     <!-- overflow menu used on page headers and in list items -->
     <dimen name="overflow_height">30.0dip</dimen>
     <dimen name="overflow_width">24.0dip</dimen>
 
     <!-- List and grid view padding -->
-    <dimen name="list_preferred_item_padding">10.0dip</dimen>
-    <dimen name="list_menu_item_padding_right">2.0dip</dimen>
+    <dimen name="list_preferred_item_padding">14.0dip</dimen>
+    <dimen name="list_menu_item_padding_right">4.0dip</dimen>
     <dimen name="list_item_general_margin">16.0dip</dimen>
     <dimen name="list_item_menu_button_width">24.0dip</dimen>
     <dimen name="list_item_menu_button_height">30.0dip</dimen>
-    <dimen name="list_item_padding_top">10.0dip</dimen>
-    <dimen name="list_item_padding_bottom">10.0dip</dimen>
+    <dimen name="list_item_padding_top">12.0dip</dimen>
+    <dimen name="list_item_padding_bottom">12.0dip</dimen>
     <dimen name="list_item_header_size">16.0sp</dimen>
-    <dimen name="list_item_footer_size">20.0sp</dimen>
+    <dimen name="list_item_footer_size">18.0sp</dimen>
     <dimen name="list_item_main_text_size">@dimen/text_size_small</dimen>
     <dimen name="list_item_secondary_text_size">@dimen/text_size_micro</dimen>
     <dimen name="list_item_queue_text_padding_left">15.0dip</dimen>
@@ -69,6 +69,8 @@
     <dimen name="list_item_image_width">50.0dip</dimen>
     <dimen name="list_item_top_track_image_size">26.0dip</dimen>
 
+    <dimen name="action_bar_elevation">4dp</dimen>
+
     <!-- Bottom Action Bar -->
     <dimen name="bottom_action_bar_height">50.0dip</dimen>
     <dimen name="bottom_action_bar_item_width">56.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_height">56.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">24.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_padding_right">16.0dp</dimen>
     <dimen name="header_bar_button_container_padding">8.0dp</dimen>
-    <dimen name="header_bar_button_padding">6.0dp</dimen>
+    <dimen name="header_bar_button_padding">16.0dp</dimen>
 
     <!-- Title Page Indicator Settings -->
-    <dimen name="tpi_height">50dp</dimen>
-    <dimen name="tpi_footer_line_height">0dp</dimen>
-    <dimen name="tpi_footer_indicator_height">6dp</dimen>
-    <dimen name="tpi_text_size">16sp</dimen>
+    <dimen name="tpi_height">48dp</dimen>
+    <dimen name="tab_text_size">14sp</dimen>
+    <dimen name="tab_selected_underline_height">2dp</dimen>
 
     <dimen name="list_item_progress_width">45.0dip</dimen>
     <dimen name="list_item_progress_height">45.0dip</dimen>
index 9055610..8bbae19 100644 (file)
@@ -6,18 +6,17 @@
      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
+     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.
- -->
+-->
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- Main Holo -->
-    <style name="Eleven.Theme" parent="@android:style/Theme.Holo.Light">
+    <!-- Main Material -->
+    <style name="Eleven.Theme" parent="@android:style/Theme.Material.Light.DarkActionBar">
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:popupMenuStyle">@style/PopupMenu</item>
         <item name="android:dropDownListViewStyle">@style/DropDownListView</item>
         <item name="android:actionBarStyle">@style/ActionBar</item>
         <item name="android:actionOverflowButtonStyle">@style/ActionOverFlowButton</item>
         <item name="android:actionBarWidgetTheme">@style/ActionBarWidgetTheme</item>
-        <item name="vpiTabPageIndicatorStyle">@style/Eleven.TabPageIndicator</item>
+        <item name="android:colorPrimary">@color/primary</item>
+        <item name="android:colorPrimaryDark">@color/primary_dark</item>
+        <item name="android:colorAccent">@color/accent</item>
     </style>
 
-    <style name="ActionBarWidgetTheme" parent="@android:style/Theme.Holo">
+    <style name="ActionBarWidgetTheme" parent="@android:style/Theme.Material">
         <!-- This is the color of the search text hint in the action bar -->
         <item name="android:textColorHint">@color/search_hint_color</item>
         <item name="android:popupMenuStyle">@style/PopupMenu</item>
         <item name="android:dropDownListViewStyle">@style/DropDownListView</item>
         <item name="android:textAppearanceSmallPopupMenu">@style/SmallPopupMenu</item>
         <item name="android:textAppearanceLargePopupMenu">@style/LargePopupMenu</item>
+        <!-- Empty icon -->
+        <item name="android:icon">@android:color/transparent</item>
     </style>
 
     <!-- Make the action bar not take up space -->
     <style name="Eleven.Theme.ActionBar.Overlay" parent="@style/Eleven.Theme">
-        <item name="android:windowActionBarOverlay">true</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowActionBar">false</item>
     </style>
 
     <!-- Set the default list view divider color and size -->
-    <style name="ListView" parent="@android:style/Widget.Holo.ListView">
+    <style name="ListView" parent="@android:style/Widget.Material.ListView">
         <item name="android:divider">@color/list_item_divider_color</item>
         <item name="android:dividerHeight">@dimen/divider_height</item>
     </style>
-    
+
     <!-- Sets up the pop up menu backgroudn resource -->
-    <style name="PopupMenu" parent="@android:style/Widget.Holo.PopupMenu">
+    <style name="PopupMenu" parent="@android:style/Widget.Material.PopupMenu">
         <item name="android:popupBackground">@drawable/menu_background</item>
     </style>
 
     <!-- Sets up the pop up menu divider color and height -->
-    <style name="DropDownListView" parent="@android:style/Widget.Holo.ListView.DropDown">
+    <style name="DropDownListView" parent="@android:style/Widget.Material.ListView.DropDown">
         <item name="android:divider">@color/menu_divider_color</item>
         <item name="android:dividerHeight">@dimen/divider_height</item>
     </style>
     </style>
 
     <!-- Sets the action bar title text style -->
-    <style name="ActionBar" parent="@android:style/Widget.Holo.ActionBar">
+    <style name="ActionBar" parent="@android:style/Widget.Material.ActionBar">
         <item name="android:titleTextStyle">@style/ActionBar.TitleText</item>
         <item name="android:subtitleTextStyle">@style/ActionBar.SubtitleText</item>
         <item name="android:background">@color/header_action_bar_color</item>
     </style>
 
     <!-- Sets the action bar title text color -->
-    <style name="ActionBar.TitleText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
+    <style name="ActionBar.TitleText" parent="@android:style/TextAppearance.Material.Widget.ActionBar.Title">
         <item name="android:textColor">@color/header_action_bar_text_color</item>
         <item name="android:textSize">@dimen/text_size_medium</item>
-        <item name="android:textStyle">bold</item>
     </style>
 
-    <style name="ActionBar.SubtitleText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle">
+    <style name="ActionBar.SubtitleText" parent="@android:style/TextAppearance.Material.Widget.ActionBar.Subtitle">
         <item name="android:textColor">@color/header_action_bar_text_color</item>
     </style>
 
     <!-- Sets the action bar menu icon -->
-    <style name="ActionOverFlowButton" parent="@android:style/Widget.Holo.ActionButton.Overflow">
+    <style name="ActionOverFlowButton" parent="@android:style/Widget.Material.ActionButton.Overflow">
         <item name="android:src">@drawable/menu_button_light</item>
         <item name="android:minWidth">0dip</item>
         <item name="android:paddingLeft">8dip</item>
     </style>
 
     <!-- Shortcut Activity theme -->
-    <style name="Theme.Transparent" parent="@android:style/Theme.Holo.NoActionBar">
+    <style name="Theme.Transparent" parent="@android:style/Theme.Material.NoActionBar">
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:windowBackground">@color/transparent</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:backgroundDimEnabled">false</item>
     </style>
 
-    <!-- Search Activity theme -->
-    <style name="Theme.ActionBarIcon"  parent="@style/Eleven.Theme">
-        <item name="android:homeAsUpIndicator">@drawable/ic_action_back</item>
-    </style>
-
     <!-- Notification bar event text -->
     <style name="NotificationText">
         <item name="android:layout_width">match_parent</item>
         <item name="android:ellipsize">end</item>
         <item name="android:fadingEdge">horizontal</item>
         <item name="android:singleLine">true</item>
-    </style>
-
-    <!-- Notification bar actions -->
-    <style name="NotificationAction">
-        <item name="android:layout_width">@dimen/notification_action_width</item>
-        <item name="android:layout_height">@dimen/notification_action_height</item>
-        <item name="android:gravity">center|right</item>
-        <item name="android:scaleType">fitCenter</item>
-        <item name="android:padding">@dimen/notification_action_padding</item>
-        <item name="android:background">?android:selectableItemBackground</item>
-    </style>
-
-    <style name="NotificationAction.Previous" parent="@style/NotificationAction">
-        <item name="android:src">@drawable/btn_playback_previous</item>
-        <item name="android:visibility">gone</item>
-        <item name="android:contentDescription">@string/accessibility_prev</item>
-    </style>
-
-    <style name="NotificationAction.Play" parent="@style/NotificationAction">
-        <item name="android:src">@drawable/btn_playback_play</item>
-        <item name="android:contentDescription">@string/accessibility_play</item>
-    </style>
-
-    <style name="NotificationAction.Next" parent="@style/NotificationAction">
-        <item name="android:src">@drawable/btn_playback_next</item>
-        <item name="android:contentDescription">@string/accessibility_next</item>
-    </style>
-
-    <style name="NotificationAction.Collapse" parent="@style/NotificationAction">
-        <item name="android:src">@drawable/btn_notification_collapse</item>
+        <item name="android:textColor">#212121</item>
     </style>
 
     <!-- Bottom Action Bar TextViews -->
         <item name="android:scaleType">centerInside</item>
     </style>
 
-    <style name="Eleven.TabPageIndicator" parent="@style/Widget">
-        <item name="android:gravity">center</item>
-        <item name="android:background">@drawable/tabpageindicator</item>
-        <item name="android:paddingLeft">22dp</item>
-        <item name="android:paddingRight">22dp</item>
-        <item name="android:textAppearance">@style/Eleven.TextAppearance.TabPageIndicator</item>
-        <item name="android:textSize">@dimen/tpi_text_size</item>
-        <item name="android:maxLines">1</item>
-    </style>
-
-    <style name="Eleven.TextAppearance.TabPageIndicator" parent="Widget">
-        <item name="android:textStyle">bold</item>
-        <item name="android:textColor">@color/tpi_text_color</item>
+    <style name="HeaderTabTextStyle" parent="android:style/Widget.Material.ActionBar.TabText">
+        <item name="android:textColor">@color/tab_text_color</item>
+        <item name="android:textSize">@dimen/tab_text_size</item>
+        <item name="android:fontFamily">"sans-serif-medium"</item>
     </style>
 </resources>
diff --git a/res/values/themeconfig.xml b/res/values/themeconfig.xml
deleted file mode 100644 (file)
index a71bb17..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
- -->
-<resources>
-
-    <!-- action bar color -->
-    <color name="action_bar">@color/action_bar_color</color>
-
-    <!-- The action bar title color -->
-    <color name="action_bar_title">@color/white</color>
-
-    <!-- The action bar sub title color -->
-    <color name="action_bar_subtitle">@color/transparent_white</color>
-
-    <!-- Adpater lines -->
-    <color name="line_one">@color/white</color>
-    <color name="line_two">@color/transparent_white</color>
-
-    <!-- Now playing -->
-    <color name="audio_player_current_time">@color/white</color>
-    <color name="audio_player_total_time">@color/white</color>
-    <color name="audio_player_line_one">@color/white</color>
-    <color name="audio_player_line_two">@color/transparent_white</color>
-    <color name="audio_player_pager_container">@color/action_bar_color</color>
-
-    <!-- Bottom action bar -->
-    <color name="bottom_action_bar">@color/action_bar_color</color>
-    <color name="bab_line_one">@color/white</color>
-    <color name="bab_line_two">@color/transparent_white</color>
-
-    <!-- Action bar items -->
-    <color name="favorite_normal">@color/transparent_white</color>
-    <color name="search_action">@color/transparent_white</color>
-    <color name="shop_action">@color/transparent_white</color>
-    <color name="pinn_to_action">@color/transparent_white</color>
-
-</resources>
diff --git a/res/values/vpi__attrs.xml b/res/values/vpi__attrs.xml
deleted file mode 100644 (file)
index 989d302..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 Jake Wharton
-     Copyright (C) 2011 Patrik Ã…kerfeldt
-
-     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.
--->
-
-<resources>
-    <declare-styleable name="ViewPagerIndicator">
-        <!-- Style of the circle indicator. -->
-        <attr name="vpiCirclePageIndicatorStyle" format="reference"/>
-        <!-- Style of the icon indicator's views. -->
-        <attr name="vpiIconPageIndicatorStyle" format="reference"/>
-        <!-- Style of the line indicator. -->
-        <attr name="vpiLinePageIndicatorStyle" format="reference"/>
-        <!-- Style of the title indicator. -->
-        <attr name="vpiTitlePageIndicatorStyle" format="reference"/>
-        <!-- Style of the tab indicator's tabs. -->
-        <attr name="vpiTabPageIndicatorStyle" format="reference"/>
-        <!-- Style of the underline indicator. -->
-        <attr name="vpiUnderlinePageIndicatorStyle" format="reference"/>
-    </declare-styleable>
-
-    <attr name="centered" format="boolean" />
-    <attr name="selectedColor" format="color" />
-    <attr name="strokeWidth" format="dimension" />
-    <attr name="unselectedColor" format="color" />
-
-    <declare-styleable name="CirclePageIndicator">
-        <!-- Whether or not the indicators should be centered. -->
-        <attr name="centered" />
-        <!-- Color of the filled circle that represents the current page. -->
-        <attr name="fillColor" format="color" />
-        <!-- Color of the filled circles that represents pages. -->
-        <attr name="pageColor" format="color" />
-        <!-- Orientation of the indicator. -->
-        <attr name="android:orientation"/>
-        <!-- Radius of the circles. This is also the spacing between circles. -->
-        <attr name="radius" format="dimension" />
-        <!-- Whether or not the selected indicator snaps to the circles. -->
-        <attr name="snap" format="boolean" />
-        <!-- Color of the open circles. -->
-        <attr name="strokeColor" format="color" />
-        <!-- Width of the stroke used to draw the circles. -->
-        <attr name="strokeWidth" />
-        <!-- View background -->
-        <attr name="android:background"/>
-    </declare-styleable>
-
-    <declare-styleable name="LinePageIndicator">
-        <!-- Whether or not the indicators should be centered. -->
-        <attr name="centered" />
-        <!-- Color of the unselected lines that represent the pages. -->
-        <attr name="unselectedColor" />
-        <!-- Color of the selected line that represents the current page. -->
-        <attr name="selectedColor" />
-        <!-- Width of each indicator line. -->
-        <attr name="lineWidth" format="dimension" />
-        <!-- Width of each indicator line's stroke. -->
-        <attr name="strokeWidth" />
-        <!-- Width of the gap between each indicator line. -->
-        <attr name="gapWidth" format="dimension" />
-        <!-- View background -->
-        <attr name="android:background"/>
-    </declare-styleable>
-
-    <declare-styleable name="TitlePageIndicator">
-        <!-- Screen edge padding. -->
-        <attr name="clipPadding" format="dimension" />
-        <!-- Color of the footer line and indicator. -->
-        <attr name="footerColor" format="color" />
-        <!-- Height of the footer line. -->
-        <attr name="footerLineHeight" format="dimension" />
-        <!-- Style of the indicator. Default is triangle. -->
-        <attr name="footerIndicatorStyle">
-            <enum name="none" value="0" />
-            <enum name="triangle" value="1" />
-            <enum name="underline" value="2" />
-        </attr>
-        <!-- Height of the indicator above the footer line. -->
-        <attr name="footerIndicatorHeight" format="dimension" />
-        <!-- Left and right padding of the underline indicator. -->
-        <attr name="footerIndicatorUnderlinePadding" format="dimension" />
-        <!-- Padding between the bottom of the title and the footer. -->
-        <attr name="footerPadding" format="dimension" />
-        <!-- Position of the line. -->
-        <attr name="linePosition">
-            <enum name="bottom" value="0"/>
-            <enum name="top" value="1"/>
-        </attr>
-        <!-- Color of the selected title. -->
-        <attr name="selectedColor" />
-        <!-- Whether or not the selected item is displayed as bold. -->
-        <attr name="selectedBold" format="boolean" />
-        <!-- Whether or not to bold all items. -->
-        <attr name="boldAll" format="boolean" />
-        <!-- Color of regular titles. -->
-        <attr name="android:textColor" />
-        <!-- Size of title text. -->
-        <attr name="android:textSize" />
-        <!-- Padding between titles when bumping into each other. -->
-        <attr name="titlePadding" format="dimension" />
-        <!-- Padding between titles and the top of the View. -->
-        <attr name="topPadding" format="dimension" />
-        <!-- View background -->
-        <attr name="android:background"/>
-    </declare-styleable>
-
-    <declare-styleable name="UnderlinePageIndicator">
-        <!-- Whether or not the selected indicator fades. -->
-        <attr name="fades" format="boolean" />
-        <!-- Length of the delay to fade the indicator. -->
-        <attr name="fadeDelay" format="integer" />
-        <!-- Length of the indicator fade to transparent. -->
-        <attr name="fadeLength" format="integer" />
-        <!-- Color of the selected line that represents the current page. -->
-        <attr name="selectedColor" />
-        <!-- View background -->
-        <attr name="android:background"/>
-    </declare-styleable>
-</resources>
diff --git a/res/values/vpi__colors.xml b/res/values/vpi__colors.xml
deleted file mode 100644 (file)
index 62ca607..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 Jake Wharton
-
-     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.
--->
-
-<resources>
-    <color name="vpi__background_holo_dark">#ff000000</color>
-    <color name="vpi__background_holo_light">#fff3f3f3</color>
-    <color name="vpi__bright_foreground_holo_dark">@color/vpi__background_holo_light</color>
-    <color name="vpi__bright_foreground_holo_light">@color/vpi__background_holo_dark</color>
-    <color name="vpi__bright_foreground_disabled_holo_dark">#ff4c4c4c</color>
-    <color name="vpi__bright_foreground_disabled_holo_light">#ffb2b2b2</color>
-    <color name="vpi__bright_foreground_inverse_holo_dark">@color/vpi__bright_foreground_holo_light</color>
-    <color name="vpi__bright_foreground_inverse_holo_light">@color/vpi__bright_foreground_holo_dark</color>
-</resources>
diff --git a/res/values/vpi__defaults.xml b/res/values/vpi__defaults.xml
deleted file mode 100644 (file)
index 84e2dce..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 Jake Wharton
-
-     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.
--->
-
-<resources>
-    <bool name="default_circle_indicator_centered">true</bool>
-    <color name="default_circle_indicator_fill_color">#FFFFFFFF</color>
-    <color name="default_circle_indicator_page_color">#00000000</color>
-    <integer name="default_circle_indicator_orientation">0</integer>
-    <dimen name="default_circle_indicator_radius">3dp</dimen>
-    <bool name="default_circle_indicator_snap">false</bool>
-    <color name="default_circle_indicator_stroke_color">#FFDDDDDD</color>
-    <dimen name="default_circle_indicator_stroke_width">1dp</dimen>
-
-    <dimen name="default_line_indicator_line_width">12dp</dimen>
-    <dimen name="default_line_indicator_gap_width">4dp</dimen>
-    <dimen name="default_line_indicator_stroke_width">1dp</dimen>
-    <color name="default_line_indicator_selected_color">#FF33B5E5</color>
-    <color name="default_line_indicator_unselected_color">#FFBBBBBB</color>
-    <bool name="default_line_indicator_centered">true</bool>
-
-    <dimen name="default_title_indicator_clip_padding">4dp</dimen>
-    <color name="default_title_indicator_footer_color">#FF33B5E5</color>
-    <dimen name="default_title_indicator_footer_line_height">2dp</dimen>
-    <integer name="default_title_indicator_footer_indicator_style">2</integer>
-    <dimen name="default_title_indicator_footer_indicator_height">4dp</dimen>
-    <dimen name="default_title_indicator_footer_indicator_underline_padding">20dp</dimen>
-    <dimen name="default_title_indicator_footer_padding">7dp</dimen>
-    <integer name="default_title_indicator_line_position">0</integer>
-    <color name="default_title_indicator_selected_color">#FFFFFFFF</color>
-    <bool name="default_title_indicator_selected_bold">true</bool>
-    <bool name="default_title_indicator_bold_all">false</bool>
-    <color name="default_title_indicator_text_color">#BBFFFFFF</color>
-    <dimen name="default_title_indicator_text_size">15dp</dimen>
-    <dimen name="default_title_indicator_title_padding">5dp</dimen>
-    <dimen name="default_title_indicator_top_padding">7dp</dimen>
-
-    <bool name="default_underline_indicator_fades">true</bool>
-    <integer name="default_underline_indicator_fade_delay">300</integer>
-    <integer name="default_underline_indicator_fade_length">400</integer>
-    <color name="default_underline_indicator_selected_color">#FF33B5E5</color>
-</resources>
\ No newline at end of file
diff --git a/res/values/vpi__styles.xml b/res/values/vpi__styles.xml
deleted file mode 100644 (file)
index 4f40f4a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 Jake Wharton
-
-     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.
--->
-
-<resources>
-    <style name="Theme.PageIndicatorDefaults" parent="android:Theme">
-        <item name="vpiIconPageIndicatorStyle">@style/Widget.IconPageIndicator</item>
-        <item name="vpiTabPageIndicatorStyle">@style/Widget.TabPageIndicator</item>
-    </style>
-
-    <style name="Widget">
-    </style>
-
-    <style name="Widget.TabPageIndicator" parent="Widget">
-        <item name="android:gravity">center</item>
-        <item name="android:background">@drawable/vpi__tab_indicator</item>
-        <item name="android:paddingLeft">22dip</item>
-        <item name="android:paddingRight">22dip</item>
-        <item name="android:paddingTop">12dp</item>
-        <item name="android:paddingBottom">12dp</item>
-        <item name="android:textAppearance">@style/TextAppearance.TabPageIndicator</item>
-        <item name="android:textSize">12sp</item>
-        <item name="android:maxLines">1</item>
-    </style>
-
-    <style name="TextAppearance.TabPageIndicator" parent="Widget">
-        <item name="android:textStyle">bold</item>
-        <item name="android:textColor">@color/vpi__dark_theme</item>
-    </style>
-
-    <style name="Widget.IconPageIndicator" parent="Widget">
-        <item name="android:layout_marginLeft">6dp</item>
-        <item name="android:layout_marginRight">6dp</item>
-    </style>
-</resources>
index cc0d82c..05860ea 100644 (file)
@@ -6,9 +6,9 @@
   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.
index 3d4abbb..afbf13e 100644 (file)
@@ -33,7 +33,6 @@ import com.cyanogenmod.eleven.loaders.QueueLoader;
 import com.cyanogenmod.eleven.menu.CreateNewPlaylist;
 import com.cyanogenmod.eleven.utils.MusicUtils;
 import com.cyanogenmod.eleven.utils.NavUtils;
-import com.cyanogenmod.eleven.widgets.theme.HoloSelector;
 
 /**
  * Simple Header bar wrapper class that also has its own menu bar button.
@@ -62,7 +61,6 @@ public class HeaderBar extends LinearLayout {
         super.onFinishInflate();
 
         mMenuButton = (ImageView)findViewById(R.id.header_bar_menu_button);
-        mMenuButton.setBackground(new HoloSelector(getContext()));
         mMenuButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -71,7 +69,6 @@ public class HeaderBar extends LinearLayout {
         });
 
         mSearchButton = (ImageView)findViewById(R.id.header_bar_search_button);
-        mSearchButton.setBackground(new HoloSelector(getContext()));
         mSearchButton.setOnClickListener(new View.OnClickListener() {
         @Override
             public void onClick(View v) {
@@ -81,7 +78,6 @@ public class HeaderBar extends LinearLayout {
 
 
         mBackButton = (ImageView)findViewById(R.id.header_bar_up);
-        mBackButton.setBackground(new HoloSelector(getContext()));
 
         mTitleText = (TextView)findViewById(R.id.header_bar_title);
     }
@@ -173,4 +169,4 @@ public class HeaderBar extends LinearLayout {
 
         return false;
     }
-}
\ No newline at end of file
+}
index bfaa343..910fb1b 100644 (file)
@@ -34,6 +34,7 @@ import android.view.MenuItem;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
+import android.widget.Toolbar;
 
 import com.cyanogenmod.eleven.IElevenService;
 import com.cyanogenmod.eleven.MusicPlaybackService;
@@ -57,7 +58,7 @@ import java.util.ArrayList;
  * bind to Apollo's service.
  * <p>
  * {@link SlidingPanelActivity} extends from this skeleton.
- * 
+ *
  * @author Andrew Neal (andrewdneal@gmail.com)
  */
 public abstract class BaseActivity extends FragmentActivity implements ServiceConnection,
@@ -68,6 +69,8 @@ public abstract class BaseActivity extends FragmentActivity implements ServiceCo
      */
     private final ArrayList<MusicStateListener> mMusicStateListener = Lists.newArrayList();
 
+    private Toolbar mToolBar;
+
     private int mActionBarHeight;
 
     /**
@@ -121,8 +124,6 @@ public abstract class BaseActivity extends FragmentActivity implements ServiceCo
         // Initialize the broadcast receiver
         mPlaybackStatus = new PlaybackStatus(this);
 
-        getActionBar().setTitle(getString(R.string.app_name).toUpperCase());
-
         // Calculate ActionBar height
         TypedValue value = new TypedValue();
         if (getTheme().resolveAttribute(android.R.attr.actionBarSize, value, true))
@@ -134,6 +135,11 @@ public abstract class BaseActivity extends FragmentActivity implements ServiceCo
         // Set the layout
         setContentView(setContentView());
 
+        mToolBar = (Toolbar) findViewById(R.id.toolbar);
+        setActionBar(mToolBar);
+
+        getActionBar().setTitle(getString(R.string.app_name).toUpperCase());
+
         // set the background on the root view
         getWindow().getDecorView().getRootView().setBackgroundColor(
                 getResources().getColor(R.color.background_color));
@@ -280,7 +286,7 @@ public abstract class BaseActivity extends FragmentActivity implements ServiceCo
         if (mActionBarBackground == null) {
             final int actionBarColor = getResources().getColor(R.color.header_action_bar_color);
             mActionBarBackground = new ColorDrawable(actionBarColor);
-            getActionBar().setBackgroundDrawable(mActionBarBackground);
+            mToolBar.setBackgroundDrawable(mActionBarBackground);
         }
     }
 
@@ -293,6 +299,12 @@ public abstract class BaseActivity extends FragmentActivity implements ServiceCo
         mActionBarBackground.setAlpha(alpha);
     }
 
+    public void setActionBarElevation(boolean isElevated) {
+        float targetElevation = isElevated
+                ? getResources().getDimension(R.dimen.action_bar_elevation) : 0;
+        mToolBar.setElevation(targetElevation);
+    }
+
     public void setFragmentPadding(boolean enablePadding) {
         final int height = enablePadding ? mActionBarHeight : 0;
         findViewById(R.id.activity_base_content).setPadding(0, height, 0, 0);
index eacc2fd..6db3675 100644 (file)
  */
 package com.cyanogenmod.eleven.ui.activities;
 
+import android.animation.ArgbEvaluator;
+import android.animation.ObjectAnimator;
 import android.content.Intent;
 import android.graphics.Bitmap;
+import android.graphics.Color;
 import android.net.Uri;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Handler;
 import android.provider.MediaStore;
@@ -27,6 +31,7 @@ import android.support.v4.app.FragmentTransaction;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.MenuItem;
+import android.view.Window;
 
 import com.cyanogenmod.eleven.Config;
 import com.cyanogenmod.eleven.R;
@@ -41,6 +46,7 @@ import com.cyanogenmod.eleven.ui.fragments.phone.MusicBrowserPhoneFragment;
 import com.cyanogenmod.eleven.ui.fragments.profile.LastAddedFragment;
 import com.cyanogenmod.eleven.ui.fragments.profile.TopTracksFragment;
 import com.cyanogenmod.eleven.utils.ApolloUtils;
+import com.cyanogenmod.eleven.utils.BitmapWithColors;
 import com.cyanogenmod.eleven.utils.MusicUtils;
 import com.cyanogenmod.eleven.utils.NavUtils;
 
@@ -60,6 +66,7 @@ public class HomeActivity extends SlidingPanelActivity {
     private boolean mLoadedBaseFragment = false;
     private boolean mHasPendingPlaybackRequest = false;
     private Handler mHandler = new Handler();
+    private boolean mBrowsePanelActive = true;
 
     /**
      * Used by the up action to determine how to handle this
@@ -91,7 +98,8 @@ public class HomeActivity extends SlidingPanelActivity {
             mTopLevelActivity = true;
         }
 
-        getSupportFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
+        getSupportFragmentManager().addOnBackStackChangedListener(
+                new FragmentManager.OnBackStackChangedListener() {
             @Override
             public void onBackStackChanged() {
                 Fragment topFragment = getTopFragment();
@@ -102,19 +110,14 @@ public class HomeActivity extends SlidingPanelActivity {
                     ISetupActionBar setupActionBar = (ISetupActionBar) topFragment;
                     setupActionBar.setupActionBar();
 
-                    if (topFragment instanceof MusicBrowserPhoneFragment) {
-                        getActionBar().setIcon(R.drawable.ic_launcher);
-                        getActionBar().setHomeButtonEnabled(false);
-                    } else {
-                        getActionBar().setIcon(R.drawable.ic_action_back_padded);
-                        getActionBar().setHomeButtonEnabled(true);
-                    }
+                    getActionBar().setDisplayHomeAsUpEnabled(
+                            !(topFragment instanceof MusicBrowserPhoneFragment));
                 }
             }
         });
 
         // if intent wasn't UI related, process it as a audio playback request
-        if ( !intentHandled ) {
+        if (!intentHandled) {
             handlePlaybackIntent(launchIntent);
         }
 
@@ -153,6 +156,54 @@ public class HomeActivity extends SlidingPanelActivity {
         }
     }
 
+    @Override
+    public void onMetaChanged() {
+        super.onMetaChanged();
+        updateStatusBarColor();
+    }
+
+    @Override
+    protected void onSlide(float slideOffset) {
+        boolean isInBrowser = getCurrentPanel() == Panel.Browse && slideOffset < 0.7f;
+        if (isInBrowser != mBrowsePanelActive) {
+            mBrowsePanelActive = isInBrowser;
+            updateStatusBarColor();
+        }
+    }
+
+    private void updateStatusBarColor() {
+        if (mBrowsePanelActive || MusicUtils.getCurrentAlbumId() < 0) {
+            updateStatusBarColor(getResources().getColor(R.color.primary_dark));
+        } else {
+            new AsyncTask<Void, Void, Integer>() {
+                @Override
+                protected Integer doInBackground(Void... params) {
+                    ImageFetcher imageFetcher = ImageFetcher.getInstance(HomeActivity.this);
+                    final BitmapWithColors bitmap = imageFetcher.getArtwork(
+                            MusicUtils.getAlbumName(), MusicUtils.getCurrentAlbumId(),
+                            MusicUtils.getArtistName(), true);
+                    return bitmap != null ? bitmap.getVibrantDarkColor() : Color.TRANSPARENT;
+                }
+                @Override
+                protected void onPostExecute(Integer color) {
+                    if (color == Color.TRANSPARENT) {
+                        color = getResources().getColor(R.color.primary_dark);
+                    }
+                    updateStatusBarColor(color);
+                }
+            }.execute();
+        }
+    }
+
+    private void updateStatusBarColor(int color) {
+        final Window window = getWindow();
+        ObjectAnimator animator = ObjectAnimator.ofInt(window,
+                "statusBarColor", window.getStatusBarColor(), color);
+        animator.setEvaluator(new ArgbEvaluator());
+        animator.setDuration(300);
+        animator.start();
+    }
+
     private boolean parseIntentForFragment(Intent intent) {
         boolean handled = false;
         if (intent.getAction() != null) {
@@ -199,13 +250,14 @@ public class HomeActivity extends SlidingPanelActivity {
                     // this happens when they launch search which is its own activity and then
                     // browse through that back to home activity
                     mLoadedBaseFragment = true;
-                    getActionBar().setIcon(R.drawable.ic_action_back_padded);
-                    getActionBar().setHomeButtonEnabled(true);
+                    getActionBar().setDisplayHomeAsUpEnabled(true);
                 }
                 // the current top fragment is about to be hidden by what we are replacing
                 // it with -- so tell that fragment not to make its action bar menu items visible
                 Fragment oldTop = getTopFragment();
-                if(oldTop != null) { oldTop.setMenuVisibility(false); }
+                if (oldTop != null) {
+                    oldTop.setMenuVisibility(false);
+                }
 
                 transaction.commit();
                 handled = true;
index a538416..27ef14f 100644 (file)
@@ -301,8 +301,7 @@ public class SearchActivity extends FragmentActivity implements
 
         // Theme the action bar
         final ActionBar actionBar = getActionBar();
-        actionBar.setHomeButtonEnabled(true);
-        actionBar.setIcon(R.drawable.ic_action_search);
+        actionBar.setDisplayHomeAsUpEnabled(true);
 
         // Get the query String
         mFilterString = getIntent().getStringExtra(SearchManager.QUERY);
index e2ba8ee..c4f8139 100644 (file)
@@ -43,8 +43,7 @@ public class SettingsActivity extends PreferenceActivity {
         overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
 
         // UP
-        getActionBar().setIcon(R.drawable.ic_action_back_padded);
-        getActionBar().setHomeButtonEnabled(true);
+        getActionBar().setDisplayHomeAsUpEnabled(true);
 
         // Add the preferences
         addPreferencesFromResource(R.xml.settings);
index 35b67f9..5da768f 100644 (file)
@@ -113,13 +113,7 @@ public abstract class SlidingPanelActivity extends BaseActivity {
         mFirstPanel.setPanelSlideListener(new SimplePanelSlideListener() {
             @Override
             public void onPanelSlide(View panel, float slideOffset) {
-                if (slideOffset > 0.8f) {
-                    getActionBar().hide();
-                } else if (slideOffset < 0.75f) {
-                    getActionBar().show();
-                }
-
-                onSlide();
+                onSlide(slideOffset);
             }
 
             @Override
@@ -145,7 +139,7 @@ public abstract class SlidingPanelActivity extends BaseActivity {
                     mFirstPanel.setSlidingEnabled(false);
                 }
 
-                onSlide();
+                onSlide(slideOffset);
             }
 
             @Override
@@ -256,7 +250,7 @@ public abstract class SlidingPanelActivity extends BaseActivity {
         }
     }
 
-    protected void onSlide() {
+    protected void onSlide(float slideOffset) {
         for (ISlidingPanelListener listener : mSlidingPanelListeners) {
             listener.onBeginSlide();
         }
index cc8e6cf..cf459a9 100644 (file)
@@ -44,7 +44,6 @@ import com.cyanogenmod.eleven.utils.NavUtils;
 import com.cyanogenmod.eleven.utils.PopupMenuHelper;
 import com.cyanogenmod.eleven.widgets.IPopupMenuCallback;
 import com.cyanogenmod.eleven.widgets.LoadingEmptyContainer;
-import com.viewpagerindicator.TitlePageIndicator;
 
 /**
  * This class is used to display all of the albums on a user's device.
index a759576..a7219d5 100644 (file)
@@ -48,7 +48,6 @@ import com.cyanogenmod.eleven.utils.SectionCreatorUtils;
 import com.cyanogenmod.eleven.utils.SectionCreatorUtils.IItemCompare;
 import com.cyanogenmod.eleven.widgets.IPopupMenuCallback;
 import com.cyanogenmod.eleven.widgets.LoadingEmptyContainer;
-import com.viewpagerindicator.TitlePageIndicator;
 
 /**
  * This class is used to display all of the artists on a user's device.
index d081e58..877cda4 100644 (file)
@@ -21,6 +21,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.graphics.Outline;
 import android.media.AudioManager;
 import android.os.Bundle;
 import android.os.Handler;
@@ -39,6 +40,7 @@ import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.widget.ImageView;
 import android.widget.PopupMenu;
 import android.widget.TextView;
@@ -67,7 +69,6 @@ import com.cyanogenmod.eleven.widgets.QueueButton;
 import com.cyanogenmod.eleven.widgets.RepeatButton;
 import com.cyanogenmod.eleven.widgets.RepeatingImageButton;
 import com.cyanogenmod.eleven.widgets.ShuffleButton;
-import com.cyanogenmod.eleven.widgets.theme.HoloSelector;
 
 import java.lang.ref.WeakReference;
 
@@ -289,6 +290,17 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
      * Initializes the header bar
      */
     private void initHeaderBar() {
+        View headerBar = mRootView.findViewById(R.id.audio_player_header);
+        final int bottomActionBarHeight =
+                getResources().getDimensionPixelSize(R.dimen.bottom_action_bar_height);
+
+        headerBar.setOutlineProvider(new ViewOutlineProvider() {
+            @Override
+            public void getOutline(View view, Outline outline) {
+                outline.setRect(0, -bottomActionBarHeight, view.getWidth(), view.getHeight());
+            }
+        });
+
         // Title text
         mSongTitle = (TextView) mRootView.findViewById(R.id.header_bar_song_title);
         mArtistName = (TextView) mRootView.findViewById(R.id.header_bar_artist_title);
@@ -296,7 +308,6 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
         // 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) {
@@ -307,7 +318,6 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
         // Add to Playlist Button
         // Setup the playlist button - add a click listener to show the context
         mAddToPlaylistButton = (ImageView) mRootView.findViewById(R.id.header_bar_add_button);
-        mAddToPlaylistButton.setBackground(new HoloSelector(getActivity()));
 
         // Create the context menu when requested
         mAddToPlaylistButton.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
@@ -331,7 +341,6 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
         // Add the menu button
         // menu button
         mMenuButton = (ImageView) mRootView.findViewById(R.id.header_bar_menu_button);
-        mMenuButton.setBackground(new HoloSelector(getActivity()));
         mMenuButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
index bdbd454..7bbaf14 100644 (file)
@@ -34,11 +34,16 @@ public abstract class BaseFragment extends Fragment implements MusicStateListene
     protected abstract String getTitle();
     protected abstract int getLayoutToInflate();
 
+    protected boolean needsElevatedActionBar() {
+        return true;
+    }
+
     @Override
     public void setupActionBar() {
         getContainingActivity().setupActionBar(getTitle());
         getContainingActivity().setActionBarAlpha(255);
         getContainingActivity().setFragmentPadding(true);
+        getContainingActivity().setActionBarElevation(needsElevatedActionBar());
     }
 
     protected HomeActivity getContainingActivity() {
@@ -84,4 +89,4 @@ public abstract class BaseFragment extends Fragment implements MusicStateListene
     public void onPlaylistChanged() {
 
     }
-}
\ No newline at end of file
+}
index 597ee3e..1e57580 100644 (file)
@@ -27,7 +27,6 @@ import com.cyanogenmod.eleven.sectionadapter.SectionListContainer;
 import com.cyanogenmod.eleven.ui.fragments.profile.BasicSongFragment;
 import com.cyanogenmod.eleven.utils.MusicUtils;
 import com.cyanogenmod.eleven.utils.SectionCreatorUtils;
-import com.viewpagerindicator.TitlePageIndicator;
 
 /**
  * This class is used to display all of the songs on a user's device.
index b5751ad..1317c4b 100644 (file)
@@ -31,7 +31,7 @@ import com.cyanogenmod.eleven.ui.fragments.SongFragment;
 import com.cyanogenmod.eleven.utils.MusicUtils;
 import com.cyanogenmod.eleven.utils.PreferenceUtils;
 import com.cyanogenmod.eleven.utils.SortOrder;
-import com.viewpagerindicator.TabPageIndicator;
+import com.cyanogenmod.eleven.widgets.ViewPagerTabs;
 
 /**
  * This class is used to hold the {@link ViewPager} used for swiping between the
@@ -111,11 +111,12 @@ public class MusicBrowserPhoneFragment extends BaseFragment {
         // Offscreen pager loading limit
         mViewPager.setOffscreenPageLimit(mPagerAdapter.getCount() - 1);
 
-        // Initialze the TPI
-        final TabPageIndicator pageIndicator = (TabPageIndicator)mRootView
-                .findViewById(R.id.fragment_home_phone_pager_titles);
+        // Initialize the tab strip
+        final ViewPagerTabs tabs = (ViewPagerTabs)
+                mRootView.findViewById(R.id.fragment_home_phone_pager_titles);
         // Attach the ViewPager
-        pageIndicator.setViewPager(mViewPager);
+        tabs.setViewPager(mViewPager);
+        mViewPager.setOnPageChangeListener(tabs);
 
         if (mDefaultPageIdx != INVALID_PAGE_INDEX)  {
             navigateToPage(mDefaultPageIdx);
@@ -282,6 +283,12 @@ public class MusicBrowserPhoneFragment extends BaseFragment {
         return super.onOptionsItemSelected(item);
     }
 
+    @Override
+    protected boolean needsElevatedActionBar() {
+        // our view pager already has elevation
+        return false;
+    }
+
     private boolean isArtistPage() {
         return mViewPager.getCurrentItem() == MusicFragments.ARTIST.ordinal();
     }
index 1f5f70f..1e05e81 100644 (file)
@@ -8,8 +8,8 @@ import android.view.View.OnClickListener;
 import android.view.View.OnLongClickListener;
 import android.widget.ImageButton;
 
+import com.cyanogenmod.eleven.R;
 import com.cyanogenmod.eleven.utils.ApolloUtils;
-import com.cyanogenmod.eleven.widgets.theme.HoloSelector;
 
 public abstract class AudioButton extends ImageButton implements OnClickListener, OnLongClickListener {
     public static float ACTIVE_ALPHA = 1.0f;
@@ -18,9 +18,8 @@ public abstract class AudioButton extends ImageButton implements OnClickListener
     @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));
+        setBackground(getResources().getDrawable(R.drawable.selectable_background));
         // Control playback (cycle shuffle)
         setOnClickListener(this);
         // Show the cheat sheet
@@ -36,4 +35,4 @@ public abstract class AudioButton extends ImageButton implements OnClickListener
             return true;
         }
     }
-}
\ No newline at end of file
+}
index 1b8e988..2b68d02 100644 (file)
@@ -24,11 +24,10 @@ import android.widget.ImageButton;
 import com.cyanogenmod.eleven.R;
 import com.cyanogenmod.eleven.utils.ApolloUtils;
 import com.cyanogenmod.eleven.utils.MusicUtils;
-import com.cyanogenmod.eleven.widgets.theme.HoloSelector;
 
 /**
  * A custom {@link ImageButton} that represents the "play and pause" button.
- * 
+ *
  * @author Andrew Neal (andrewdneal@gmail.com)
  */
 public class PlayPauseButton extends ImageButton implements OnClickListener, OnLongClickListener {
@@ -50,8 +49,7 @@ public class PlayPauseButton extends ImageButton implements OnClickListener, OnL
     @SuppressWarnings("deprecation")
     public PlayPauseButton(final Context context, final AttributeSet attrs) {
         super(context, attrs);
-        // Theme the selector
-        setBackgroundDrawable(new HoloSelector(context));
+        setBackground(getResources().getDrawable(R.drawable.selectable_background));
         // Control playback (play/pause)
         setOnClickListener(this);
         // Show the cheat sheet
index f45bb47..c23ef35 100644 (file)
@@ -21,6 +21,8 @@ import android.util.AttributeSet;
 import android.view.View;
 import android.widget.ImageView;
 
+import com.cyanogenmod.eleven.R;
+
 public class PopupMenuButton extends ImageView implements IPopupMenuCallback,
         View.OnClickListener {
     protected int mPosition = -1;
@@ -29,6 +31,7 @@ public class PopupMenuButton extends ImageView implements IPopupMenuCallback,
     public PopupMenuButton(Context context, AttributeSet attrs) {
         super(context, attrs);
 
+        setBackground(getResources().getDrawable(R.drawable.selectable_background_light));
         setOnClickListener(this);
     }
 
index 9fb6758..d51154b 100644 (file)
@@ -23,7 +23,6 @@ import android.widget.ImageButton;
 import com.cyanogenmod.eleven.R;
 import com.cyanogenmod.eleven.utils.ApolloUtils;
 import com.cyanogenmod.eleven.utils.MusicUtils;
-import com.cyanogenmod.eleven.widgets.theme.HoloSelector;
 
 /**
  * A {@link ImageButton} that will repeatedly call a 'listener' method as long
@@ -47,9 +46,8 @@ public class RepeatingImageButton extends ImageButton implements OnClickListener
     @SuppressWarnings("deprecation")
     public RepeatingImageButton(final Context context, final AttributeSet attrs) {
         super(context, attrs);
-        // Theme the selector
         setPadding(0, 0, 0, 0);
-        setBackgroundDrawable(new HoloSelector(context));
+        setBackground(getResources().getDrawable(R.drawable.selectable_background));
         setFocusable(true);
         setLongClickable(true);
         setOnClickListener(this);
diff --git a/src/com/cyanogenmod/eleven/widgets/ViewPagerTabStrip.java b/src/com/cyanogenmod/eleven/widgets/ViewPagerTabStrip.java
new file mode 100644 (file)
index 0000000..d1ef9c3
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2014 The Android Open Source 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
+ */
+
+package com.cyanogenmod.eleven.widgets;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.LinearLayout;
+
+import com.cyanogenmod.eleven.R;
+
+public class ViewPagerTabStrip extends LinearLayout {
+    private int mSelectedUnderlineThickness;
+    private final Paint mSelectedUnderlinePaint;
+
+    private int mIndexForSelection;
+    private float mSelectionOffset;
+
+    public ViewPagerTabStrip(Context context) {
+        this(context, null);
+    }
+
+    public ViewPagerTabStrip(Context context, AttributeSet attrs) {
+        super(context, attrs);
+
+        final Resources res = context.getResources();
+
+        mSelectedUnderlineThickness =
+                res.getDimensionPixelSize(R.dimen.tab_selected_underline_height);
+        int underlineColor = res.getColor(R.color.tab_selected_underline_color);
+        int backgroundColor = res.getColor(R.color.header_action_bar_color);
+
+        mSelectedUnderlinePaint = new Paint();
+        mSelectedUnderlinePaint.setColor(underlineColor);
+
+        setBackgroundColor(backgroundColor);
+        setWillNotDraw(false);
+    }
+
+    /**
+     * Notifies this view that view pager has been scrolled. We save the tab index
+     * and selection offset for interpolating the position and width of selection
+     * underline.
+     */
+    void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+        mIndexForSelection = position;
+        mSelectionOffset = positionOffset;
+        invalidate();
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        int childCount = getChildCount();
+
+        // Thick colored underline below the current selection
+        if (childCount > 0) {
+            View selectedTitle = getChildAt(mIndexForSelection);
+            int selectedLeft = selectedTitle.getLeft();
+            int selectedRight = selectedTitle.getRight();
+            final boolean isRtl = isRtl();
+            final boolean hasNextTab = isRtl ? mIndexForSelection > 0
+                    : (mIndexForSelection < (getChildCount() - 1));
+            if ((mSelectionOffset > 0.0f) && hasNextTab) {
+                // Draw the selection partway between the tabs
+                View nextTitle = getChildAt(mIndexForSelection + (isRtl ? -1 : 1));
+                int nextLeft = nextTitle.getLeft();
+                int nextRight = nextTitle.getRight();
+
+                selectedLeft = (int) (mSelectionOffset * nextLeft +
+                        (1.0f - mSelectionOffset) * selectedLeft);
+                selectedRight = (int) (mSelectionOffset * nextRight +
+                        (1.0f - mSelectionOffset) * selectedRight);
+            }
+
+            int height = getHeight();
+            canvas.drawRect(selectedLeft, height - mSelectedUnderlineThickness,
+                    selectedRight, height, mSelectedUnderlinePaint);
+        }
+    }
+
+    private boolean isRtl() {
+        return getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
+    }
+}
diff --git a/src/com/cyanogenmod/eleven/widgets/ViewPagerTabs.java b/src/com/cyanogenmod/eleven/widgets/ViewPagerTabs.java
new file mode 100644 (file)
index 0000000..c02926d
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2014 The Android Open Source 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.
+ */
+package com.cyanogenmod.eleven.widgets;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.TypedArray;
+import android.graphics.Outline;
+import android.support.v4.view.PagerAdapter;
+import android.support.v4.view.ViewPager;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewOutlineProvider;
+import android.widget.FrameLayout;
+import android.widget.HorizontalScrollView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.cyanogenmod.eleven.R;
+
+/**
+ * Lightweight implementation of ViewPager tabs. This looks similar to traditional actionBar tabs,
+ * but allows for the view containing the tabs to be placed anywhere on screen. Text-related
+ * attributes can also be assigned in XML - these will get propogated to the child TextViews
+ * automatically.
+ */
+public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnPageChangeListener {
+
+    ViewPager mPager;
+    private ViewPagerTabStrip mTabStrip;
+
+    /**
+     * Linearlayout that will contain the TextViews serving as tabs. This is the only child
+     * of the parent HorizontalScrollView.
+     */
+    final int mTextStyle;
+    final ColorStateList mTextColor;
+    final int mTextSize;
+    final boolean mTextAllCaps;
+    int mPrevSelected = -1;
+    int mSidePadding;
+
+    private static final ViewOutlineProvider VIEW_BOUNDS_OUTLINE_PROVIDER =
+            new ViewOutlineProvider() {
+        @Override
+        public void getOutline(View view, Outline outline) {
+            outline.setRect(0, 0, view.getWidth(), view.getHeight());
+        }
+    };
+
+    private static final int TAB_SIDE_PADDING_IN_DPS = 10;
+
+    // TODO: This should use <declare-styleable> in the future
+    private static final int[] ATTRS = new int[] {
+        android.R.attr.textSize,
+        android.R.attr.textStyle,
+        android.R.attr.textColor,
+        android.R.attr.textAllCaps
+    };
+
+    /**
+     * Simulates actionbar tab behavior by showing a toast with the tab title when long clicked.
+     */
+    private class OnTabLongClickListener implements OnLongClickListener {
+        final int mPosition;
+
+        public OnTabLongClickListener(int position) {
+            mPosition = position;
+        }
+
+        @Override
+        public boolean onLongClick(View v) {
+            final int[] screenPos = new int[2];
+            getLocationOnScreen(screenPos);
+
+            final Context context = getContext();
+            final int width = getWidth();
+            final int height = getHeight();
+            final int screenWidth = context.getResources().getDisplayMetrics().widthPixels;
+
+            Toast toast = Toast.makeText(context, mPager.getAdapter().getPageTitle(mPosition),
+                    Toast.LENGTH_SHORT);
+
+            // Show the toast under the tab
+            toast.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL,
+                    (screenPos[0] + width / 2) - screenWidth / 2, screenPos[1] + height);
+
+            toast.show();
+            return true;
+        }
+    }
+
+    public ViewPagerTabs(Context context) {
+        this(context, null);
+    }
+
+    public ViewPagerTabs(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public ViewPagerTabs(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        setFillViewport(true);
+
+        mSidePadding = (int) (getResources().getDisplayMetrics().density * TAB_SIDE_PADDING_IN_DPS);
+
+        final TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
+        mTextSize = a.getDimensionPixelSize(0, 0);
+        mTextStyle = a.getInt(1, 0);
+        mTextColor = a.getColorStateList(2);
+        mTextAllCaps = a.getBoolean(3, false);
+
+        mTabStrip = new ViewPagerTabStrip(context);
+        addView(mTabStrip,
+                new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
+        a.recycle();
+
+        // enable shadow casting from view bounds
+        setOutlineProvider(VIEW_BOUNDS_OUTLINE_PROVIDER);
+    }
+
+    public void setViewPager(ViewPager viewPager) {
+        mPager = viewPager;
+        addTabs(mPager.getAdapter());
+    }
+
+    private void addTabs(PagerAdapter adapter) {
+        mTabStrip.removeAllViews();
+
+        final int count = adapter.getCount();
+        for (int i = 0; i < count; i++) {
+            addTab(adapter.getPageTitle(i), i);
+        }
+    }
+
+    private void addTab(CharSequence tabTitle, final int position) {
+        final TextView textView = new TextView(getContext());
+        textView.setText(tabTitle);
+        textView.setBackgroundResource(R.drawable.view_pager_tab_background);
+        textView.setGravity(Gravity.CENTER);
+        textView.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mPager.setCurrentItem(getRtlPosition(position));
+            }
+        });
+
+        textView.setOnLongClickListener(new OnTabLongClickListener(position));
+
+        // Assign various text appearance related attributes to child views.
+        if (mTextStyle > 0) {
+            textView.setTypeface(textView.getTypeface(), mTextStyle);
+        }
+        if (mTextSize > 0) {
+            textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
+        }
+        if (mTextColor != null) {
+            textView.setTextColor(mTextColor);
+        }
+        textView.setAllCaps(mTextAllCaps);
+        textView.setPadding(mSidePadding, 0, mSidePadding, 0);
+        mTabStrip.addView(textView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
+                LayoutParams.MATCH_PARENT, 1));
+        // Default to the first child being selected
+        if (position == 0) {
+            mPrevSelected = 0;
+            textView.setSelected(true);
+        }
+    }
+
+    @Override
+    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+        position = getRtlPosition(position);
+        int tabStripChildCount = mTabStrip.getChildCount();
+        if ((tabStripChildCount == 0) || (position < 0) || (position >= tabStripChildCount)) {
+            return;
+        }
+
+        mTabStrip.onPageScrolled(position, positionOffset, positionOffsetPixels);
+    }
+
+    @Override
+    public void onPageSelected(int position) {
+        position = getRtlPosition(position);
+        if (mPrevSelected >= 0) {
+            mTabStrip.getChildAt(mPrevSelected).setSelected(false);
+        }
+        final View selectedChild = mTabStrip.getChildAt(position);
+        selectedChild.setSelected(true);
+
+        // Update scroll position
+        final int scrollPos = selectedChild.getLeft() - (getWidth() - selectedChild.getWidth()) / 2;
+        smoothScrollTo(scrollPos, 0);
+        mPrevSelected = position;
+    }
+
+    @Override
+    public void onPageScrollStateChanged(int state) {
+    }
+
+    private int getRtlPosition(int position) {
+        if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
+            return mTabStrip.getChildCount() - 1 - position;
+        }
+        return position;
+    }
+}
+
diff --git a/src/com/cyanogenmod/eleven/widgets/theme/HoloSelector.java b/src/com/cyanogenmod/eleven/widgets/theme/HoloSelector.java
deleted file mode 100644 (file)
index 2ec6348..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.
- */
-
-package com.cyanogenmod.eleven.widgets.theme;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Color;
-import android.graphics.drawable.ColorDrawable;
-import android.graphics.drawable.StateListDrawable;
-
-import com.cyanogenmod.eleven.R;
-
-import java.lang.ref.WeakReference;
-
-/**
- * A themeable {@link StateListDrawable}.
- * 
- * @author Andrew Neal (andrewdneal@gmail.com)
- */
-public class HoloSelector extends StateListDrawable {
-
-    /**
-     * Used to theme the touched and focused colors
-     */
-    private static final String RESOURCE_NAME = "holo_selector";
-
-    /**
-     * Focused state
-     */
-    private static final int FOCUSED = android.R.attr.state_focused;
-
-    /**
-     * Pressed state
-     */
-    private static final int PRESSED = android.R.attr.state_pressed;
-
-    /**
-     * Constructor for <code>HoloSelector</code>
-     * 
-     * @param context The {@link Context} to use.
-     */
-    @SuppressLint("NewApi")
-    public HoloSelector(final Context context) {
-        final int themeColor = context.getResources().getColor(R.color.holo_blue_light);
-        // Focused
-        addState(new int[] {
-            FOCUSED
-        }, makeColorDrawable(themeColor));
-        // Pressed
-        addState(new int[] {
-            PRESSED
-        }, makeColorDrawable(themeColor));
-        // Default
-        addState(new int[] {}, makeColorDrawable(Color.TRANSPARENT));
-        setExitFadeDuration(400);
-    }
-
-    /**
-     * @param color The color to use.
-     * @return A new {@link ColorDrawable}.
-     */
-    private static final ColorDrawable makeColorDrawable(final int color) {
-        return new WeakReference<ColorDrawable>(new ColorDrawable(color)).get();
-    }
-}
diff --git a/src/com/viewpagerindicator/CirclePageIndicator.java b/src/com/viewpagerindicator/CirclePageIndicator.java
deleted file mode 100644 (file)
index 41668f1..0000000
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * Copyright (C) 2011 Patrik Akerfeldt
- * Copyright (C) 2011 Jake Wharton
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.graphics.drawable.Drawable;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.ViewConfigurationCompat;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewConfiguration;
-
-import static android.graphics.Paint.ANTI_ALIAS_FLAG;
-import static android.widget.LinearLayout.HORIZONTAL;
-import static android.widget.LinearLayout.VERTICAL;
-
-import com.cyanogenmod.eleven.R;
-
-/**
- * Draws circles (one for each view). The current view position is filled and
- * others are only stroked.
- */
-public class CirclePageIndicator extends View implements PageIndicator {
-    private static final int INVALID_POINTER = -1;
-
-    private float mRadius;
-    private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG);
-    private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG);
-    private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG);
-    private ViewPager mViewPager;
-    private ViewPager.OnPageChangeListener mListener;
-    private int mCurrentPage;
-    private int mSnapPage;
-    private float mPageOffset;
-    private int mScrollState;
-    private int mOrientation;
-    private boolean mCentered;
-    private boolean mSnap;
-
-    private int mTouchSlop;
-    private float mLastMotionX = -1;
-    private int mActivePointerId = INVALID_POINTER;
-    private boolean mIsDragging;
-
-
-    public CirclePageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public CirclePageIndicator(Context context, AttributeSet attrs) {
-        this(context, attrs, R.attr.vpiCirclePageIndicatorStyle);
-    }
-
-    public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        if (isInEditMode()) return;
-
-        //Load defaults from resources
-        final Resources res = getResources();
-        final int defaultPageColor = res.getColor(R.color.default_circle_indicator_page_color);
-        final int defaultFillColor = res.getColor(R.color.default_circle_indicator_fill_color);
-        final int defaultOrientation = res.getInteger(R.integer.default_circle_indicator_orientation);
-        final int defaultStrokeColor = res.getColor(R.color.default_circle_indicator_stroke_color);
-        final float defaultStrokeWidth = res.getDimension(R.dimen.default_circle_indicator_stroke_width);
-        final float defaultRadius = res.getDimension(R.dimen.default_circle_indicator_radius);
-        final boolean defaultCentered = res.getBoolean(R.bool.default_circle_indicator_centered);
-        final boolean defaultSnap = res.getBoolean(R.bool.default_circle_indicator_snap);
-
-        //Retrieve styles attributes
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CirclePageIndicator, defStyle, 0);
-
-        mCentered = a.getBoolean(R.styleable.CirclePageIndicator_centered, defaultCentered);
-        mOrientation = a.getInt(R.styleable.CirclePageIndicator_android_orientation, defaultOrientation);
-        mPaintPageFill.setStyle(Style.FILL);
-        mPaintPageFill.setColor(a.getColor(R.styleable.CirclePageIndicator_pageColor, defaultPageColor));
-        mPaintStroke.setStyle(Style.STROKE);
-        mPaintStroke.setColor(a.getColor(R.styleable.CirclePageIndicator_strokeColor, defaultStrokeColor));
-        mPaintStroke.setStrokeWidth(a.getDimension(R.styleable.CirclePageIndicator_strokeWidth, defaultStrokeWidth));
-        mPaintFill.setStyle(Style.FILL);
-        mPaintFill.setColor(a.getColor(R.styleable.CirclePageIndicator_fillColor, defaultFillColor));
-        mRadius = a.getDimension(R.styleable.CirclePageIndicator_radius, defaultRadius);
-        mSnap = a.getBoolean(R.styleable.CirclePageIndicator_snap, defaultSnap);
-
-        Drawable background = a.getDrawable(R.styleable.CirclePageIndicator_android_background);
-        if (background != null) {
-          setBackgroundDrawable(background);
-        }
-
-        a.recycle();
-
-        final ViewConfiguration configuration = ViewConfiguration.get(context);
-        mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
-    }
-
-
-    public void setCentered(boolean centered) {
-        mCentered = centered;
-        invalidate();
-    }
-
-    public boolean isCentered() {
-        return mCentered;
-    }
-
-    public void setPageColor(int pageColor) {
-        mPaintPageFill.setColor(pageColor);
-        invalidate();
-    }
-
-    public int getPageColor() {
-        return mPaintPageFill.getColor();
-    }
-
-    public void setFillColor(int fillColor) {
-        mPaintFill.setColor(fillColor);
-        invalidate();
-    }
-
-    public int getFillColor() {
-        return mPaintFill.getColor();
-    }
-
-    public void setOrientation(int orientation) {
-        switch (orientation) {
-            case HORIZONTAL:
-            case VERTICAL:
-                mOrientation = orientation;
-                requestLayout();
-                break;
-
-            default:
-                throw new IllegalArgumentException("Orientation must be either HORIZONTAL or VERTICAL.");
-        }
-    }
-
-    public int getOrientation() {
-        return mOrientation;
-    }
-
-    public void setStrokeColor(int strokeColor) {
-        mPaintStroke.setColor(strokeColor);
-        invalidate();
-    }
-
-    public int getStrokeColor() {
-        return mPaintStroke.getColor();
-    }
-
-    public void setStrokeWidth(float strokeWidth) {
-        mPaintStroke.setStrokeWidth(strokeWidth);
-        invalidate();
-    }
-
-    public float getStrokeWidth() {
-        return mPaintStroke.getStrokeWidth();
-    }
-
-    public void setRadius(float radius) {
-        mRadius = radius;
-        invalidate();
-    }
-
-    public float getRadius() {
-        return mRadius;
-    }
-
-    public void setSnap(boolean snap) {
-        mSnap = snap;
-        invalidate();
-    }
-
-    public boolean isSnap() {
-        return mSnap;
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-
-        if (mViewPager == null) {
-            return;
-        }
-        final int count = mViewPager.getAdapter().getCount();
-        if (count == 0) {
-            return;
-        }
-
-        if (mCurrentPage >= count) {
-            setCurrentItem(count - 1);
-            return;
-        }
-
-        int longSize;
-        int longPaddingBefore;
-        int longPaddingAfter;
-        int shortPaddingBefore;
-        if (mOrientation == HORIZONTAL) {
-            longSize = getWidth();
-            longPaddingBefore = getPaddingLeft();
-            longPaddingAfter = getPaddingRight();
-            shortPaddingBefore = getPaddingTop();
-        } else {
-            longSize = getHeight();
-            longPaddingBefore = getPaddingTop();
-            longPaddingAfter = getPaddingBottom();
-            shortPaddingBefore = getPaddingLeft();
-        }
-
-        final float threeRadius = mRadius * 3;
-        final float shortOffset = shortPaddingBefore + mRadius;
-        float longOffset = longPaddingBefore + mRadius;
-        if (mCentered) {
-            longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - ((count * threeRadius) / 2.0f);
-        }
-
-        float dX;
-        float dY;
-
-        float pageFillRadius = mRadius;
-        if (mPaintStroke.getStrokeWidth() > 0) {
-            pageFillRadius -= mPaintStroke.getStrokeWidth() / 2.0f;
-        }
-
-        //Draw stroked circles
-        for (int iLoop = 0; iLoop < count; iLoop++) {
-            float drawLong = longOffset + (iLoop * threeRadius);
-            if (mOrientation == HORIZONTAL) {
-                dX = drawLong;
-                dY = shortOffset;
-            } else {
-                dX = shortOffset;
-                dY = drawLong;
-            }
-            // Only paint fill if not completely transparent
-            if (mPaintPageFill.getAlpha() > 0) {
-                canvas.drawCircle(dX, dY, pageFillRadius, mPaintPageFill);
-            }
-
-            // Only paint stroke if a stroke width was non-zero
-            if (pageFillRadius != mRadius) {
-                canvas.drawCircle(dX, dY, mRadius, mPaintStroke);
-            }
-        }
-
-        //Draw the filled circle according to the current scroll
-        float cx = (mSnap ? mSnapPage : mCurrentPage) * threeRadius;
-        if (!mSnap) {
-            cx += mPageOffset * threeRadius;
-        }
-        if (mOrientation == HORIZONTAL) {
-            dX = longOffset + cx;
-            dY = shortOffset;
-        } else {
-            dX = shortOffset;
-            dY = longOffset + cx;
-        }
-        canvas.drawCircle(dX, dY, mRadius, mPaintFill);
-    }
-
-    public boolean onTouchEvent(android.view.MotionEvent ev) {
-        if (super.onTouchEvent(ev)) {
-            return true;
-        }
-        if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) {
-            return false;
-        }
-
-        final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;
-        switch (action) {
-            case MotionEvent.ACTION_DOWN:
-                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
-                mLastMotionX = ev.getX();
-                break;
-
-            case MotionEvent.ACTION_MOVE: {
-                final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
-                final float x = MotionEventCompat.getX(ev, activePointerIndex);
-                final float deltaX = x - mLastMotionX;
-
-                if (!mIsDragging) {
-                    if (Math.abs(deltaX) > mTouchSlop) {
-                        mIsDragging = true;
-                    }
-                }
-
-                if (mIsDragging) {
-                    mLastMotionX = x;
-                    if (mViewPager.isFakeDragging() || mViewPager.beginFakeDrag()) {
-                        mViewPager.fakeDragBy(deltaX);
-                    }
-                }
-
-                break;
-            }
-
-            case MotionEvent.ACTION_CANCEL:
-            case MotionEvent.ACTION_UP:
-                if (!mIsDragging) {
-                    final int count = mViewPager.getAdapter().getCount();
-                    final int width = getWidth();
-                    final float halfWidth = width / 2f;
-                    final float sixthWidth = width / 6f;
-
-                    if ((mCurrentPage > 0) && (ev.getX() < halfWidth - sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage - 1);
-                        }
-                        return true;
-                    } else if ((mCurrentPage < count - 1) && (ev.getX() > halfWidth + sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage + 1);
-                        }
-                        return true;
-                    }
-                }
-
-                mIsDragging = false;
-                mActivePointerId = INVALID_POINTER;
-                if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
-                break;
-
-            case MotionEventCompat.ACTION_POINTER_DOWN: {
-                final int index = MotionEventCompat.getActionIndex(ev);
-                mLastMotionX = MotionEventCompat.getX(ev, index);
-                mActivePointerId = MotionEventCompat.getPointerId(ev, index);
-                break;
-            }
-
-            case MotionEventCompat.ACTION_POINTER_UP:
-                final int pointerIndex = MotionEventCompat.getActionIndex(ev);
-                final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
-                if (pointerId == mActivePointerId) {
-                    final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
-                    mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
-                }
-                mLastMotionX = MotionEventCompat.getX(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId));
-                break;
-        }
-
-        return true;
-    }
-
-    @Override
-    public void setViewPager(ViewPager view) {
-        if (mViewPager == view) {
-            return;
-        }
-        if (mViewPager != null) {
-            mViewPager.setOnPageChangeListener(null);
-        }
-        if (view.getAdapter() == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = view;
-        mViewPager.setOnPageChangeListener(this);
-        invalidate();
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mViewPager.setCurrentItem(item);
-        mCurrentPage = item;
-        invalidate();
-    }
-
-    @Override
-    public void notifyDataSetChanged() {
-        invalidate();
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int state) {
-        mScrollState = state;
-
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(state);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-        mCurrentPage = position;
-        mPageOffset = positionOffset;
-        invalidate();
-
-        if (mListener != null) {
-            mListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int position) {
-        if (mSnap || mScrollState == ViewPager.SCROLL_STATE_IDLE) {
-            mCurrentPage = position;
-            mSnapPage = position;
-            invalidate();
-        }
-
-        if (mListener != null) {
-            mListener.onPageSelected(position);
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
-        mListener = listener;
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see android.view.View#onMeasure(int, int)
-     */
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        if (mOrientation == HORIZONTAL) {
-            setMeasuredDimension(measureLong(widthMeasureSpec), measureShort(heightMeasureSpec));
-        } else {
-            setMeasuredDimension(measureShort(widthMeasureSpec), measureLong(heightMeasureSpec));
-        }
-    }
-
-    /**
-     * Determines the width of this view
-     *
-     * @param measureSpec
-     *            A measureSpec packed into an int
-     * @return The width of the view, honoring constraints from measureSpec
-     */
-    private int measureLong(int measureSpec) {
-        int result;
-        int specMode = MeasureSpec.getMode(measureSpec);
-        int specSize = MeasureSpec.getSize(measureSpec);
-
-        if ((specMode == MeasureSpec.EXACTLY) || (mViewPager == null)) {
-            //We were told how big to be
-            result = specSize;
-        } else {
-            //Calculate the width according the views count
-            final int count = mViewPager.getAdapter().getCount();
-            result = (int)(getPaddingLeft() + getPaddingRight()
-                    + (count * 2 * mRadius) + (count - 1) * mRadius + 1);
-            //Respect AT_MOST value if that was what is called for by measureSpec
-            if (specMode == MeasureSpec.AT_MOST) {
-                result = Math.min(result, specSize);
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Determines the height of this view
-     *
-     * @param measureSpec
-     *            A measureSpec packed into an int
-     * @return The height of the view, honoring constraints from measureSpec
-     */
-    private int measureShort(int measureSpec) {
-        int result;
-        int specMode = MeasureSpec.getMode(measureSpec);
-        int specSize = MeasureSpec.getSize(measureSpec);
-
-        if (specMode == MeasureSpec.EXACTLY) {
-            //We were told how big to be
-            result = specSize;
-        } else {
-            //Measure the height
-            result = (int)(2 * mRadius + getPaddingTop() + getPaddingBottom() + 1);
-            //Respect AT_MOST value if that was what is called for by measureSpec
-            if (specMode == MeasureSpec.AT_MOST) {
-                result = Math.min(result, specSize);
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public void onRestoreInstanceState(Parcelable state) {
-        SavedState savedState = (SavedState)state;
-        super.onRestoreInstanceState(savedState.getSuperState());
-        mCurrentPage = savedState.currentPage;
-        mSnapPage = savedState.currentPage;
-        requestLayout();
-    }
-
-    @Override
-    public Parcelable onSaveInstanceState() {
-        Parcelable superState = super.onSaveInstanceState();
-        SavedState savedState = new SavedState(superState);
-        savedState.currentPage = mCurrentPage;
-        return savedState;
-    }
-
-    static class SavedState extends BaseSavedState {
-        int currentPage;
-
-        public SavedState(Parcelable superState) {
-            super(superState);
-        }
-
-        private SavedState(Parcel in) {
-            super(in);
-            currentPage = in.readInt();
-        }
-
-        @Override
-        public void writeToParcel(Parcel dest, int flags) {
-            super.writeToParcel(dest, flags);
-            dest.writeInt(currentPage);
-        }
-
-        @SuppressWarnings("UnusedDeclaration")
-        public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
-            @Override
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
-
-            @Override
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
-    }
-}
diff --git a/src/com/viewpagerindicator/IconPageIndicator.java b/src/com/viewpagerindicator/IconPageIndicator.java
deleted file mode 100644 (file)
index deab171..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- * Copyright (C) 2012 Jake Wharton
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewPager;
-import android.support.v4.view.ViewPager.OnPageChangeListener;
-import android.util.AttributeSet;
-import android.view.Gravity;
-import android.view.View;
-import android.widget.HorizontalScrollView;
-import android.widget.ImageView;
-
-import static android.view.ViewGroup.LayoutParams.FILL_PARENT;
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
-
-import com.cyanogenmod.eleven.R;
-
-/**
- * This widget implements the dynamic action bar tab behavior that can change
- * across different configurations or circumstances.
- */
-public class IconPageIndicator extends HorizontalScrollView implements PageIndicator {
-    private final IcsLinearLayout mIconsLayout;
-
-    private ViewPager mViewPager;
-    private OnPageChangeListener mListener;
-    private Runnable mIconSelector;
-    private int mSelectedIndex;
-
-    public IconPageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public IconPageIndicator(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        setHorizontalScrollBarEnabled(false);
-
-        mIconsLayout = new IcsLinearLayout(context, R.attr.vpiIconPageIndicatorStyle);
-        addView(mIconsLayout, new LayoutParams(WRAP_CONTENT, FILL_PARENT, Gravity.CENTER));
-    }
-
-    private void animateToIcon(final int position) {
-        final View iconView = mIconsLayout.getChildAt(position);
-        if (mIconSelector != null) {
-            removeCallbacks(mIconSelector);
-        }
-        mIconSelector = new Runnable() {
-            public void run() {
-                final int scrollPos = iconView.getLeft() - (getWidth() - iconView.getWidth()) / 2;
-                smoothScrollTo(scrollPos, 0);
-                mIconSelector = null;
-            }
-        };
-        post(mIconSelector);
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        if (mIconSelector != null) {
-            // Re-post the selector we saved
-            post(mIconSelector);
-        }
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-        if (mIconSelector != null) {
-            removeCallbacks(mIconSelector);
-        }
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int arg0) {
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(arg0);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int arg0, float arg1, int arg2) {
-        if (mListener != null) {
-            mListener.onPageScrolled(arg0, arg1, arg2);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int arg0) {
-        setCurrentItem(arg0);
-        if (mListener != null) {
-            mListener.onPageSelected(arg0);
-        }
-    }
-
-    @Override
-    public void setViewPager(ViewPager view) {
-        if (mViewPager == view) {
-            return;
-        }
-        if (mViewPager != null) {
-            mViewPager.setOnPageChangeListener(null);
-        }
-        PagerAdapter adapter = view.getAdapter();
-        if (adapter == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = view;
-        view.setOnPageChangeListener(this);
-        notifyDataSetChanged();
-    }
-
-    public void notifyDataSetChanged() {
-        mIconsLayout.removeAllViews();
-        IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
-        int count = iconAdapter.getCount();
-        for (int i = 0; i < count; i++) {
-            ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
-            view.setImageResource(iconAdapter.getIconResId(i));
-            mIconsLayout.addView(view);
-        }
-        if (mSelectedIndex > count) {
-            mSelectedIndex = count - 1;
-        }
-        setCurrentItem(mSelectedIndex);
-        requestLayout();
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mSelectedIndex = item;
-        mViewPager.setCurrentItem(item);
-
-        int tabCount = mIconsLayout.getChildCount();
-        for (int i = 0; i < tabCount; i++) {
-            View child = mIconsLayout.getChildAt(i);
-            boolean isSelected = (i == item);
-            child.setSelected(isSelected);
-            if (isSelected) {
-                animateToIcon(item);
-            }
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(OnPageChangeListener listener) {
-        mListener = listener;
-    }
-}
diff --git a/src/com/viewpagerindicator/IconPagerAdapter.java b/src/com/viewpagerindicator/IconPagerAdapter.java
deleted file mode 100644 (file)
index b133d48..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.viewpagerindicator;
-
-public interface IconPagerAdapter {
-    /**
-     * Get icon representing the page at {@code index} in the adapter.
-     */
-    int getIconResId(int index);
-
-    // From PagerAdapter
-    int getCount();
-}
diff --git a/src/com/viewpagerindicator/IcsLinearLayout.java b/src/com/viewpagerindicator/IcsLinearLayout.java
deleted file mode 100644 (file)
index 27ad7e5..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.drawable.Drawable;
-import android.view.View;
-import android.widget.LinearLayout;
-
-/**
- * A simple extension of a regular linear layout that supports the divider API
- * of Android 4.0+. The dividers are added adjacent to the children by changing
- * their layout params. If you need to rely on the margins which fall in the
- * same orientation as the layout you should wrap the child in a simple
- * {@link android.widget.FrameLayout} so it can receive the margin.
- */
-class IcsLinearLayout extends LinearLayout {
-    private static final int[] LL = new int[] {
-        /* 0 */ android.R.attr.divider,
-        /* 1 */ android.R.attr.showDividers,
-        /* 2 */ android.R.attr.dividerPadding,
-    };
-    private static final int LL_DIVIDER = 0;
-    private static final int LL_SHOW_DIVIDER = 1;
-    private static final int LL_DIVIDER_PADDING = 2;
-
-    private Drawable mDivider;
-    private int mDividerWidth;
-    private int mDividerHeight;
-    private int mShowDividers;
-    private int mDividerPadding;
-
-
-    public IcsLinearLayout(Context context, int themeAttr) {
-        super(context);
-
-        TypedArray a = context.obtainStyledAttributes(null, LL, themeAttr, 0);
-        setDividerDrawable(a.getDrawable(IcsLinearLayout.LL_DIVIDER));
-        mDividerPadding = a.getDimensionPixelSize(LL_DIVIDER_PADDING, 0);
-        mShowDividers = a.getInteger(LL_SHOW_DIVIDER, SHOW_DIVIDER_NONE);
-        a.recycle();
-    }
-
-    public void setDividerDrawable(Drawable divider) {
-        if (divider == mDivider) {
-            return;
-        }
-        mDivider = divider;
-        if (divider != null) {
-            mDividerWidth = divider.getIntrinsicWidth();
-            mDividerHeight = divider.getIntrinsicHeight();
-        } else {
-            mDividerWidth = 0;
-            mDividerHeight = 0;
-        }
-        setWillNotDraw(divider == null);
-        requestLayout();
-    }
-
-    @Override
-    protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) {
-        final int index = indexOfChild(child);
-        final int orientation = getOrientation();
-        final LayoutParams params = (LayoutParams) child.getLayoutParams();
-        if (hasDividerBeforeChildAt(index)) {
-            if (orientation == VERTICAL) {
-                //Account for the divider by pushing everything up
-                params.topMargin = mDividerHeight;
-            } else {
-                //Account for the divider by pushing everything left
-                params.leftMargin = mDividerWidth;
-            }
-        }
-
-        final int count = getChildCount();
-        if (index == count - 1) {
-            if (hasDividerBeforeChildAt(count)) {
-                if (orientation == VERTICAL) {
-                    params.bottomMargin = mDividerHeight;
-                } else {
-                    params.rightMargin = mDividerWidth;
-                }
-            }
-        }
-        super.measureChildWithMargins(child, parentWidthMeasureSpec, widthUsed, parentHeightMeasureSpec, heightUsed);
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        if (mDivider != null) {
-            if (getOrientation() == VERTICAL) {
-                drawDividersVertical(canvas);
-            } else {
-                drawDividersHorizontal(canvas);
-            }
-        }
-        super.onDraw(canvas);
-    }
-
-    private void drawDividersVertical(Canvas canvas) {
-        final int count = getChildCount();
-        for (int i = 0; i < count; i++) {
-            final View child = getChildAt(i);
-
-            if (child != null && child.getVisibility() != GONE) {
-                if (hasDividerBeforeChildAt(i)) {
-                    final android.widget.LinearLayout.LayoutParams lp = (android.widget.LinearLayout.LayoutParams) child.getLayoutParams();
-                    final int top = child.getTop() - lp.topMargin/* - mDividerHeight*/;
-                    drawHorizontalDivider(canvas, top);
-                }
-            }
-        }
-
-        if (hasDividerBeforeChildAt(count)) {
-            final View child = getChildAt(count - 1);
-            int bottom = 0;
-            if (child == null) {
-                bottom = getHeight() - getPaddingBottom() - mDividerHeight;
-            } else {
-                //final LayoutParams lp = (LayoutParams) child.getLayoutParams();
-                bottom = child.getBottom()/* + lp.bottomMargin*/;
-            }
-            drawHorizontalDivider(canvas, bottom);
-        }
-    }
-
-    private void drawDividersHorizontal(Canvas canvas) {
-        final int count = getChildCount();
-        for (int i = 0; i < count; i++) {
-            final View child = getChildAt(i);
-
-            if (child != null && child.getVisibility() != GONE) {
-                if (hasDividerBeforeChildAt(i)) {
-                    final android.widget.LinearLayout.LayoutParams lp = (android.widget.LinearLayout.LayoutParams) child.getLayoutParams();
-                    final int left = child.getLeft() - lp.leftMargin/* - mDividerWidth*/;
-                    drawVerticalDivider(canvas, left);
-                }
-            }
-        }
-
-        if (hasDividerBeforeChildAt(count)) {
-            final View child = getChildAt(count - 1);
-            int right = 0;
-            if (child == null) {
-                right = getWidth() - getPaddingRight() - mDividerWidth;
-            } else {
-                //final LayoutParams lp = (LayoutParams) child.getLayoutParams();
-                right = child.getRight()/* + lp.rightMargin*/;
-            }
-            drawVerticalDivider(canvas, right);
-        }
-    }
-
-    private void drawHorizontalDivider(Canvas canvas, int top) {
-        mDivider.setBounds(getPaddingLeft() + mDividerPadding, top,
-                getWidth() - getPaddingRight() - mDividerPadding, top + mDividerHeight);
-        mDivider.draw(canvas);
-    }
-
-    private void drawVerticalDivider(Canvas canvas, int left) {
-        mDivider.setBounds(left, getPaddingTop() + mDividerPadding,
-                left + mDividerWidth, getHeight() - getPaddingBottom() - mDividerPadding);
-        mDivider.draw(canvas);
-    }
-
-    protected boolean hasDividerBeforeChildAt(int childIndex) {
-        if (childIndex == 0 || childIndex == getChildCount()) {
-          return false;
-        }
-        if ((mShowDividers & SHOW_DIVIDER_MIDDLE) != 0) {
-            boolean hasVisibleViewBefore = false;
-            for (int i = childIndex - 1; i >= 0; i--) {
-                if (getChildAt(i).getVisibility() != GONE) {
-                    hasVisibleViewBefore = true;
-                    break;
-                }
-            }
-            return hasVisibleViewBefore;
-        }
-        return false;
-    }
-}
diff --git a/src/com/viewpagerindicator/LinePageIndicator.java b/src/com/viewpagerindicator/LinePageIndicator.java
deleted file mode 100644 (file)
index 17e8158..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright (C) 2012 Jake Wharton
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.drawable.Drawable;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.ViewConfigurationCompat;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.util.FloatMath;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewConfiguration;
-
-import com.cyanogenmod.eleven.R;
-
-/**
- * Draws a line for each page. The current page line is colored differently
- * than the unselected page lines.
- */
-public class LinePageIndicator extends View implements PageIndicator {
-    private static final int INVALID_POINTER = -1;
-
-    private final Paint mPaintUnselected = new Paint(Paint.ANTI_ALIAS_FLAG);
-    private final Paint mPaintSelected = new Paint(Paint.ANTI_ALIAS_FLAG);
-    private ViewPager mViewPager;
-    private ViewPager.OnPageChangeListener mListener;
-    private int mCurrentPage;
-    private boolean mCentered;
-    private float mLineWidth;
-    private float mGapWidth;
-
-    private int mTouchSlop;
-    private float mLastMotionX = -1;
-    private int mActivePointerId = INVALID_POINTER;
-    private boolean mIsDragging;
-
-
-    public LinePageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public LinePageIndicator(Context context, AttributeSet attrs) {
-        this(context, attrs, R.attr.vpiLinePageIndicatorStyle);
-    }
-
-    public LinePageIndicator(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        if (isInEditMode()) return;
-
-        final Resources res = getResources();
-
-        //Load defaults from resources
-        final int defaultSelectedColor = res.getColor(R.color.default_line_indicator_selected_color);
-        final int defaultUnselectedColor = res.getColor(R.color.default_line_indicator_unselected_color);
-        final float defaultLineWidth = res.getDimension(R.dimen.default_line_indicator_line_width);
-        final float defaultGapWidth = res.getDimension(R.dimen.default_line_indicator_gap_width);
-        final float defaultStrokeWidth = res.getDimension(R.dimen.default_line_indicator_stroke_width);
-        final boolean defaultCentered = res.getBoolean(R.bool.default_line_indicator_centered);
-
-        //Retrieve styles attributes
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LinePageIndicator, defStyle, 0);
-
-        mCentered = a.getBoolean(R.styleable.LinePageIndicator_centered, defaultCentered);
-        mLineWidth = a.getDimension(R.styleable.LinePageIndicator_lineWidth, defaultLineWidth);
-        mGapWidth = a.getDimension(R.styleable.LinePageIndicator_gapWidth, defaultGapWidth);
-        setStrokeWidth(a.getDimension(R.styleable.LinePageIndicator_strokeWidth, defaultStrokeWidth));
-        mPaintUnselected.setColor(a.getColor(R.styleable.LinePageIndicator_unselectedColor, defaultUnselectedColor));
-        mPaintSelected.setColor(a.getColor(R.styleable.LinePageIndicator_selectedColor, defaultSelectedColor));
-
-        Drawable background = a.getDrawable(R.styleable.LinePageIndicator_android_background);
-        if (background != null) {
-          setBackgroundDrawable(background);
-        }
-
-        a.recycle();
-
-        final ViewConfiguration configuration = ViewConfiguration.get(context);
-        mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
-    }
-
-
-    public void setCentered(boolean centered) {
-        mCentered = centered;
-        invalidate();
-    }
-
-    public boolean isCentered() {
-        return mCentered;
-    }
-
-    public void setUnselectedColor(int unselectedColor) {
-        mPaintUnselected.setColor(unselectedColor);
-        invalidate();
-    }
-
-    public int getUnselectedColor() {
-        return mPaintUnselected.getColor();
-    }
-
-    public void setSelectedColor(int selectedColor) {
-        mPaintSelected.setColor(selectedColor);
-        invalidate();
-    }
-
-    public int getSelectedColor() {
-        return mPaintSelected.getColor();
-    }
-
-    public void setLineWidth(float lineWidth) {
-        mLineWidth = lineWidth;
-        invalidate();
-    }
-
-    public float getLineWidth() {
-        return mLineWidth;
-    }
-
-    public void setStrokeWidth(float lineHeight) {
-        mPaintSelected.setStrokeWidth(lineHeight);
-        mPaintUnselected.setStrokeWidth(lineHeight);
-        invalidate();
-    }
-
-    public float getStrokeWidth() {
-        return mPaintSelected.getStrokeWidth();
-    }
-
-    public void setGapWidth(float gapWidth) {
-        mGapWidth = gapWidth;
-        invalidate();
-    }
-
-    public float getGapWidth() {
-        return mGapWidth;
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-
-        if (mViewPager == null) {
-            return;
-        }
-        final int count = mViewPager.getAdapter().getCount();
-        if (count == 0) {
-            return;
-        }
-
-        if (mCurrentPage >= count) {
-            setCurrentItem(count - 1);
-            return;
-        }
-
-        final float lineWidthAndGap = mLineWidth + mGapWidth;
-        final float indicatorWidth = (count * lineWidthAndGap) - mGapWidth;
-        final float paddingTop = getPaddingTop();
-        final float paddingLeft = getPaddingLeft();
-        final float paddingRight = getPaddingRight();
-
-        float verticalOffset = paddingTop + ((getHeight() - paddingTop - getPaddingBottom()) / 2.0f);
-        float horizontalOffset = paddingLeft;
-        if (mCentered) {
-            horizontalOffset += ((getWidth() - paddingLeft - paddingRight) / 2.0f) - (indicatorWidth / 2.0f);
-        }
-
-        //Draw stroked circles
-        for (int i = 0; i < count; i++) {
-            float dx1 = horizontalOffset + (i * lineWidthAndGap);
-            float dx2 = dx1 + mLineWidth;
-            canvas.drawLine(dx1, verticalOffset, dx2, verticalOffset, (i == mCurrentPage) ? mPaintSelected : mPaintUnselected);
-        }
-    }
-
-    public boolean onTouchEvent(android.view.MotionEvent ev) {
-        if (super.onTouchEvent(ev)) {
-            return true;
-        }
-        if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) {
-            return false;
-        }
-
-        final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;
-        switch (action) {
-            case MotionEvent.ACTION_DOWN:
-                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
-                mLastMotionX = ev.getX();
-                break;
-
-            case MotionEvent.ACTION_MOVE: {
-                final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
-                final float x = MotionEventCompat.getX(ev, activePointerIndex);
-                final float deltaX = x - mLastMotionX;
-
-                if (!mIsDragging) {
-                    if (Math.abs(deltaX) > mTouchSlop) {
-                        mIsDragging = true;
-                    }
-                }
-
-                if (mIsDragging) {
-                    mLastMotionX = x;
-                    if (mViewPager.isFakeDragging() || mViewPager.beginFakeDrag()) {
-                        mViewPager.fakeDragBy(deltaX);
-                    }
-                }
-
-                break;
-            }
-
-            case MotionEvent.ACTION_CANCEL:
-            case MotionEvent.ACTION_UP:
-                if (!mIsDragging) {
-                    final int count = mViewPager.getAdapter().getCount();
-                    final int width = getWidth();
-                    final float halfWidth = width / 2f;
-                    final float sixthWidth = width / 6f;
-
-                    if ((mCurrentPage > 0) && (ev.getX() < halfWidth - sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage - 1);
-                        }
-                        return true;
-                    } else if ((mCurrentPage < count - 1) && (ev.getX() > halfWidth + sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage + 1);
-                        }
-                        return true;
-                    }
-                }
-
-                mIsDragging = false;
-                mActivePointerId = INVALID_POINTER;
-                if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
-                break;
-
-            case MotionEventCompat.ACTION_POINTER_DOWN: {
-                final int index = MotionEventCompat.getActionIndex(ev);
-                mLastMotionX = MotionEventCompat.getX(ev, index);
-                mActivePointerId = MotionEventCompat.getPointerId(ev, index);
-                break;
-            }
-
-            case MotionEventCompat.ACTION_POINTER_UP:
-                final int pointerIndex = MotionEventCompat.getActionIndex(ev);
-                final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
-                if (pointerId == mActivePointerId) {
-                    final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
-                    mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
-                }
-                mLastMotionX = MotionEventCompat.getX(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId));
-                break;
-        }
-
-        return true;
-    }
-
-    @Override
-    public void setViewPager(ViewPager viewPager) {
-        if (mViewPager == viewPager) {
-            return;
-        }
-        if (mViewPager != null) {
-            //Clear us from the old pager.
-            mViewPager.setOnPageChangeListener(null);
-        }
-        if (viewPager.getAdapter() == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = viewPager;
-        mViewPager.setOnPageChangeListener(this);
-        invalidate();
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mViewPager.setCurrentItem(item);
-        mCurrentPage = item;
-        invalidate();
-    }
-
-    @Override
-    public void notifyDataSetChanged() {
-        invalidate();
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int state) {
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(state);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-        if (mListener != null) {
-            mListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int position) {
-        mCurrentPage = position;
-        invalidate();
-
-        if (mListener != null) {
-            mListener.onPageSelected(position);
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
-        mListener = listener;
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec));
-    }
-
-    /**
-     * Determines the width of this view
-     *
-     * @param measureSpec
-     *            A measureSpec packed into an int
-     * @return The width of the view, honoring constraints from measureSpec
-     */
-    private int measureWidth(int measureSpec) {
-        float result;
-        int specMode = MeasureSpec.getMode(measureSpec);
-        int specSize = MeasureSpec.getSize(measureSpec);
-
-        if ((specMode == MeasureSpec.EXACTLY) || (mViewPager == null)) {
-            //We were told how big to be
-            result = specSize;
-        } else {
-            //Calculate the width according the views count
-            final int count = mViewPager.getAdapter().getCount();
-            result = getPaddingLeft() + getPaddingRight() + (count * mLineWidth) + ((count - 1) * mGapWidth);
-            //Respect AT_MOST value if that was what is called for by measureSpec
-            if (specMode == MeasureSpec.AT_MOST) {
-                result = Math.min(result, specSize);
-            }
-        }
-        return (int)FloatMath.ceil(result);
-    }
-
-    /**
-     * Determines the height of this view
-     *
-     * @param measureSpec
-     *            A measureSpec packed into an int
-     * @return The height of the view, honoring constraints from measureSpec
-     */
-    private int measureHeight(int measureSpec) {
-        float result;
-        int specMode = MeasureSpec.getMode(measureSpec);
-        int specSize = MeasureSpec.getSize(measureSpec);
-
-        if (specMode == MeasureSpec.EXACTLY) {
-            //We were told how big to be
-            result = specSize;
-        } else {
-            //Measure the height
-            result = mPaintSelected.getStrokeWidth() + getPaddingTop() + getPaddingBottom();
-            //Respect AT_MOST value if that was what is called for by measureSpec
-            if (specMode == MeasureSpec.AT_MOST) {
-                result = Math.min(result, specSize);
-            }
-        }
-        return (int)FloatMath.ceil(result);
-    }
-
-    @Override
-    public void onRestoreInstanceState(Parcelable state) {
-        SavedState savedState = (SavedState)state;
-        super.onRestoreInstanceState(savedState.getSuperState());
-        mCurrentPage = savedState.currentPage;
-        requestLayout();
-    }
-
-    @Override
-    public Parcelable onSaveInstanceState() {
-        Parcelable superState = super.onSaveInstanceState();
-        SavedState savedState = new SavedState(superState);
-        savedState.currentPage = mCurrentPage;
-        return savedState;
-    }
-
-    static class SavedState extends BaseSavedState {
-        int currentPage;
-
-        public SavedState(Parcelable superState) {
-            super(superState);
-        }
-
-        private SavedState(Parcel in) {
-            super(in);
-            currentPage = in.readInt();
-        }
-
-        @Override
-        public void writeToParcel(Parcel dest, int flags) {
-            super.writeToParcel(dest, flags);
-            dest.writeInt(currentPage);
-        }
-
-        @SuppressWarnings("UnusedDeclaration")
-        public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
-            @Override
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
-
-            @Override
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
-    }
-}
diff --git a/src/com/viewpagerindicator/PageIndicator.java b/src/com/viewpagerindicator/PageIndicator.java
deleted file mode 100644 (file)
index c08c00a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2011 Patrik Akerfeldt
- * Copyright (C) 2011 Jake Wharton
- *
- * 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.
- */
-
-package com.viewpagerindicator;
-
-import android.support.v4.view.ViewPager;
-
-/**
- * A PageIndicator is responsible to show an visual indicator on the total views
- * number and the current visible view.
- */
-public interface PageIndicator extends ViewPager.OnPageChangeListener {
-    /**
-     * Bind the indicator to a ViewPager.
-     *
-     * @param view
-     */
-    void setViewPager(ViewPager view);
-
-    /**
-     * Bind the indicator to a ViewPager.
-     *
-     * @param view
-     * @param initialPosition
-     */
-    void setViewPager(ViewPager view, int initialPosition);
-
-    /**
-     * <p>Set the current page of both the ViewPager and indicator.</p>
-     *
-     * <p>This <strong>must</strong> be used if you need to set the page before
-     * the views are drawn on screen (e.g., default start page).</p>
-     *
-     * @param item
-     */
-    void setCurrentItem(int item);
-
-    /**
-     * Set a page change listener which will receive forwarded events.
-     *
-     * @param listener
-     */
-    void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
-
-    /**
-     * Notify the indicator that the fragment list has changed.
-     */
-    void notifyDataSetChanged();
-}
diff --git a/src/com/viewpagerindicator/TabPageIndicator.java b/src/com/viewpagerindicator/TabPageIndicator.java
deleted file mode 100644 (file)
index 07c995d..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- * Copyright (C) 2011 Jake Wharton
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewPager;
-import android.support.v4.view.ViewPager.OnPageChangeListener;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.HorizontalScrollView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
-
-import com.cyanogenmod.eleven.R;
-
-/**
- * This widget implements the dynamic action bar tab behavior that can change
- * across different configurations or circumstances.
- */
-public class TabPageIndicator extends HorizontalScrollView implements PageIndicator {
-    /** Title text used when no title is provided by the adapter. */
-    private static final CharSequence EMPTY_TITLE = "";
-
-    /**
-     * Interface for a callback when the selected tab has been reselected.
-     */
-    public interface OnTabReselectedListener {
-        /**
-         * Callback when the selected tab has been reselected.
-         *
-         * @param position Position of the current center item.
-         */
-        void onTabReselected(int position);
-    }
-
-    private Runnable mTabSelector;
-
-    private final OnClickListener mTabClickListener = new OnClickListener() {
-        public void onClick(View view) {
-            TabView tabView = (TabView)view;
-            final int oldSelected = mViewPager.getCurrentItem();
-            final int newSelected = tabView.getIndex();
-            mViewPager.setCurrentItem(newSelected);
-            if (oldSelected == newSelected && mTabReselectedListener != null) {
-                mTabReselectedListener.onTabReselected(newSelected);
-            }
-        }
-    };
-
-    private final IcsLinearLayout mTabLayout;
-
-    private ViewPager mViewPager;
-    private ViewPager.OnPageChangeListener mListener;
-
-    private int mMaxTabWidth;
-    private int mSelectedTabIndex;
-
-    private OnTabReselectedListener mTabReselectedListener;
-
-    public TabPageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public TabPageIndicator(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        setHorizontalScrollBarEnabled(false);
-
-        mTabLayout = new IcsLinearLayout(context, R.attr.vpiTabPageIndicatorStyle);
-        addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, MATCH_PARENT));
-    }
-
-    public void setOnTabReselectedListener(OnTabReselectedListener listener) {
-        mTabReselectedListener = listener;
-    }
-
-    @Override
-    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
-        final boolean lockedExpanded = widthMode == MeasureSpec.EXACTLY;
-        setFillViewport(lockedExpanded);
-
-        final int childCount = mTabLayout.getChildCount();
-        if (childCount > 1 && (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST)) {
-            if (childCount > 2) {
-                mMaxTabWidth = (int)(MeasureSpec.getSize(widthMeasureSpec) * 0.4f);
-            } else {
-                mMaxTabWidth = MeasureSpec.getSize(widthMeasureSpec) / 2;
-            }
-        } else {
-            mMaxTabWidth = -1;
-        }
-
-        final int oldWidth = getMeasuredWidth();
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-        final int newWidth = getMeasuredWidth();
-
-        if (lockedExpanded && oldWidth != newWidth) {
-            // Recenter the tab display if we're at a new (scrollable) size.
-            setCurrentItem(mSelectedTabIndex);
-        }
-    }
-
-    private void animateToTab(final int position) {
-        final View tabView = mTabLayout.getChildAt(position);
-        if (mTabSelector != null) {
-            removeCallbacks(mTabSelector);
-        }
-        mTabSelector = new Runnable() {
-            public void run() {
-                final int scrollPos = tabView.getLeft() - (getWidth() - tabView.getWidth()) / 2;
-                smoothScrollTo(scrollPos, 0);
-                mTabSelector = null;
-            }
-        };
-        post(mTabSelector);
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        if (mTabSelector != null) {
-            // Re-post the selector we saved
-            post(mTabSelector);
-        }
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-        if (mTabSelector != null) {
-            removeCallbacks(mTabSelector);
-        }
-    }
-
-    private void addTab(int index, CharSequence text, int iconResId) {
-        final TabView tabView = new TabView(getContext());
-        tabView.mIndex = index;
-        tabView.setFocusable(true);
-        tabView.setOnClickListener(mTabClickListener);
-        tabView.setText(text);
-
-        if (iconResId != 0) {
-            tabView.setCompoundDrawablesWithIntrinsicBounds(iconResId, 0, 0, 0);
-        }
-
-        mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, MATCH_PARENT, 1));
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int arg0) {
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(arg0);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int arg0, float arg1, int arg2) {
-        if (mListener != null) {
-            mListener.onPageScrolled(arg0, arg1, arg2);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int arg0) {
-        setCurrentItem(arg0);
-        if (mListener != null) {
-            mListener.onPageSelected(arg0);
-        }
-    }
-
-    @Override
-    public void setViewPager(ViewPager view) {
-        if (mViewPager == view) {
-            return;
-        }
-        if (mViewPager != null) {
-            mViewPager.setOnPageChangeListener(null);
-        }
-        final PagerAdapter adapter = view.getAdapter();
-        if (adapter == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = view;
-        view.setOnPageChangeListener(this);
-        notifyDataSetChanged();
-    }
-
-    public void notifyDataSetChanged() {
-        mTabLayout.removeAllViews();
-        PagerAdapter adapter = mViewPager.getAdapter();
-        IconPagerAdapter iconAdapter = null;
-        if (adapter instanceof IconPagerAdapter) {
-            iconAdapter = (IconPagerAdapter)adapter;
-        }
-        final int count = adapter.getCount();
-        for (int i = 0; i < count; i++) {
-            CharSequence title = adapter.getPageTitle(i);
-            if (title == null) {
-                title = EMPTY_TITLE;
-            }
-            int iconResId = 0;
-            if (iconAdapter != null) {
-                iconResId = iconAdapter.getIconResId(i);
-            }
-            addTab(i, title, iconResId);
-        }
-        if (mSelectedTabIndex > count) {
-            mSelectedTabIndex = count - 1;
-        }
-        setCurrentItem(mSelectedTabIndex);
-        requestLayout();
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mSelectedTabIndex = item;
-        mViewPager.setCurrentItem(item);
-
-        final int tabCount = mTabLayout.getChildCount();
-        for (int i = 0; i < tabCount; i++) {
-            final View child = mTabLayout.getChildAt(i);
-            final boolean isSelected = (i == item);
-            child.setSelected(isSelected);
-            if (isSelected) {
-                animateToTab(item);
-            }
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(OnPageChangeListener listener) {
-        mListener = listener;
-    }
-
-    private class TabView extends TextView {
-        private int mIndex;
-
-        public TabView(Context context) {
-            super(context, null, R.attr.vpiTabPageIndicatorStyle);
-        }
-
-        @Override
-        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
-            // Re-measure if we went beyond our maximum size.
-            if (mMaxTabWidth > 0 && getMeasuredWidth() > mMaxTabWidth) {
-                super.onMeasure(MeasureSpec.makeMeasureSpec(mMaxTabWidth, MeasureSpec.EXACTLY),
-                        heightMeasureSpec);
-            }
-        }
-
-        public int getIndex() {
-            return mIndex;
-        }
-    }
-}
diff --git a/src/com/viewpagerindicator/TitlePageIndicator.java b/src/com/viewpagerindicator/TitlePageIndicator.java
deleted file mode 100644 (file)
index 4965ad0..0000000
+++ /dev/null
@@ -1,884 +0,0 @@
-/*
- * Copyright (C) 2011 Jake Wharton
- * Copyright (C) 2011 Patrik Akerfeldt
- * Copyright (C) 2011 Francisco Figueiredo Jr.
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Path;
-import android.graphics.Rect;
-import android.graphics.Typeface;
-import android.graphics.drawable.Drawable;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.ViewConfigurationCompat;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewConfiguration;
-
-import com.cyanogenmod.eleven.R;
-
-import java.util.ArrayList;
-
-/**
- * A TitlePageIndicator is a PageIndicator which displays the title of left view
- * (if exist), the title of the current select view (centered) and the title of
- * the right view (if exist). When the user scrolls the ViewPager then titles are
- * also scrolled.
- */
-public class TitlePageIndicator extends View implements PageIndicator {
-    /**
-     * Percentage indicating what percentage of the screen width away from
-     * center should the underline be fully faded. A value of 0.25 means that
-     * halfway between the center of the screen and an edge.
-     */
-    private static final float SELECTION_FADE_PERCENTAGE = 0.25f;
-
-    /**
-     * Percentage indicating what percentage of the screen width away from
-     * center should the selected text bold turn off. A value of 0.05 means
-     * that 10% between the center and an edge.
-     */
-    private static final float BOLD_FADE_PERCENTAGE = 0.05f;
-
-    /**
-     * Title text used when no title is provided by the adapter.
-     */
-    private static final String EMPTY_TITLE = "";
-
-    /**
-     * Interface for a callback when the center item has been clicked.
-     */
-    public interface OnCenterItemClickListener {
-        /**
-         * Callback when the center item has been clicked.
-         *
-         * @param position Position of the current center item.
-         */
-        void onCenterItemClick(int position);
-    }
-
-    public enum IndicatorStyle {
-        None(0), Triangle(1), Underline(2);
-
-        public final int value;
-
-        private IndicatorStyle(int value) {
-            this.value = value;
-        }
-
-        public static IndicatorStyle fromValue(int value) {
-            for (IndicatorStyle style : IndicatorStyle.values()) {
-                if (style.value == value) {
-                    return style;
-                }
-            }
-            return null;
-        }
-    }
-
-    public enum LinePosition {
-        Bottom(0), Top(1);
-
-        public final int value;
-
-        private LinePosition(int value) {
-            this.value = value;
-        }
-
-        public static LinePosition fromValue(int value) {
-            for (LinePosition position : LinePosition.values()) {
-                if (position.value == value) {
-                    return position;
-                }
-            }
-            return null;
-        }
-    }
-
-    private ViewPager mViewPager;
-    private ViewPager.OnPageChangeListener mListener;
-    private int mCurrentPage = -1;
-    private float mPageOffset;
-    private int mScrollState;
-    private final Paint mPaintText = new Paint();
-    private boolean mBoldText;
-    private boolean mBoldAll;
-    private int mColorText;
-    private int mColorSelected;
-    private Path mPath = new Path();
-    private final Rect mBounds = new Rect();
-    private final Paint mPaintFooterLine = new Paint();
-    private IndicatorStyle mFooterIndicatorStyle;
-    private LinePosition mLinePosition;
-    private final Paint mPaintFooterIndicator = new Paint();
-    private float mFooterIndicatorHeight;
-    private float mFooterIndicatorUnderlinePadding;
-    private float mFooterPadding;
-    private float mTitlePadding;
-    private float mTopPadding;
-    /** Left and right side padding for not active view titles. */
-    private float mClipPadding;
-    private float mFooterLineHeight;
-
-    private static final int INVALID_POINTER = -1;
-
-    private int mTouchSlop;
-    private float mLastMotionX = -1;
-    private int mActivePointerId = INVALID_POINTER;
-    private boolean mIsDragging;
-
-    private OnCenterItemClickListener mCenterItemClickListener;
-
-
-    public TitlePageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public TitlePageIndicator(Context context, AttributeSet attrs) {
-        this(context, attrs, R.attr.vpiTitlePageIndicatorStyle);
-    }
-
-    public TitlePageIndicator(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        if (isInEditMode()) return;
-
-        //Load defaults from resources
-        final Resources res = getResources();
-        final int defaultFooterColor = res.getColor(R.color.default_title_indicator_footer_color);
-        final float defaultFooterLineHeight = res.getDimension(R.dimen.default_title_indicator_footer_line_height);
-        final int defaultFooterIndicatorStyle = res.getInteger(R.integer.default_title_indicator_footer_indicator_style);
-        final float defaultFooterIndicatorHeight = res.getDimension(R.dimen.default_title_indicator_footer_indicator_height);
-        final float defaultFooterIndicatorUnderlinePadding = res.getDimension(R.dimen.default_title_indicator_footer_indicator_underline_padding);
-        final float defaultFooterPadding = res.getDimension(R.dimen.default_title_indicator_footer_padding);
-        final int defaultLinePosition = res.getInteger(R.integer.default_title_indicator_line_position);
-        final int defaultSelectedColor = res.getColor(R.color.default_title_indicator_selected_color);
-        final boolean defaultSelectedBold = res.getBoolean(R.bool.default_title_indicator_selected_bold);
-        final boolean defaultBoldAll = res.getBoolean(R.bool.default_title_indicator_bold_all);
-        final int defaultTextColor = res.getColor(R.color.default_title_indicator_text_color);
-        final float defaultTextSize = res.getDimension(R.dimen.default_title_indicator_text_size);
-        final float defaultTitlePadding = res.getDimension(R.dimen.default_title_indicator_title_padding);
-        final float defaultClipPadding = res.getDimension(R.dimen.default_title_indicator_clip_padding);
-        final float defaultTopPadding = res.getDimension(R.dimen.default_title_indicator_top_padding);
-
-        //Retrieve styles attributes
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TitlePageIndicator, defStyle, 0);
-
-        //Retrieve the colors to be used for this view and apply them.
-        mFooterLineHeight = a.getDimension(R.styleable.TitlePageIndicator_footerLineHeight, defaultFooterLineHeight);
-        mFooterIndicatorStyle = IndicatorStyle.fromValue(a.getInteger(R.styleable.TitlePageIndicator_footerIndicatorStyle, defaultFooterIndicatorStyle));
-        mFooterIndicatorHeight = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorHeight, defaultFooterIndicatorHeight);
-        mFooterIndicatorUnderlinePadding = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorUnderlinePadding, defaultFooterIndicatorUnderlinePadding);
-        mFooterPadding = a.getDimension(R.styleable.TitlePageIndicator_footerPadding, defaultFooterPadding);
-        mLinePosition = LinePosition.fromValue(a.getInteger(R.styleable.TitlePageIndicator_linePosition, defaultLinePosition));
-        mTopPadding = a.getDimension(R.styleable.TitlePageIndicator_topPadding, defaultTopPadding);
-        mTitlePadding = a.getDimension(R.styleable.TitlePageIndicator_titlePadding, defaultTitlePadding);
-        mClipPadding = a.getDimension(R.styleable.TitlePageIndicator_clipPadding, defaultClipPadding);
-        mColorSelected = a.getColor(R.styleable.TitlePageIndicator_selectedColor, defaultSelectedColor);
-        mColorText = a.getColor(R.styleable.TitlePageIndicator_android_textColor, defaultTextColor);
-        mBoldText = a.getBoolean(R.styleable.TitlePageIndicator_selectedBold, defaultSelectedBold);
-        mBoldAll = a.getBoolean(R.styleable.TitlePageIndicator_boldAll, defaultBoldAll);
-
-        final float textSize = a.getDimension(R.styleable.TitlePageIndicator_android_textSize, defaultTextSize);
-        final int footerColor = a.getColor(R.styleable.TitlePageIndicator_footerColor, defaultFooterColor);
-        mPaintText.setTextSize(textSize);
-        mPaintText.setAntiAlias(true);
-        mPaintFooterLine.setStyle(Paint.Style.FILL_AND_STROKE);
-        mPaintFooterLine.setStrokeWidth(mFooterLineHeight);
-        mPaintFooterLine.setColor(footerColor);
-        mPaintFooterIndicator.setStyle(Paint.Style.FILL_AND_STROKE);
-        mPaintFooterIndicator.setColor(footerColor);
-
-        Drawable background = a.getDrawable(R.styleable.TitlePageIndicator_android_background);
-        if (background != null) {
-          setBackgroundDrawable(background);
-        }
-
-        a.recycle();
-
-        final ViewConfiguration configuration = ViewConfiguration.get(context);
-        mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
-    }
-
-
-    public int getFooterColor() {
-        return mPaintFooterLine.getColor();
-    }
-
-    public void setFooterColor(int footerColor) {
-        mPaintFooterLine.setColor(footerColor);
-        mPaintFooterIndicator.setColor(footerColor);
-        invalidate();
-    }
-
-    public float getFooterLineHeight() {
-        return mFooterLineHeight;
-    }
-
-    public void setFooterLineHeight(float footerLineHeight) {
-        mFooterLineHeight = footerLineHeight;
-        mPaintFooterLine.setStrokeWidth(mFooterLineHeight);
-        invalidate();
-    }
-
-    public float getFooterIndicatorHeight() {
-        return mFooterIndicatorHeight;
-    }
-
-    public void setFooterIndicatorHeight(float footerTriangleHeight) {
-        mFooterIndicatorHeight = footerTriangleHeight;
-        invalidate();
-    }
-
-    public float getFooterIndicatorPadding() {
-        return mFooterPadding;
-    }
-
-    public void setFooterIndicatorPadding(float footerIndicatorPadding) {
-        mFooterPadding = footerIndicatorPadding;
-        invalidate();
-    }
-
-    public IndicatorStyle getFooterIndicatorStyle() {
-        return mFooterIndicatorStyle;
-    }
-
-    public void setFooterIndicatorStyle(IndicatorStyle indicatorStyle) {
-        mFooterIndicatorStyle = indicatorStyle;
-        invalidate();
-    }
-
-    public LinePosition getLinePosition() {
-        return mLinePosition;
-    }
-
-    public void setLinePosition(LinePosition linePosition) {
-        mLinePosition = linePosition;
-        invalidate();
-    }
-
-    public int getSelectedColor() {
-        return mColorSelected;
-    }
-
-    public void setSelectedColor(int selectedColor) {
-        mColorSelected = selectedColor;
-        invalidate();
-    }
-
-    public boolean isSelectedBold() {
-        return mBoldText;
-    }
-
-    public void setSelectedBold(boolean selectedBold) {
-        mBoldText = selectedBold;
-        invalidate();
-    }
-
-    public boolean isBoldAll() {
-        return mBoldAll;
-    }
-
-    public void setBoldAll(boolean boldAll) {
-        mBoldAll = boldAll;
-        invalidate();
-    }
-
-    public int getTextColor() {
-        return mColorText;
-    }
-
-    public void setTextColor(int textColor) {
-        mPaintText.setColor(textColor);
-        mColorText = textColor;
-        invalidate();
-    }
-
-    public float getTextSize() {
-        return mPaintText.getTextSize();
-    }
-
-    public void setTextSize(float textSize) {
-        mPaintText.setTextSize(textSize);
-        invalidate();
-    }
-
-    public float getTitlePadding() {
-        return this.mTitlePadding;
-    }
-
-    public void setTitlePadding(float titlePadding) {
-        mTitlePadding = titlePadding;
-        invalidate();
-    }
-
-    public float getTopPadding() {
-        return this.mTopPadding;
-    }
-
-    public void setTopPadding(float topPadding) {
-        mTopPadding = topPadding;
-        invalidate();
-    }
-
-    public float getClipPadding() {
-        return this.mClipPadding;
-    }
-
-    public void setClipPadding(float clipPadding) {
-        mClipPadding = clipPadding;
-        invalidate();
-    }
-
-    public void setTypeface(Typeface typeface) {
-        mPaintText.setTypeface(typeface);
-        invalidate();
-    }
-
-    public Typeface getTypeface() {
-        return mPaintText.getTypeface();
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see android.view.View#onDraw(android.graphics.Canvas)
-     */
-    @Override
-    protected void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-
-        if (mViewPager == null) {
-            return;
-        }
-        final int count = mViewPager.getAdapter().getCount();
-        if (count == 0) {
-            return;
-        }
-
-        // mCurrentPage is -1 on first start and after orientation changed. If so, retrieve the correct index from viewpager.
-        if (mCurrentPage == -1 && mViewPager != null) {
-            mCurrentPage = mViewPager.getCurrentItem();
-        }
-
-        //Calculate views bounds
-        ArrayList<Rect> bounds = calculateAllBounds(mPaintText);
-        final int boundsSize = bounds.size();
-
-        //Make sure we're on a page that still exists
-        if (mCurrentPage >= boundsSize) {
-            setCurrentItem(boundsSize - 1);
-            return;
-        }
-
-        final int countMinusOne = count - 1;
-        final float halfWidth = getWidth() / 2f;
-        final int left = getLeft();
-        final float leftClip = left + mClipPadding;
-        final int width = getWidth();
-        int height = getHeight();
-        final int right = left + width;
-        final float rightClip = right - mClipPadding;
-
-        int page = mCurrentPage;
-        float offsetPercent;
-        if (mPageOffset <= 0.5) {
-            offsetPercent = mPageOffset;
-        } else {
-            page += 1;
-            offsetPercent = 1 - mPageOffset;
-        }
-        final boolean currentSelected = (offsetPercent <= SELECTION_FADE_PERCENTAGE);
-        final boolean currentBold = (offsetPercent <= BOLD_FADE_PERCENTAGE);
-        final float selectedPercent = (SELECTION_FADE_PERCENTAGE - offsetPercent) / SELECTION_FADE_PERCENTAGE;
-
-        //Verify if the current view must be clipped to the screen
-        Rect curPageBound = bounds.get(mCurrentPage);
-        float curPageWidth = curPageBound.right - curPageBound.left;
-        if (curPageBound.left < leftClip) {
-            //Try to clip to the screen (left side)
-            clipViewOnTheLeft(curPageBound, curPageWidth, left);
-        }
-        if (curPageBound.right > rightClip) {
-            //Try to clip to the screen (right side)
-            clipViewOnTheRight(curPageBound, curPageWidth, right);
-        }
-
-        //Left views starting from the current position
-        if (mCurrentPage > 0) {
-            for (int i = mCurrentPage - 1; i >= 0; i--) {
-                Rect bound = bounds.get(i);
-                //Is left side is outside the screen
-                if (bound.left < leftClip) {
-                    int w = bound.right - bound.left;
-                    //Try to clip to the screen (left side)
-                    clipViewOnTheLeft(bound, w, left);
-                    //Except if there's an intersection with the right view
-                    Rect rightBound = bounds.get(i + 1);
-                    //Intersection
-                    if (bound.right + mTitlePadding > rightBound.left) {
-                        bound.left = (int) (rightBound.left - w - mTitlePadding);
-                        bound.right = bound.left + w;
-                    }
-                }
-            }
-        }
-        //Right views starting from the current position
-        if (mCurrentPage < countMinusOne) {
-            for (int i = mCurrentPage + 1 ; i < count; i++) {
-                Rect bound = bounds.get(i);
-                //If right side is outside the screen
-                if (bound.right > rightClip) {
-                    int w = bound.right - bound.left;
-                    //Try to clip to the screen (right side)
-                    clipViewOnTheRight(bound, w, right);
-                    //Except if there's an intersection with the left view
-                    Rect leftBound = bounds.get(i - 1);
-                    //Intersection
-                    if (bound.left - mTitlePadding < leftBound.right) {
-                        bound.left = (int) (leftBound.right + mTitlePadding);
-                        bound.right = bound.left + w;
-                    }
-                }
-            }
-        }
-
-        //Now draw views
-        int colorTextAlpha = mColorText >>> 24;
-        for (int i = 0; i < count; i++) {
-            //Get the title
-            Rect bound = bounds.get(i);
-            //Only if one side is visible
-            if ((bound.left > left && bound.left < right) || (bound.right > left && bound.right < right)) {
-                final boolean currentPage = (i == page);
-                final CharSequence pageTitle = getTitle(i);
-
-                //Only set bold if we are within bounds
-                mPaintText.setFakeBoldText(mBoldAll || (currentPage && currentBold && mBoldText));
-
-                //Draw text as unselected
-                mPaintText.setColor(mColorText);
-                if(currentPage && currentSelected && !mBoldAll) {
-                    //Fade out/in unselected text as the selected text fades in/out
-                    mPaintText.setAlpha(colorTextAlpha - (int)(colorTextAlpha * selectedPercent));
-                }
-
-                //Except if there's an intersection with the right view
-                if (i < boundsSize - 1)  {
-                    Rect rightBound = bounds.get(i + 1);
-                    //Intersection
-                    if (bound.right + mTitlePadding > rightBound.left) {
-                        int w = bound.right - bound.left;
-                        bound.left = (int) (rightBound.left - w - mTitlePadding);
-                        bound.right = bound.left + w;
-                    }
-                }
-                canvas.drawText(pageTitle, 0, pageTitle.length(), bound.left, bound.bottom + mTopPadding, mPaintText);
-
-                //If we are within the selected bounds draw the selected text
-                if (currentPage && currentSelected) {
-                    mPaintText.setColor(mColorSelected);
-                    mPaintText.setAlpha((int)((mColorSelected >>> 24) * selectedPercent));
-                    canvas.drawText(pageTitle, 0, pageTitle.length(), bound.left, bound.bottom + mTopPadding, mPaintText);
-                }
-            }
-        }
-
-        //If we want the line on the top change height to zero and invert the line height to trick the drawing code
-        float footerLineHeight = mFooterLineHeight;
-        float footerIndicatorLineHeight = mFooterIndicatorHeight;
-        if (mLinePosition == LinePosition.Top) {
-            height = 0;
-            footerLineHeight = -footerLineHeight;
-            footerIndicatorLineHeight = -footerIndicatorLineHeight;
-        }
-
-        //Draw the footer line
-        mPath.reset();
-        mPath.moveTo(0, height - footerLineHeight / 2f);
-        mPath.lineTo(width, height - footerLineHeight / 2f);
-        mPath.close();
-        canvas.drawPath(mPath, mPaintFooterLine);
-
-        float heightMinusLine = height - footerLineHeight;
-        switch (mFooterIndicatorStyle) {
-            case Triangle:
-                mPath.reset();
-                mPath.moveTo(halfWidth, heightMinusLine - footerIndicatorLineHeight);
-                mPath.lineTo(halfWidth + footerIndicatorLineHeight, heightMinusLine);
-                mPath.lineTo(halfWidth - footerIndicatorLineHeight, heightMinusLine);
-                mPath.close();
-                canvas.drawPath(mPath, mPaintFooterIndicator);
-                break;
-
-            case Underline:
-                if (!currentSelected || page >= boundsSize) {
-                    break;
-                }
-
-                Rect underlineBounds = bounds.get(page);
-                final float rightPlusPadding = underlineBounds.right + mFooterIndicatorUnderlinePadding;
-                final float leftMinusPadding = underlineBounds.left - mFooterIndicatorUnderlinePadding;
-                final float heightMinusLineMinusIndicator = heightMinusLine - footerIndicatorLineHeight;
-
-                mPath.reset();
-                mPath.moveTo(leftMinusPadding, heightMinusLine);
-                mPath.lineTo(rightPlusPadding, heightMinusLine);
-                mPath.lineTo(rightPlusPadding, heightMinusLineMinusIndicator);
-                mPath.lineTo(leftMinusPadding, heightMinusLineMinusIndicator);
-                mPath.close();
-
-                mPaintFooterIndicator.setAlpha((int)(0xFF * selectedPercent));
-                canvas.drawPath(mPath, mPaintFooterIndicator);
-                mPaintFooterIndicator.setAlpha(0xFF);
-                break;
-        }
-    }
-
-    public boolean onTouchEvent(android.view.MotionEvent ev) {
-        if (super.onTouchEvent(ev)) {
-            return true;
-        }
-        if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) {
-            return false;
-        }
-
-        final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;
-        switch (action) {
-            case MotionEvent.ACTION_DOWN:
-                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
-                mLastMotionX = ev.getX();
-                break;
-
-            case MotionEvent.ACTION_MOVE: {
-                final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
-                final float x = MotionEventCompat.getX(ev, activePointerIndex);
-                final float deltaX = x - mLastMotionX;
-
-                if (!mIsDragging) {
-                    if (Math.abs(deltaX) > mTouchSlop) {
-                        mIsDragging = true;
-                    }
-                }
-
-                if (mIsDragging) {
-                    mLastMotionX = x;
-                    if (mViewPager.isFakeDragging() || mViewPager.beginFakeDrag()) {
-                        mViewPager.fakeDragBy(deltaX);
-                    }
-                }
-
-                break;
-            }
-
-            case MotionEvent.ACTION_CANCEL:
-            case MotionEvent.ACTION_UP:
-                if (!mIsDragging) {
-                    final int count = mViewPager.getAdapter().getCount();
-                    final int width = getWidth();
-                    final float halfWidth = width / 2f;
-                    final float sixthWidth = width / 6f;
-                    final float leftThird = halfWidth - sixthWidth;
-                    final float rightThird = halfWidth + sixthWidth;
-                    final float eventX = ev.getX();
-
-                    if (eventX < leftThird) {
-                        if (mCurrentPage > 0) {
-                            if (action != MotionEvent.ACTION_CANCEL) {
-                                mViewPager.setCurrentItem(mCurrentPage - 1);
-                            }
-                            return true;
-                        }
-                    } else if (eventX > rightThird) {
-                        if (mCurrentPage < count - 1) {
-                            if (action != MotionEvent.ACTION_CANCEL) {
-                                mViewPager.setCurrentItem(mCurrentPage + 1);
-                            }
-                            return true;
-                        }
-                    } else {
-                        //Middle third
-                        if (mCenterItemClickListener != null && action != MotionEvent.ACTION_CANCEL) {
-                            mCenterItemClickListener.onCenterItemClick(mCurrentPage);
-                        }
-                    }
-                }
-
-                mIsDragging = false;
-                mActivePointerId = INVALID_POINTER;
-                if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
-                break;
-
-            case MotionEventCompat.ACTION_POINTER_DOWN: {
-                final int index = MotionEventCompat.getActionIndex(ev);
-                mLastMotionX = MotionEventCompat.getX(ev, index);
-                mActivePointerId = MotionEventCompat.getPointerId(ev, index);
-                break;
-            }
-
-            case MotionEventCompat.ACTION_POINTER_UP:
-                final int pointerIndex = MotionEventCompat.getActionIndex(ev);
-                final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
-                if (pointerId == mActivePointerId) {
-                    final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
-                    mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
-                }
-                mLastMotionX = MotionEventCompat.getX(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId));
-                break;
-        }
-
-        return true;
-    }
-
-    /**
-     * Set bounds for the right textView including clip padding.
-     *
-     * @param curViewBound
-     *            current bounds.
-     * @param curViewWidth
-     *            width of the view.
-     */
-    private void clipViewOnTheRight(Rect curViewBound, float curViewWidth, int right) {
-        curViewBound.right = (int) (right - mClipPadding);
-        curViewBound.left = (int) (curViewBound.right - curViewWidth);
-    }
-
-    /**
-     * Set bounds for the left textView including clip padding.
-     *
-     * @param curViewBound
-     *            current bounds.
-     * @param curViewWidth
-     *            width of the view.
-     */
-    private void clipViewOnTheLeft(Rect curViewBound, float curViewWidth, int left) {
-        curViewBound.left = (int) (left + mClipPadding);
-        curViewBound.right = (int) (mClipPadding + curViewWidth);
-    }
-
-    /**
-     * Calculate views bounds and scroll them according to the current index
-     *
-     * @param paint
-     * @return
-     */
-    private ArrayList<Rect> calculateAllBounds(Paint paint) {
-        ArrayList<Rect> list = new ArrayList<Rect>();
-        //For each views (If no values then add a fake one)
-        final int count = mViewPager.getAdapter().getCount();
-        final int width = getWidth();
-        final int halfWidth = width / 2;
-        for (int i = 0; i < count; i++) {
-            Rect bounds = calcBounds(i, paint);
-            int w = bounds.right - bounds.left;
-            int h = bounds.bottom - bounds.top;
-            bounds.left = (int)(halfWidth - (w / 2f) + ((i - mCurrentPage - mPageOffset) * width));
-            bounds.right = bounds.left + w;
-            bounds.top = 0;
-            bounds.bottom = h;
-            list.add(bounds);
-        }
-
-        return list;
-    }
-
-    /**
-     * Calculate the bounds for a view's title
-     *
-     * @param index
-     * @param paint
-     * @return
-     */
-    private Rect calcBounds(int index, Paint paint) {
-        //Calculate the text bounds
-        Rect bounds = new Rect();
-        CharSequence title = getTitle(index);
-        bounds.right = (int) paint.measureText(title, 0, title.length());
-        bounds.bottom = (int) (paint.descent() - paint.ascent());
-        return bounds;
-    }
-
-    @Override
-    public void setViewPager(ViewPager view) {
-        if (mViewPager == view) {
-            return;
-        }
-        if (mViewPager != null) {
-            mViewPager.setOnPageChangeListener(null);
-        }
-        if (view.getAdapter() == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = view;
-        mViewPager.setOnPageChangeListener(this);
-        invalidate();
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void notifyDataSetChanged() {
-        invalidate();
-    }
-
-    /**
-     * Set a callback listener for the center item click.
-     *
-     * @param listener Callback instance.
-     */
-    public void setOnCenterItemClickListener(OnCenterItemClickListener listener) {
-        mCenterItemClickListener = listener;
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mViewPager.setCurrentItem(item);
-        mCurrentPage = item;
-        invalidate();
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int state) {
-        mScrollState = state;
-
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(state);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-        mCurrentPage = position;
-        mPageOffset = positionOffset;
-        invalidate();
-
-        if (mListener != null) {
-            mListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int position) {
-        if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
-            mCurrentPage = position;
-            invalidate();
-        }
-
-        if (mListener != null) {
-            mListener.onPageSelected(position);
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
-        mListener = listener;
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        //Measure our width in whatever mode specified
-        final int measuredWidth = MeasureSpec.getSize(widthMeasureSpec);
-
-        //Determine our height
-        float height;
-        final int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
-        if (heightSpecMode == MeasureSpec.EXACTLY) {
-            //We were told how big to be
-            height = MeasureSpec.getSize(heightMeasureSpec);
-        } else {
-            //Calculate the text bounds
-            mBounds.setEmpty();
-            mBounds.bottom = (int) (mPaintText.descent() - mPaintText.ascent());
-            height = mBounds.bottom - mBounds.top + mFooterLineHeight + mFooterPadding + mTopPadding;
-            if (mFooterIndicatorStyle != IndicatorStyle.None) {
-                height += mFooterIndicatorHeight;
-            }
-        }
-        final int measuredHeight = (int)height;
-
-        setMeasuredDimension(measuredWidth, measuredHeight);
-    }
-
-    @Override
-    public void onRestoreInstanceState(Parcelable state) {
-        SavedState savedState = (SavedState)state;
-        super.onRestoreInstanceState(savedState.getSuperState());
-        mCurrentPage = savedState.currentPage;
-        requestLayout();
-    }
-
-    @Override
-    public Parcelable onSaveInstanceState() {
-        Parcelable superState = super.onSaveInstanceState();
-        SavedState savedState = new SavedState(superState);
-        savedState.currentPage = mCurrentPage;
-        return savedState;
-    }
-
-    static class SavedState extends BaseSavedState {
-        int currentPage;
-
-        public SavedState(Parcelable superState) {
-            super(superState);
-        }
-
-        private SavedState(Parcel in) {
-            super(in);
-            currentPage = in.readInt();
-        }
-
-        @Override
-        public void writeToParcel(Parcel dest, int flags) {
-            super.writeToParcel(dest, flags);
-            dest.writeInt(currentPage);
-        }
-
-        @SuppressWarnings("UnusedDeclaration")
-        public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
-            @Override
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
-
-            @Override
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
-    }
-
-    private CharSequence getTitle(int i) {
-        CharSequence title = mViewPager.getAdapter().getPageTitle(i);
-        if (title == null) {
-            title = EMPTY_TITLE;
-        }
-        return title;
-    }
-}
diff --git a/src/com/viewpagerindicator/UnderlinePageIndicator.java b/src/com/viewpagerindicator/UnderlinePageIndicator.java
deleted file mode 100644 (file)
index 0f799c2..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- * Copyright (C) 2012 Jake Wharton
- *
- * 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.
- */
-package com.viewpagerindicator;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.drawable.Drawable;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.ViewConfigurationCompat;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewConfiguration;
-
-import com.cyanogenmod.eleven.R;
-
-/**
- * Draws a line for each page. The current page line is colored differently
- * than the unselected page lines.
- */
-public class UnderlinePageIndicator extends View implements PageIndicator {
-    private static final int INVALID_POINTER = -1;
-    private static final int FADE_FRAME_MS = 30;
-
-    private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-
-    private boolean mFades;
-    private int mFadeDelay;
-    private int mFadeLength;
-    private int mFadeBy;
-
-    private ViewPager mViewPager;
-    private ViewPager.OnPageChangeListener mListener;
-    private int mScrollState;
-    private int mCurrentPage;
-    private float mPositionOffset;
-
-    private int mTouchSlop;
-    private float mLastMotionX = -1;
-    private int mActivePointerId = INVALID_POINTER;
-    private boolean mIsDragging;
-
-    private final Runnable mFadeRunnable = new Runnable() {
-      @Override public void run() {
-        if (!mFades) return;
-
-        final int alpha = Math.max(mPaint.getAlpha() - mFadeBy, 0);
-        mPaint.setAlpha(alpha);
-        invalidate();
-        if (alpha > 0) {
-          postDelayed(this, FADE_FRAME_MS);
-        }
-      }
-    };
-
-    public UnderlinePageIndicator(Context context) {
-        this(context, null);
-    }
-
-    public UnderlinePageIndicator(Context context, AttributeSet attrs) {
-        this(context, attrs, R.attr.vpiUnderlinePageIndicatorStyle);
-    }
-
-    public UnderlinePageIndicator(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        if (isInEditMode()) return;
-
-        final Resources res = getResources();
-
-        //Load defaults from resources
-        final boolean defaultFades = res.getBoolean(R.bool.default_underline_indicator_fades);
-        final int defaultFadeDelay = res.getInteger(R.integer.default_underline_indicator_fade_delay);
-        final int defaultFadeLength = res.getInteger(R.integer.default_underline_indicator_fade_length);
-        final int defaultSelectedColor = res.getColor(R.color.default_underline_indicator_selected_color);
-
-        //Retrieve styles attributes
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.UnderlinePageIndicator, defStyle, 0);
-
-        setFades(a.getBoolean(R.styleable.UnderlinePageIndicator_fades, defaultFades));
-        setSelectedColor(a.getColor(R.styleable.UnderlinePageIndicator_selectedColor, defaultSelectedColor));
-        setFadeDelay(a.getInteger(R.styleable.UnderlinePageIndicator_fadeDelay, defaultFadeDelay));
-        setFadeLength(a.getInteger(R.styleable.UnderlinePageIndicator_fadeLength, defaultFadeLength));
-
-        Drawable background = a.getDrawable(R.styleable.UnderlinePageIndicator_android_background);
-        if (background != null) {
-          setBackgroundDrawable(background);
-        }
-
-        a.recycle();
-
-        final ViewConfiguration configuration = ViewConfiguration.get(context);
-        mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
-    }
-
-    public boolean getFades() {
-        return mFades;
-    }
-
-    public void setFades(boolean fades) {
-        if (fades != mFades) {
-            mFades = fades;
-            if (fades) {
-                post(mFadeRunnable);
-            } else {
-                removeCallbacks(mFadeRunnable);
-                mPaint.setAlpha(0xFF);
-                invalidate();
-            }
-        }
-    }
-
-    public int getFadeDelay() {
-        return mFadeDelay;
-    }
-
-    public void setFadeDelay(int fadeDelay) {
-        mFadeDelay = fadeDelay;
-    }
-
-    public int getFadeLength() {
-        return mFadeLength;
-    }
-
-    public void setFadeLength(int fadeLength) {
-        mFadeLength = fadeLength;
-        mFadeBy = 0xFF / (mFadeLength / FADE_FRAME_MS);
-    }
-
-    public int getSelectedColor() {
-        return mPaint.getColor();
-    }
-
-    public void setSelectedColor(int selectedColor) {
-        mPaint.setColor(selectedColor);
-        invalidate();
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-
-        if (mViewPager == null) {
-            return;
-        }
-        final int count = mViewPager.getAdapter().getCount();
-        if (count == 0) {
-            return;
-        }
-
-        if (mCurrentPage >= count) {
-            setCurrentItem(count - 1);
-            return;
-        }
-
-        final int paddingLeft = getPaddingLeft();
-        final float pageWidth = (getWidth() - paddingLeft - getPaddingRight()) / (1f * count);
-        final float left = paddingLeft + pageWidth * (mCurrentPage + mPositionOffset);
-        final float right = left + pageWidth;
-        final float top = getPaddingTop();
-        final float bottom = getHeight() - getPaddingBottom();
-        canvas.drawRect(left, top, right, bottom, mPaint);
-    }
-
-    public boolean onTouchEvent(MotionEvent ev) {
-        if (super.onTouchEvent(ev)) {
-            return true;
-        }
-        if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) {
-            return false;
-        }
-
-        final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;
-        switch (action) {
-            case MotionEvent.ACTION_DOWN:
-                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
-                mLastMotionX = ev.getX();
-                break;
-
-            case MotionEvent.ACTION_MOVE: {
-                final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
-                final float x = MotionEventCompat.getX(ev, activePointerIndex);
-                final float deltaX = x - mLastMotionX;
-
-                if (!mIsDragging) {
-                    if (Math.abs(deltaX) > mTouchSlop) {
-                        mIsDragging = true;
-                    }
-                }
-
-                if (mIsDragging) {
-                    mLastMotionX = x;
-                    if (mViewPager.isFakeDragging() || mViewPager.beginFakeDrag()) {
-                        mViewPager.fakeDragBy(deltaX);
-                    }
-                }
-
-                break;
-            }
-
-            case MotionEvent.ACTION_CANCEL:
-            case MotionEvent.ACTION_UP:
-                if (!mIsDragging) {
-                    final int count = mViewPager.getAdapter().getCount();
-                    final int width = getWidth();
-                    final float halfWidth = width / 2f;
-                    final float sixthWidth = width / 6f;
-
-                    if ((mCurrentPage > 0) && (ev.getX() < halfWidth - sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage - 1);
-                        }
-                        return true;
-                    } else if ((mCurrentPage < count - 1) && (ev.getX() > halfWidth + sixthWidth)) {
-                        if (action != MotionEvent.ACTION_CANCEL) {
-                            mViewPager.setCurrentItem(mCurrentPage + 1);
-                        }
-                        return true;
-                    }
-                }
-
-                mIsDragging = false;
-                mActivePointerId = INVALID_POINTER;
-                if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
-                break;
-
-            case MotionEventCompat.ACTION_POINTER_DOWN: {
-                final int index = MotionEventCompat.getActionIndex(ev);
-                mLastMotionX = MotionEventCompat.getX(ev, index);
-                mActivePointerId = MotionEventCompat.getPointerId(ev, index);
-                break;
-            }
-
-            case MotionEventCompat.ACTION_POINTER_UP:
-                final int pointerIndex = MotionEventCompat.getActionIndex(ev);
-                final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
-                if (pointerId == mActivePointerId) {
-                    final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
-                    mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
-                }
-                mLastMotionX = MotionEventCompat.getX(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId));
-                break;
-        }
-
-        return true;
-    }
-
-    @Override
-    public void setViewPager(ViewPager viewPager) {
-        if (mViewPager == viewPager) {
-            return;
-        }
-        if (mViewPager != null) {
-            //Clear us from the old pager.
-            mViewPager.setOnPageChangeListener(null);
-        }
-        if (viewPager.getAdapter() == null) {
-            throw new IllegalStateException("ViewPager does not have adapter instance.");
-        }
-        mViewPager = viewPager;
-        mViewPager.setOnPageChangeListener(this);
-        invalidate();
-        post(new Runnable() {
-            @Override public void run() {
-                if (mFades) {
-                    post(mFadeRunnable);
-                }
-            }
-        });
-    }
-
-    @Override
-    public void setViewPager(ViewPager view, int initialPosition) {
-        setViewPager(view);
-        setCurrentItem(initialPosition);
-    }
-
-    @Override
-    public void setCurrentItem(int item) {
-        if (mViewPager == null) {
-            throw new IllegalStateException("ViewPager has not been bound.");
-        }
-        mViewPager.setCurrentItem(item);
-        mCurrentPage = item;
-        invalidate();
-    }
-
-    @Override
-    public void notifyDataSetChanged() {
-        invalidate();
-    }
-
-    @Override
-    public void onPageScrollStateChanged(int state) {
-        mScrollState = state;
-
-        if (mListener != null) {
-            mListener.onPageScrollStateChanged(state);
-        }
-    }
-
-    @Override
-    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-        mCurrentPage = position;
-        mPositionOffset = positionOffset;
-        if (mFades) {
-            if (positionOffsetPixels > 0) {
-                removeCallbacks(mFadeRunnable);
-                mPaint.setAlpha(0xFF);
-            } else if (mScrollState != ViewPager.SCROLL_STATE_DRAGGING) {
-                postDelayed(mFadeRunnable, mFadeDelay);
-            }
-        }
-        invalidate();
-
-        if (mListener != null) {
-            mListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
-        }
-    }
-
-    @Override
-    public void onPageSelected(int position) {
-        if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
-            mCurrentPage = position;
-            mPositionOffset = 0;
-            invalidate();
-            mFadeRunnable.run();
-        }
-        if (mListener != null) {
-            mListener.onPageSelected(position);
-        }
-    }
-
-    @Override
-    public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
-        mListener = listener;
-    }
-
-    @Override
-    public void onRestoreInstanceState(Parcelable state) {
-        SavedState savedState = (SavedState)state;
-        super.onRestoreInstanceState(savedState.getSuperState());
-        mCurrentPage = savedState.currentPage;
-        requestLayout();
-    }
-
-    @Override
-    public Parcelable onSaveInstanceState() {
-        Parcelable superState = super.onSaveInstanceState();
-        SavedState savedState = new SavedState(superState);
-        savedState.currentPage = mCurrentPage;
-        return savedState;
-    }
-
-    static class SavedState extends BaseSavedState {
-        int currentPage;
-
-        public SavedState(Parcelable superState) {
-            super(superState);
-        }
-
-        private SavedState(Parcel in) {
-            super(in);
-            currentPage = in.readInt();
-        }
-
-        @Override
-        public void writeToParcel(Parcel dest, int flags) {
-            super.writeToParcel(dest, flags);
-            dest.writeInt(currentPage);
-        }
-
-        @SuppressWarnings("UnusedDeclaration")
-        public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
-            @Override
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
-
-            @Override
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
-    }
-}