Merge "Remove workaround for wrong search icon in landscape."
diff --git a/res/drawable-hdpi/app_market_generic.png b/res/drawable-hdpi/app_market_generic.png
deleted file mode 100644
index 117453c..0000000
--- a/res/drawable-hdpi/app_market_generic.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/default_widget_preview_holo.9.png b/res/drawable-hdpi/default_widget_preview_holo.9.png
new file mode 100644
index 0000000..ecf5deb
--- /dev/null
+++ b/res/drawable-hdpi/default_widget_preview_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/gardening_crosshairs.png b/res/drawable-hdpi/gardening_crosshairs.png
index 409bb5d..5f83592 100644
--- a/res/drawable-hdpi/gardening_crosshairs.png
+++ b/res/drawable-hdpi/gardening_crosshairs.png
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_blue_normal_holo.9.png b/res/drawable-hdpi/homescreen_blue_normal_holo.9.png
new file mode 100644
index 0000000..ece2afd
--- /dev/null
+++ b/res/drawable-hdpi/homescreen_blue_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_blue_strong_holo.9.png b/res/drawable-hdpi/homescreen_blue_strong_holo.9.png
new file mode 100644
index 0000000..3407107
--- /dev/null
+++ b/res/drawable-hdpi/homescreen_blue_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_green_normal_holo.9.png b/res/drawable-hdpi/homescreen_green_normal_holo.9.png
new file mode 100644
index 0000000..7332c3b
--- /dev/null
+++ b/res/drawable-hdpi/homescreen_green_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_green_strong_holo.9.png b/res/drawable-hdpi/homescreen_green_strong_holo.9.png
new file mode 100644
index 0000000..190c6cc
--- /dev/null
+++ b/res/drawable-hdpi/homescreen_green_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_large_blue.9.png b/res/drawable-hdpi/homescreen_large_blue.9.png
deleted file mode 100644
index 416514d..0000000
--- a/res/drawable-hdpi/homescreen_large_blue.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_large_blue_strong.9.png b/res/drawable-hdpi/homescreen_large_blue_strong.9.png
deleted file mode 100644
index d7e32e7..0000000
--- a/res/drawable-hdpi/homescreen_large_blue_strong.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_large_green.9.png b/res/drawable-hdpi/homescreen_large_green.9.png
deleted file mode 100644
index 60042c2..0000000
--- a/res/drawable-hdpi/homescreen_large_green.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/homescreen_large_green_strong.9.png b/res/drawable-hdpi/homescreen_large_green_strong.9.png
deleted file mode 100644
index c40b98e..0000000
--- a/res/drawable-hdpi/homescreen_large_green_strong.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/hotseat_scrubber_holo.9.png b/res/drawable-hdpi/hotseat_scrubber_holo.9.png
new file mode 100644
index 0000000..78b540d
--- /dev/null
+++ b/res/drawable-hdpi/hotseat_scrubber_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/hotseat_track_holo.9.png b/res/drawable-hdpi/hotseat_track_holo.9.png
new file mode 100644
index 0000000..ca495ff
--- /dev/null
+++ b/res/drawable-hdpi/hotseat_track_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_delete_holo_dark.png b/res/drawable-hdpi/ic_home_delete_holo_dark.png
deleted file mode 100644
index 9d64278..0000000
--- a/res/drawable-hdpi/ic_home_delete_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_delete_hover_holo_dark.png b/res/drawable-hdpi/ic_home_delete_hover_holo_dark.png
deleted file mode 100644
index 60d5b15..0000000
--- a/res/drawable-hdpi/ic_home_delete_hover_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_info_holo_dark.png b/res/drawable-hdpi/ic_home_info_holo_dark.png
deleted file mode 100644
index 02df4e1..0000000
--- a/res/drawable-hdpi/ic_home_info_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_info_active_holo.png b/res/drawable-hdpi/ic_launcher_info_active_holo.png
new file mode 100644
index 0000000..83ca112
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_info_active_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_info_normal_holo.png b/res/drawable-hdpi/ic_launcher_info_normal_holo.png
new file mode 100644
index 0000000..25fb1ac
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_info_normal_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_market_holo.png b/res/drawable-hdpi/ic_launcher_market_holo.png
new file mode 100644
index 0000000..dc78251
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_market_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_trashcan_active_holo.png b/res/drawable-hdpi/ic_launcher_trashcan_active_holo.png
new file mode 100644
index 0000000..51f0298
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_trashcan_active_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_trashcan_normal_holo.png b/res/drawable-hdpi/ic_launcher_trashcan_normal_holo.png
new file mode 100644
index 0000000..27a4b5e
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_trashcan_normal_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left.9.png b/res/drawable-hdpi/page_hover_left.9.png
deleted file mode 100644
index 1bf1565..0000000
--- a/res/drawable-hdpi/page_hover_left.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left_holo.9.png b/res/drawable-hdpi/page_hover_left_holo.9.png
new file mode 100644
index 0000000..0f405a5
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right.9.png b/res/drawable-hdpi/page_hover_right.9.png
deleted file mode 100644
index 7995f69..0000000
--- a/res/drawable-hdpi/page_hover_right.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right_holo.9.png b/res/drawable-hdpi/page_hover_right_holo.9.png
new file mode 100644
index 0000000..b7b4c56
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_right_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/paged_view_indicator.9.png b/res/drawable-hdpi/paged_view_indicator.9.png
deleted file mode 100644
index 9fd357a..0000000
--- a/res/drawable-hdpi/paged_view_indicator.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/portal_container_holo.9.png b/res/drawable-hdpi/portal_container_holo.9.png
index e2a1bd5..ab846f6 100644
--- a/res/drawable-hdpi/portal_container_holo.9.png
+++ b/res/drawable-hdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/app_market_generic.png b/res/drawable-mdpi/app_market_generic.png
deleted file mode 100644
index 6eb5497..0000000
--- a/res/drawable-mdpi/app_market_generic.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/default_widget_preview.9.png b/res/drawable-mdpi/default_widget_preview.9.png
deleted file mode 100644
index ed9c6ee..0000000
--- a/res/drawable-mdpi/default_widget_preview.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/default_widget_preview_holo.9.png b/res/drawable-mdpi/default_widget_preview_holo.9.png
new file mode 100644
index 0000000..d8e1196
--- /dev/null
+++ b/res/drawable-mdpi/default_widget_preview_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/gardening_crosshairs.png b/res/drawable-mdpi/gardening_crosshairs.png
index 338c832..2845fe4 100644
--- a/res/drawable-mdpi/gardening_crosshairs.png
+++ b/res/drawable-mdpi/gardening_crosshairs.png
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_blue_normal_holo.9.png b/res/drawable-mdpi/homescreen_blue_normal_holo.9.png
new file mode 100644
index 0000000..fef82bb
--- /dev/null
+++ b/res/drawable-mdpi/homescreen_blue_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_blue_strong_holo.9.png b/res/drawable-mdpi/homescreen_blue_strong_holo.9.png
new file mode 100644
index 0000000..fdd9dbb
--- /dev/null
+++ b/res/drawable-mdpi/homescreen_blue_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_green_normal_holo.9.png b/res/drawable-mdpi/homescreen_green_normal_holo.9.png
new file mode 100644
index 0000000..dad34d8
--- /dev/null
+++ b/res/drawable-mdpi/homescreen_green_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_green_strong_holo.9.png b/res/drawable-mdpi/homescreen_green_strong_holo.9.png
new file mode 100644
index 0000000..901bf4c
--- /dev/null
+++ b/res/drawable-mdpi/homescreen_green_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_large_blue.9.png b/res/drawable-mdpi/homescreen_large_blue.9.png
deleted file mode 100644
index 5e7e61f..0000000
--- a/res/drawable-mdpi/homescreen_large_blue.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_large_green.9.png b/res/drawable-mdpi/homescreen_large_green.9.png
deleted file mode 100644
index 2f83bac..0000000
--- a/res/drawable-mdpi/homescreen_large_green.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/homescreen_large_green_strong.9.png b/res/drawable-mdpi/homescreen_large_green_strong.9.png
deleted file mode 100644
index 1e14502..0000000
--- a/res/drawable-mdpi/homescreen_large_green_strong.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/hotseat_scrubber_holo.9.png b/res/drawable-mdpi/hotseat_scrubber_holo.9.png
new file mode 100644
index 0000000..8b7e109
--- /dev/null
+++ b/res/drawable-mdpi/hotseat_scrubber_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/hotseat_track_holo.9.png b/res/drawable-mdpi/hotseat_track_holo.9.png
new file mode 100644
index 0000000..a542cb7
--- /dev/null
+++ b/res/drawable-mdpi/hotseat_track_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_delete_holo_dark.png b/res/drawable-mdpi/ic_home_delete_holo_dark.png
deleted file mode 100644
index 647fd80..0000000
--- a/res/drawable-mdpi/ic_home_delete_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_delete_hover_holo_dark.png b/res/drawable-mdpi/ic_home_delete_hover_holo_dark.png
deleted file mode 100644
index 06b62e2..0000000
--- a/res/drawable-mdpi/ic_home_delete_hover_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_info_holo_dark.png b/res/drawable-mdpi/ic_home_info_holo_dark.png
deleted file mode 100644
index c34f443..0000000
--- a/res/drawable-mdpi/ic_home_info_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_info_active_holo.png b/res/drawable-mdpi/ic_launcher_info_active_holo.png
new file mode 100644
index 0000000..d05de74
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_info_active_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_info_normal_holo.png b/res/drawable-mdpi/ic_launcher_info_normal_holo.png
new file mode 100644
index 0000000..6a07cc9
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_info_normal_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_market_holo.png b/res/drawable-mdpi/ic_launcher_market_holo.png
new file mode 100644
index 0000000..cacb374
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_market_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_trashcan_active_holo.png b/res/drawable-mdpi/ic_launcher_trashcan_active_holo.png
new file mode 100644
index 0000000..244fe27
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_trashcan_active_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_trashcan_normal_holo.png b/res/drawable-mdpi/ic_launcher_trashcan_normal_holo.png
new file mode 100644
index 0000000..bd5db08
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_trashcan_normal_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left.9.png b/res/drawable-mdpi/page_hover_left.9.png
deleted file mode 100644
index 5d5e0c8..0000000
--- a/res/drawable-mdpi/page_hover_left.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left_holo.9.png b/res/drawable-mdpi/page_hover_left_holo.9.png
new file mode 100644
index 0000000..b9368fb
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right.9.png b/res/drawable-mdpi/page_hover_right.9.png
deleted file mode 100644
index 1545bfe..0000000
--- a/res/drawable-mdpi/page_hover_right.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right_holo.9.png b/res/drawable-mdpi/page_hover_right_holo.9.png
new file mode 100644
index 0000000..53ba807
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_right_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_container_holo.9.png b/res/drawable-mdpi/portal_container_holo.9.png
index 7eef5d7..56a5b87 100644
--- a/res/drawable-mdpi/portal_container_holo.9.png
+++ b/res/drawable-mdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable/delete_zone_selector.xml b/res/drawable/delete_target_selector.xml
similarity index 83%
rename from res/drawable/delete_zone_selector.xml
rename to res/drawable/delete_target_selector.xml
index e2b37f4..229942e 100644
--- a/res/drawable/delete_zone_selector.xml
+++ b/res/drawable/delete_target_selector.xml
@@ -19,6 +19,6 @@
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_home_delete_holo_dark" />
- <item android:drawable="@drawable/ic_home_delete_hover_holo_dark" />
+ <item android:drawable="@drawable/ic_launcher_trashcan_normal_holo" />
+ <item android:drawable="@drawable/ic_launcher_trashcan_active_holo" />
</transition>
diff --git a/res/drawable/delete_zone_selector.xml b/res/drawable/info_target_selector.xml
similarity index 78%
copy from res/drawable/delete_zone_selector.xml
copy to res/drawable/info_target_selector.xml
index e2b37f4..f3a7016 100644
--- a/res/drawable/delete_zone_selector.xml
+++ b/res/drawable/info_target_selector.xml
@@ -2,7 +2,7 @@
<!--
/*
**
-** Copyright 2007, The Android Open Source Project
+** Copyright 2011, 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.
@@ -19,6 +19,6 @@
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_home_delete_holo_dark" />
- <item android:drawable="@drawable/ic_home_delete_hover_holo_dark" />
+ <item android:drawable="@drawable/ic_launcher_info_normal_holo" />
+ <item android:drawable="@drawable/ic_launcher_info_active_holo" />
</transition>
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 3c5e0df..d2f52c8 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -39,6 +39,14 @@
<include android:id="@+id/cell4" layout="@layout/workspace_screen" />
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
</com.android.launcher2.Workspace>
+
+ <ImageView
+ android:id="@+id/paged_view_indicator_track"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:scaleType="fitXY"
+ android:src="@drawable/hotseat_track_holo" />
<ImageView
android:id="@+id/paged_view_indicator"
android:layout_width="wrap_content"
@@ -47,7 +55,7 @@
android:visibility="gone"
android:alpha="0"
android:scaleType="fitXY"
- android:src="@drawable/paged_view_indicator" />
+ android:src="@drawable/hotseat_scrubber_holo" />
<include layout="@layout/qsb_bar"
android:id="@+id/qsb_bar"
diff --git a/res/layout-large/button_bar.xml b/res/layout-large/button_bar.xml
index a060761..8d7f5df 100644
--- a/res/layout-large/button_bar.xml
+++ b/res/layout-large/button_bar.xml
@@ -136,7 +136,7 @@
android:id="@+id/delete_zone"
android:text="@string/delete_zone_label_workspace"
android:drawablePadding="@dimen/delete_zone_drawable_padding"
- android:drawableLeft="@drawable/delete_zone_selector"
+ android:drawableLeft="@drawable/delete_target_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/configure_button"
diff --git a/res/layout-large/qsb_bar.xml b/res/layout-large/qsb_bar.xml
index 421ace2..b600eda 100644
--- a/res/layout-large/qsb_bar.xml
+++ b/res/layout-large/qsb_bar.xml
@@ -113,7 +113,7 @@
style="@style/DropTargetButton"
android:id="@+id/delete_target_text"
android:text="@string/delete_zone_label_workspace"
- android:drawableLeft="@drawable/delete_zone_selector" />
+ android:drawableLeft="@drawable/delete_target_selector" />
</com.android.launcher2.DeleteDropTarget>
<com.android.launcher2.InfoDropTarget
@@ -125,7 +125,7 @@
style="@style/DropTargetButton"
android:id="@+id/info_target_text"
android:text="@string/info_target_label"
- android:drawableLeft="@drawable/ic_home_info_holo_dark" />
+ android:drawableLeft="@drawable/info_target_selector" />
</com.android.launcher2.InfoDropTarget>
</LinearLayout>
</com.android.launcher2.SearchDropTargetBar>
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index d2b9275..acb3b47 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -37,16 +37,25 @@
<include android:id="@+id/cell4" layout="@layout/workspace_screen" />
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
</com.android.launcher2.Workspace>
+
+ <ImageView
+ android:id="@+id/paged_view_indicator_track"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="@dimen/button_bar_height"
+ android:scaleType="fitXY"
+ android:src="@drawable/hotseat_track_holo" />
<ImageView
android:id="@+id/paged_view_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
+ android:layout_marginBottom="@dimen/button_bar_height"
android:visibility="gone"
- android:paddingBottom="@dimen/button_bar_height"
android:alpha="0"
android:scaleType="fitXY"
- android:src="@drawable/paged_view_indicator" />
+ android:src="@drawable/hotseat_scrubber_holo" />
<include layout="@layout/qsb_bar"
android:id="@+id/qsb_bar"
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index b455153..ecb10ec 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -76,6 +76,13 @@
launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y"
launcher:maxGap="@dimen/workspace_max_gap" />
<ImageView
+ android:id="@+id/paged_view_indicator_track"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:scaleType="fitXY"
+ android:src="@drawable/hotseat_track_holo" />
+ <ImageView
android:id="@+id/paged_view_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -83,7 +90,7 @@
android:visibility="gone"
android:alpha="0"
android:scaleType="fitXY"
- android:src="@drawable/paged_view_indicator" />
+ android:src="@drawable/hotseat_scrubber_holo" />
</FrameLayout>
</LinearLayout>
</com.android.launcher2.AppsCustomizeTabHost>
diff --git a/res/layout/qsb_bar.xml b/res/layout/qsb_bar.xml
index cb97b01..21043b4 100644
--- a/res/layout/qsb_bar.xml
+++ b/res/layout/qsb_bar.xml
@@ -74,7 +74,7 @@
style="@style/DropTargetButton"
android:id="@+id/delete_target_text"
android:text="@string/delete_zone_label_workspace"
- android:drawableLeft="@drawable/delete_zone_selector" />
+ android:drawableLeft="@drawable/delete_target_selector" />
</com.android.launcher2.DeleteDropTarget>
<com.android.launcher2.InfoDropTarget
@@ -86,7 +86,7 @@
style="@style/DropTargetButton"
android:id="@+id/info_target_text"
android:text="@string/info_target_label"
- android:drawableLeft="@drawable/ic_home_info_holo_dark" />
+ android:drawableLeft="@drawable/info_target_selector" />
</com.android.launcher2.InfoDropTarget>
</LinearLayout>
</com.android.launcher2.SearchDropTargetBar>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index fd7b21c..ae73b04 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -20,8 +20,8 @@
<resources>
<!-- The color tints to apply to the text and drag view when hovering
over the delete target or the info target -->
- <color name="delete_target_hover_tint">#D4FF3600</color>
- <color name="info_target_hover_tint">#D40078FF</color>
+ <color name="delete_target_hover_tint">#DAFF0000</color>
+ <color name="info_target_hover_tint">#DA0099CC</color>
<color name="window_background">#FF191919</color>
<color name="grid_dark_background">#EB191919</color>
diff --git a/res/values/config.xml b/res/values/config.xml
index 70ee423..5b73769 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -67,7 +67,7 @@
<integer name="config_dropAnimMaxDuration">400</integer>
<!-- The duration of the UserFolder opening and closing animation -->
- <integer name="config_folderAnimDuration">100</integer>
+ <integer name="config_folderAnimDuration">120</integer>
<!-- The distance at which the animation should take the max duration -->
<integer name="config_dropAnimMaxDist">800</integer>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 35ca3e9..2a4af44 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -204,7 +204,7 @@
// Save the default widget preview background
Resources resources = context.getResources();
- mDefaultWidgetBackground = resources.getDrawable(R.drawable.default_widget_preview);
+ mDefaultWidgetBackground = resources.getDrawable(R.drawable.default_widget_preview_holo);
mAppIconSize = getResources().getDimensionPixelSize(R.dimen.app_icon_size);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, 0, 0);
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 587a3eb..2623586 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -152,6 +152,12 @@
ObjectAnimator anim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f);
anim.setDuration(duration);
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(android.animation.Animator animation) {
+ mAppsCustomizePane.flashScrollingIndicator();
+ }
+ });
anim.start();
}
});
@@ -212,5 +218,7 @@
if (animation != null) {
setLayerType(LAYER_TYPE_NONE, null);
}
+
+ mAppsCustomizePane.flashScrollingIndicator();
}
}
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 99d62ae..a9cdb87 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -163,9 +163,9 @@
final Resources res = getResources();
- mNormalBackground = res.getDrawable(R.drawable.homescreen_large_blue);
- mActiveBackground = res.getDrawable(R.drawable.homescreen_large_green);
- mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_large_green_strong);
+ mNormalBackground = res.getDrawable(R.drawable.homescreen_blue_normal_holo);
+ mActiveBackground = res.getDrawable(R.drawable.homescreen_green_normal_holo);
+ mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_green_strong_holo);
mNormalBackgroundMini = res.getDrawable(R.drawable.homescreen_small_blue);
mNormalGlowBackgroundMini = res.getDrawable(R.drawable.homescreen_small_blue_strong);
diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/android/launcher2/DeleteDropTarget.java
index a30c03e..6e01bc0 100644
--- a/src/com/android/launcher2/DeleteDropTarget.java
+++ b/src/com/android/launcher2/DeleteDropTarget.java
@@ -16,16 +16,14 @@
package com.android.launcher2;
-import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.TransitionDrawable;
import android.util.AttributeSet;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.TextView;
import com.android.launcher.R;
@@ -33,6 +31,7 @@
public class DeleteDropTarget extends ButtonDropTarget {
private TextView mText;
+ private TransitionDrawable mDrawable;
private int mHoverColor = 0xFFFF0000;
public DeleteDropTarget(Context context, AttributeSet attrs) {
@@ -55,8 +54,8 @@
mHoverColor = r.getColor(R.color.delete_target_hover_tint);
mHoverPaint.setColorFilter(new PorterDuffColorFilter(
mHoverColor, PorterDuff.Mode.SRC_ATOP));
- setBackgroundColor(mHoverColor);
- getBackground().setAlpha(0);
+ mDrawable = (TransitionDrawable) mText.getCompoundDrawables()[0];
+ mDrawable.setCrossFadeEnabled(true);
// Remove the text in the Phone UI in landscape
int orientation = getResources().getConfiguration().orientation;
@@ -127,18 +126,13 @@
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha",
- Color.alpha(mHoverColor));
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.startTransition(mTransitionDuration);
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha", 0);
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.resetTransition();
}
public void onDrop(DragObject d) {
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index 0ce153e..d76b902 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -32,6 +32,8 @@
import android.view.View;
import android.view.ViewParent;
import android.view.animation.DecelerateInterpolator;
+import android.view.animation.Interpolator;
+import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -57,8 +59,10 @@
// Variables relating to animation of views after drop
private ValueAnimator mDropAnim = null;
private TimeInterpolator mQuintEaseOutInterpolator = new DecelerateInterpolator(2.5f);
- private int[] mDropViewPos = new int[] { -1, -1 };
private View mDropView = null;
+ private int[] mDropViewPos = new int[2];
+ private float mDropViewScale;
+ private float mDropViewAlpha;
/**
* Used to create a new DragLayer from XML.
@@ -181,17 +185,19 @@
}
}
- public void getViewLocationRelativeToSelf(View v, int[] location) {
- getLocationOnScreen(location);
- int x = location[0];
- int y = location[1];
+ public void getViewRectRelativeToSelf(View v, Rect r) {
+ int[] loc = new int[2];
+ getLocationOnScreen(loc);
+ int x = loc[0];
+ int y = loc[1];
- v.getLocationOnScreen(location);
- int vX = location[0];
- int vY = location[1];
+ v.getLocationOnScreen(loc);
+ int vX = loc[0];
+ int vY = loc[1];
- location[0] = vX - x;
- location[1] = vY - y;
+ int left = vX - x;
+ int top = vY - y;
+ r.set(left, top, left + v.getMeasuredWidth(), top + v.getMeasuredHeight());
}
@Override
@@ -308,55 +314,59 @@
((CellLayoutChildren) child.getParent()).measureChild(child);
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
- int[] loc = new int[2];
- getViewLocationRelativeToSelf(dragView, loc);
+ Rect r = new Rect();
+ getViewRectRelativeToSelf(dragView, r);
int coord[] = new int[2];
coord[0] = lp.x;
coord[1] = lp.y;
getDescendantCoordRelativeToSelf(child, coord);
- final int fromX = loc[0] + (dragView.getWidth() - child.getMeasuredWidth()) / 2;
- final int fromY = loc[1] + (dragView.getHeight() - child.getMeasuredHeight()) / 2;
- final int dx = coord[0] - fromX;
- final int dy = coord[1] - fromY;
-
+ final int fromX = r.left + (dragView.getWidth() - child.getMeasuredWidth()) / 2;
+ final int fromY = r.top + (dragView.getHeight() - child.getMeasuredHeight()) / 2;
child.setVisibility(INVISIBLE);
- animateViewIntoPosition(child, fromX, fromY, dx, dy);
+ animateViewIntoPosition(child, fromX, fromY, coord[0], coord[1]);
}
private void animateViewIntoPosition(final View view, final int fromX, final int fromY,
- final int dX, final int dY) {
+ final int toX, final int toY) {
+ Rect from = new Rect(fromX, fromY, fromX + view.getMeasuredWidth(), fromY + view.getMeasuredHeight());
+ Rect to = new Rect(toX, toY, toX + view.getMeasuredWidth(), toY + view.getMeasuredHeight());
+ animateView(view, from, to, 1f, -1);
+ }
+ public void animateView(final View view, final Rect from, final Rect to,
+ final float finalAlpha, int duration) {
+ animateView(view, from, to, finalAlpha, 1.0f, duration, null, null);
+ }
+
+ public void animateView(final View view, final Rect from, final Rect to, final float finalAlpha,
+ final float finalScale, int duration, final Interpolator motionInterpolator,
+ final Interpolator alphaInterpolator) {
// Calculate the duration of the animation based on the object's distance
- final float dist = (float) Math.sqrt(dX*dX + dY*dY);
+ final float dist = (float) Math.sqrt(Math.pow(to.left - from.left, 2) +
+ Math.pow(to.top - from.top, 2));
final Resources res = getResources();
final float maxDist = (float) res.getInteger(R.integer.config_dropAnimMaxDist);
- int duration = res.getInteger(R.integer.config_dropAnimMaxDuration);
- if (dist < maxDist) {
- duration *= mQuintEaseOutInterpolator.getInterpolation(dist / maxDist);
+
+ // If duration < 0, this is a cue to compute the duration based on the distance
+ if (duration < 0) {
+ duration = res.getInteger(R.integer.config_dropAnimMaxDuration);
+ if (dist < maxDist) {
+ duration *= mQuintEaseOutInterpolator.getInterpolation(dist / maxDist);
+ }
}
if (mDropAnim != null) {
mDropAnim.end();
}
+
+ mDropView = view;
+ final float initialAlpha = view.getAlpha();
mDropAnim = new ValueAnimator();
- mDropAnim.setInterpolator(mQuintEaseOutInterpolator);
-
- // The view is invisible during the animation; we render it manually.
- mDropAnim.addListener(new AnimatorListenerAdapter() {
- public void onAnimationStart(Animator animation) {
- // Set this here so that we don't render it until the animation begins
- mDropView = view;
- }
-
- public void onAnimationEnd(Animator animation) {
- if (mDropView != null) {
- mDropView.setVisibility(View.VISIBLE);
- mDropView = null;
- }
- }
- });
+ if (alphaInterpolator == null || motionInterpolator == null) {
+ mDropAnim.setInterpolator(mQuintEaseOutInterpolator);
+ }
mDropAnim.setDuration(duration);
mDropAnim.setFloatValues(0.0f, 1.0f);
@@ -370,12 +380,27 @@
invalidate(mDropViewPos[0], mDropViewPos[1],
mDropViewPos[0] + width, mDropViewPos[1] + height);
- mDropViewPos[0] = fromX + (int) (percent * dX + 0.5f);
- mDropViewPos[1] = fromY + (int) (percent * dY + 0.5f);
+ float alphaPercent = alphaInterpolator == null ? percent :
+ alphaInterpolator.getInterpolation(percent);
+ float motionPercent = motionInterpolator == null ? percent :
+ motionInterpolator.getInterpolation(percent);
+
+ mDropViewPos[0] = from.left + (int) ((to.left - from.left) * motionPercent);
+ mDropViewPos[1] = from.top + (int) ((to.top - from.top) * motionPercent);
+ mDropViewScale = percent * finalScale + (1 - percent);
+ mDropViewAlpha = alphaPercent * finalAlpha + (1 - alphaPercent) * initialAlpha;
invalidate(mDropViewPos[0], mDropViewPos[1],
mDropViewPos[0] + width, mDropViewPos[1] + height);
}
});
+ mDropAnim.addListener(new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animation) {
+ if (mDropView != null) {
+ mDropView.setVisibility(View.VISIBLE);
+ mDropView = null;
+ }
+ }
+ });
mDropAnim.start();
}
@@ -388,7 +413,12 @@
canvas.save(Canvas.MATRIX_SAVE_FLAG);
final int xPos = mDropViewPos[0] - mDropView.getScrollX();
final int yPos = mDropViewPos[1] - mDropView.getScrollY();
+ int width = mDropView.getMeasuredWidth();
+ int height = mDropView.getMeasuredHeight();
canvas.translate(xPos, yPos);
+ canvas.translate((1 - mDropViewScale) * width / 2, (1 - mDropViewScale) * height / 2);
+ canvas.scale(mDropViewScale, mDropViewScale);
+ mDropView.setAlpha(mDropViewAlpha);
mDropView.draw(canvas);
canvas.restore();
}
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java
index 4cc2c55..d4dc785 100644
--- a/src/com/android/launcher2/DragView.java
+++ b/src/com/android/launcher2/DragView.java
@@ -195,6 +195,16 @@
invalidate();
}
+ @Override
+ public void setAlpha(float alpha) {
+ super.setAlpha(alpha);
+ if (mPaint == null) {
+ mPaint = new Paint();
+ }
+ mPaint.setAlpha((int) (255 * alpha));
+ invalidate();
+ }
+
/**
* Create a window containing this view and show it.
*
@@ -242,7 +252,11 @@
}
void remove() {
- mWindowManager.removeView(this);
+ post(new Runnable() {
+ public void run() {
+ mWindowManager.removeView(DragView.this);
+ }
+ });
}
int[] getPosition(int[] result) {
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 37368b9..13815ad 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -86,6 +86,7 @@
private int mMaxCountX;
private int mMaxCountY;
private Rect mNewSize = new Rect();
+ private Rect mIconRect = new Rect();
private ArrayList<View> mItemsInReadingOrder = new ArrayList<View>();
private Drawable mIconDrawable;
boolean mItemsInvalidated = false;
@@ -134,6 +135,7 @@
if (sHintText == null) {
sHintText = res.getString(R.string.folder_hint_text);
}
+ setLayerType(LAYER_TYPE_HARDWARE, null);
}
@Override
@@ -141,7 +143,6 @@
super.onFinishInflate();
mContent = (CellLayout) findViewById(R.id.folder_content);
mContent.setGridSize(0, 0);
- mContent.enableHardwareLayers();
mFolderName = (TextView) findViewById(R.id.folder_name);
// We find out how tall the text view wants to be (it is set to wrap_content), so that
@@ -372,9 +373,8 @@
* to its associated FolderIcon. This allows for a seamless transition into the expanded state.
*/
private void positionAndSizeAsIcon() {
- if (!(getParent() instanceof CellLayoutChildren)) return;
+ if (!(getParent() instanceof DragLayer)) return;
- DragLayer.LayoutParams iconLp = (DragLayer.LayoutParams) mFolderIcon.getLayoutParams();
DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams();
if (mMode == PARTIAL_GROW) {
@@ -382,19 +382,19 @@
setScaleY(0.8f);
setAlpha(0f);
} else {
- lp.width = iconLp.width;
- lp.height = iconLp.height;
- lp.x = iconLp.x;
- lp.y = iconLp.y;
+ mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mFolderIcon, mIconRect);
+ lp.width = mIconRect.width();
+ lp.height = mIconRect.height();
+ lp.x = mIconRect.left;
+ lp.y = mIconRect.top;
mContent.setAlpha(0);
}
mState = STATE_SMALL;
}
public void animateOpen() {
- if (mState != STATE_SMALL) {
- positionAndSizeAsIcon();
- }
+ positionAndSizeAsIcon();
+
if (!(getParent() instanceof DragLayer)) return;
ObjectAnimator oa;
@@ -449,13 +449,12 @@
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 0.9f);
oa = ObjectAnimator.ofPropertyValuesHolder(this, alpha, scaleX, scaleY);
} else {
- DragLayer.LayoutParams iconLp = (DragLayer.LayoutParams) mFolderIcon.getLayoutParams();
DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams();
- PropertyValuesHolder width = PropertyValuesHolder.ofInt("width", iconLp.width);
- PropertyValuesHolder height = PropertyValuesHolder.ofInt("height", iconLp.height);
- PropertyValuesHolder x = PropertyValuesHolder.ofInt("x",iconLp.x);
- PropertyValuesHolder y = PropertyValuesHolder.ofInt("y", iconLp.y);
+ PropertyValuesHolder width = PropertyValuesHolder.ofInt("width", mIconRect.width());
+ PropertyValuesHolder height = PropertyValuesHolder.ofInt("height", mIconRect.height());
+ PropertyValuesHolder x = PropertyValuesHolder.ofInt("x", mIconRect.left);
+ PropertyValuesHolder y = PropertyValuesHolder.ofInt("y", mIconRect.top);
oa = ObjectAnimator.ofPropertyValuesHolder(lp, width, height, x, y);
oa.addUpdateListener(new AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
@@ -645,14 +644,18 @@
OnAlarmListener mOnExitAlarmListener = new OnAlarmListener() {
public void onAlarm(Alarm alarm) {
- mLauncher.closeFolder();
- mCurrentDragInfo = null;
- mCurrentDragView = null;
- mSuppressOnAdd = false;
- mRearrangeOnClose = true;
+ completeDragExit();
}
};
+ private void completeDragExit() {
+ mLauncher.closeFolder();
+ mCurrentDragInfo = null;
+ mCurrentDragView = null;
+ mSuppressOnAdd = false;
+ mRearrangeOnClose = true;
+ }
+
public void onDragExit(DragObject d) {
// We only close the folder if this is a true drag exit, ie. not because a drop
// has occurred above the folder.
@@ -674,6 +677,11 @@
}
}
// TODO: if the drag fails, we need to re-add the item
+ } else {
+ if (target != this) {
+ mOnExitAlarm.cancelAlarm();
+ completeDragExit();
+ }
}
}
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index bae2fd7..aff8761 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -25,11 +25,14 @@
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
+import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -276,17 +279,30 @@
mFolderRingAnimator.animateToNaturalState();
}
- public void onDrop(Object dragInfo) {
+ public void onDrop(DragObject d) {
ShortcutInfo item;
- if (dragInfo instanceof ApplicationInfo) {
+ if (d.dragInfo instanceof ApplicationInfo) {
// Came from all apps -- make a copy
- item = ((ApplicationInfo) dragInfo).makeShortcut();
+ item = ((ApplicationInfo) d.dragInfo).makeShortcut();
} else {
- item = (ShortcutInfo) dragInfo;
+ item = (ShortcutInfo) d.dragInfo;
}
item.cellX = -1;
item.cellY = -1;
addItem(item);
+ DragLayer dragLayer = mLauncher.getDragLayer();
+ Rect from = new Rect();
+ dragLayer.getViewRectRelativeToSelf(d.dragView, from);
+ Rect to = new Rect();
+ dragLayer.getDescendantRectRelativeToSelf(this, to);
+
+ int previewSize = FolderRingAnimator.sPreviewSize;
+ int vanishingPointX = (int) (previewSize * 0.7);
+ int vanishingPointY = (int) (previewSize * (1 - 0.88f));
+ to.offset(vanishingPointX - previewSize / 2 , vanishingPointY - previewSize / 2);
+
+ dragLayer.animateView(d.dragView, from, to, 0f, 0.2f, 400, new DecelerateInterpolator(2),
+ new AccelerateInterpolator(2));
}
public DropTarget getDropTargetDelegate(DragObject d) {
@@ -323,20 +339,17 @@
float maxPerspectiveShift = baselineSize * PERSPECTIVE_SHIFT_FACTOR;
ArrayList<View> items = mFolder.getItemsInReadingOrder(false);
- int firstItemIndex = Math.max(0, items.size() - NUM_ITEMS_IN_PREVIEW);
int xShift = (mOriginalWidth - 2 * halfAvailableSpace) / 2;
int yShift = previewPadding;
canvas.translate(xShift, yShift);
- for (int i = firstItemIndex; i < items.size(); i++) {
- int index = i - firstItemIndex;
- index += Math.max(0, NUM_ITEMS_IN_PREVIEW - items.size());
+ int nItemsInPreview = Math.min(items.size(), NUM_ITEMS_IN_PREVIEW);
+ for (int i = nItemsInPreview - 1; i >= 0; i--) {
+ int index = NUM_ITEMS_IN_PREVIEW - i - 1;
float r = (index * 1.0f) / (NUM_ITEMS_IN_PREVIEW - 1);
float scale = (1 - PERSPECTIVE_SCALE_FACTOR * (1 - r));
- //r = (float) Math.pow(r, 2);
-
float offset = (1 - r) * maxPerspectiveShift;
float scaledSize = scale * baselineSize;
float scaleOffsetCorrection = (1 - scale) * baselineSize;
diff --git a/src/com/android/launcher2/InfoDropTarget.java b/src/com/android/launcher2/InfoDropTarget.java
index 76a6bf9..c7812e3 100644
--- a/src/com/android/launcher2/InfoDropTarget.java
+++ b/src/com/android/launcher2/InfoDropTarget.java
@@ -16,14 +16,13 @@
package com.android.launcher2;
-import android.animation.ObjectAnimator;
import android.content.ComponentName;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.TransitionDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
@@ -33,6 +32,7 @@
public class InfoDropTarget extends ButtonDropTarget {
private TextView mText;
+ private TransitionDrawable mDrawable;
private int mHoverColor = 0xFF0000FF;
public InfoDropTarget(Context context, AttributeSet attrs) {
@@ -54,8 +54,8 @@
mHoverColor = r.getColor(R.color.info_target_hover_tint);
mHoverPaint.setColorFilter(new PorterDuffColorFilter(
mHoverColor, PorterDuff.Mode.SRC_ATOP));
- setBackgroundColor(mHoverColor);
- getBackground().setAlpha(0);
+ mDrawable = (TransitionDrawable) mText.getCompoundDrawables()[0];
+ mDrawable.setCrossFadeEnabled(true);
// Remove the text in the Phone UI in landscape
int orientation = getResources().getConfiguration().orientation;
@@ -109,17 +109,12 @@
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha",
- Color.alpha(mHoverColor));
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.startTransition(mTransitionDuration);
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
- ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha", 0);
- anim.setDuration(mTransitionDuration);
- anim.start();
+ mDrawable.resetTransition();
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6157401..36ff2b2 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2387,6 +2387,10 @@
toView.setTranslationY(0.0f);
toView.setVisibility(View.VISIBLE);
toView.bringToFront();
+
+ // Hide the workspace scrollbar
+ mWorkspace.hideScrollingIndicator(true);
+ mWorkspace.hideScrollIndicatorTrack();
}
@Override
public void onAnimationEnd(Animator animation) {
@@ -2418,6 +2422,10 @@
if (toView instanceof LauncherTransitionable) {
((LauncherTransitionable) toView).onLauncherTransitionStart(null);
((LauncherTransitionable) toView).onLauncherTransitionEnd(null);
+
+ // Hide the workspace scrollbar
+ mWorkspace.hideScrollingIndicator(true);
+ mWorkspace.hideScrollIndicatorTrack();
}
}
}
@@ -2475,6 +2483,10 @@
fromView.setVisibility(View.GONE);
if (fromView instanceof LauncherTransitionable) {
((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim);
+
+ // Show the workspace scrollbar
+ mWorkspace.showScrollIndicatorTrack();
+ mWorkspace.flashScrollingIndicator();
}
}
});
@@ -2486,6 +2498,10 @@
if (fromView instanceof LauncherTransitionable) {
((LauncherTransitionable) fromView).onLauncherTransitionStart(null);
((LauncherTransitionable) fromView).onLauncherTransitionEnd(null);
+
+ // Show the workspace scrollbar
+ mWorkspace.showScrollIndicatorTrack();
+ mWorkspace.flashScrollingIndicator();
}
}
}
@@ -2779,7 +2795,7 @@
if (activityName != null) {
mAppMarketIntent = intent;
sAppMarketIcon = updateTextButtonWithIconFromExternalActivity(
- R.id.market_button, activityName, R.drawable.app_market_generic);
+ R.id.market_button, activityName, R.drawable.ic_launcher_market_holo);
marketButton.setVisibility(View.VISIBLE);
// Remove the shop icon text in the Phone UI
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 9ca2f90..a90d32f 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -162,10 +162,12 @@
// Scrolling indicator
private ImageView mScrollIndicator;
+ private ImageView mScrollTrack;
private boolean mHasScrollIndicator = true;
private static final int sScrollIndicatorFadeInDuration = 150;
private static final int sScrollIndicatorFastFadeOutDuration = 50;
private static final int sScrollIndicatorFadeOutDuration = 650;
+ private static final int sScrollIndicatorFlashDuration = 650;
// If set, will defer loading associated pages until the scrolling settles
private boolean mDeferLoadAssociatedPagesUntilScrollCompletes;
@@ -1606,8 +1608,6 @@
}
if (mContentIsRefreshable) {
- hideScrollingIndicator(true);
-
// Update all the pages
syncPages();
@@ -1644,6 +1644,16 @@
return true;
}
+ protected void flashScrollingIndicator() {
+ showScrollingIndicator();
+ postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ hideScrollingIndicator(false);
+ }
+ }, sScrollIndicatorFlashDuration);
+ }
+
protected void showScrollingIndicator() {
if (LauncherApplication.isScreenLarge()) return;
if (getChildCount() <= 1) return;
@@ -1651,13 +1661,9 @@
getScrollingIndicator();
if (mScrollIndicator != null) {
- // Update the width of the indicator to the approx. width of each page in the full bar
- mScrollIndicator.getLayoutParams().width = getPageWidthForScrollingIndicator() / getChildCount();
- mScrollIndicator.requestLayout();
-
// Fade the indicator in
updateScrollingIndicatorPosition();
- mScrollIndicator.animate().alpha(1f).setDuration(sScrollIndicatorFadeInDuration);
+ mScrollIndicator.animate().alpha(1f).setDuration(sScrollIndicatorFadeInDuration).start();
}
}
@@ -1671,7 +1677,7 @@
// Fade the indicator out
updateScrollingIndicatorPosition();
mScrollIndicator.animate().alpha(0f).setDuration(immediately ?
- sScrollIndicatorFastFadeOutDuration : sScrollIndicatorFadeOutDuration);
+ sScrollIndicatorFastFadeOutDuration : sScrollIndicatorFadeOutDuration).start();
}
}
@@ -1700,6 +1706,33 @@
int indicatorCenterOffset = indicatorWidth / 2 - mScrollIndicator.getMeasuredWidth() / 2;
int indicatorPos = (int) (offset * pageWidth) + pageOffset + indicatorCenterOffset;
mScrollIndicator.setTranslationX(indicatorPos);
+ mScrollIndicator.invalidate();
+ }
+
+ private ImageView getScrollingIndicatorTrack() {
+ if (mScrollTrack == null) {
+ ViewGroup parent = (ViewGroup) getParent();
+ mScrollTrack = (ImageView) (parent.findViewById(R.id.paged_view_indicator_track));
+ }
+ return mScrollTrack;
+ }
+
+ public void showScrollIndicatorTrack() {
+ if (!LauncherApplication.isScreenLarge()) {
+ getScrollingIndicatorTrack();
+ if (mScrollTrack != null) {
+ mScrollTrack.setVisibility(View.VISIBLE);
+ }
+ }
+ }
+
+ public void hideScrollIndicatorTrack() {
+ if (!LauncherApplication.isScreenLarge()) {
+ getScrollingIndicatorTrack();
+ if (mScrollTrack != null) {
+ mScrollTrack.setVisibility(View.GONE);
+ }
+ }
}
/* Accessibility */
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 5ba9fd7..60b915b 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1240,11 +1240,11 @@
final CellLayout rightPage = (CellLayout) getChildAt(mCurrentPage + 1);
if (leftPage != null && leftPage.getIsDragOverlapping()) {
- final Drawable d = getResources().getDrawable(R.drawable.page_hover_left);
+ final Drawable d = getResources().getDrawable(R.drawable.page_hover_left_holo);
d.setBounds(mScrollX, padding, mScrollX + d.getIntrinsicWidth(), height - padding);
d.draw(canvas);
} else if (rightPage != null && rightPage.getIsDragOverlapping()) {
- final Drawable d = getResources().getDrawable(R.drawable.page_hover_right);
+ final Drawable d = getResources().getDrawable(R.drawable.page_hover_right_holo);
d.setBounds(mScrollX + width - d.getIntrinsicWidth(), padding, mScrollX + width, height - padding);
d.draw(canvas);
}
@@ -1381,9 +1381,6 @@
// Stop any scrolling, move to the current page right away
setCurrentPage((mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage);
- // Hide the scrollbar
- hideScrollingIndicator(true);
-
CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage);
if (currentPage == null) {
Log.w(TAG, "currentPage is NULL! mCurrentPage " + mCurrentPage
@@ -2240,12 +2237,12 @@
}
boolean addToExistingFolderIfNecessary(View newView, CellLayout target, int[] targetCell,
- Object dragInfo, boolean external) {
+ DragObject d, boolean external) {
View dropOverView = target.getChildAt(targetCell[0], targetCell[1]);
if (dropOverView instanceof FolderIcon) {
FolderIcon fi = (FolderIcon) dropOverView;
- if (fi.acceptDrop(dragInfo)) {
- fi.onDrop(dragInfo);
+ if (fi.acceptDrop(d.dragInfo)) {
+ fi.onDrop(d);
// if the drag started here, we need to remove it from the workspace
if (!external) {
@@ -2281,7 +2278,7 @@
if (d.dragSource != this) {
final int[] touchXY = new int[] { (int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1] };
- onDropExternal(touchXY, d.dragInfo, dropTargetLayout, false, d.dragView);
+ onDropExternal(touchXY, d.dragInfo, dropTargetLayout, false, d);
} else if (mDragInfo != null) {
final View cell = mDragInfo.cell;
@@ -2305,8 +2302,7 @@
return;
}
- if (addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell,
- d.dragInfo, false)) {
+ if (addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell, d, false)) {
return;
}
@@ -2936,7 +2932,7 @@
* to add an item to one of the workspace screens.
*/
private void onDropExternal(int[] touchXY, Object dragInfo,
- CellLayout cellLayout, boolean insertAtFirst, DragView dragView) {
+ CellLayout cellLayout, boolean insertAtFirst, DragObject d) {
int screen = indexOfChild(cellLayout);
if (screen != mCurrentPage && mShrinkState != ShrinkState.SPRING_LOADED) {
snapToPage(screen);
@@ -2989,7 +2985,7 @@
if (createUserFolderIfNecessary(view, cellLayout, mTargetCell, true)) {
return;
}
- if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, dragInfo, true)) {
+ if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, d, true)) {
return;
}
}
@@ -3008,13 +3004,13 @@
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
cellLayout.getChildrenLayout().measureChild(view);
- if (dragView != null) {
- mLauncher.getDragLayer().animateViewIntoPosition(dragView, view);
- }
-
LauncherModel.addOrMoveItemInDatabase(mLauncher, info,
LauncherSettings.Favorites.CONTAINER_DESKTOP, screen,
lp.cellX, lp.cellY);
+
+ if (d.dragView != null) {
+ mLauncher.getDragLayer().animateViewIntoPosition(d.dragView, view);
+ }
}
}