Merge "Enable Proguard on Launcher2."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ffedec7..1368236 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -19,8 +19,7 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.launcher2"
- >
+ package="com.android.launcher">
<original-package android:name="com.android.launcher2" />
@@ -62,12 +61,12 @@
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
- android:name="LauncherApplication"
+ android:name="com.android.launcher2.LauncherApplication"
android:label="@string/application_name"
android:icon="@drawable/ic_launcher_home">
<activity
- android:name="Launcher"
+ android:name="com.android.launcher2.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
@@ -83,7 +82,7 @@
</activity>
<activity
- android:name="WallpaperChooser"
+ android:name="com.android.launcher2.WallpaperChooser"
android:label="@string/pick_wallpaper"
android:icon="@drawable/ic_launcher_wallpaper"
android:screenOrientation="nosensor"
@@ -96,7 +95,7 @@
<!-- Intent received used to install shortcuts from other applications -->
<receiver
- android:name=".InstallShortcutReceiver"
+ android:name="com.android.launcher2.InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
@@ -105,7 +104,7 @@
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
- android:name=".UninstallShortcutReceiver"
+ android:name="com.android.launcher2.UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
@@ -114,7 +113,7 @@
<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
- android:name="LauncherProvider"
+ android:name="com.android.launcher2.LauncherProvider"
android:authorities="com.android.launcher2.settings"
android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..b84e1b6
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,49 @@
+# Copyright (C) 2007 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/res/drawable-mdpi/all_apps_button_focused.png b/res/drawable-mdpi/all_apps_button_focused.png
old mode 100644
new mode 100755
index 94f7b08..00c590a
--- a/res/drawable-mdpi/all_apps_button_focused.png
+++ b/res/drawable-mdpi/all_apps_button_focused.png
Binary files differ
diff --git a/res/drawable-mdpi/all_apps_button_normal.png b/res/drawable-mdpi/all_apps_button_normal.png
old mode 100644
new mode 100755
index 188d528..43e48eb
--- a/res/drawable-mdpi/all_apps_button_normal.png
+++ b/res/drawable-mdpi/all_apps_button_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/all_apps_button_pressed.png b/res/drawable-mdpi/all_apps_button_pressed.png
old mode 100644
new mode 100755
index 600dea9..0dd04ae
--- a/res/drawable-mdpi/all_apps_button_pressed.png
+++ b/res/drawable-mdpi/all_apps_button_pressed.png
Binary files differ
diff --git a/res/drawable-mdpi/home_button_focused.png b/res/drawable-mdpi/home_button_focused.png
index 08b1fcb..0eb4a66 100644
--- a/res/drawable-mdpi/home_button_focused.png
+++ b/res/drawable-mdpi/home_button_focused.png
Binary files differ
diff --git a/res/drawable-mdpi/home_button_normal.png b/res/drawable-mdpi/home_button_normal.png
index 4afcce8..0a1c105 100644
--- a/res/drawable-mdpi/home_button_normal.png
+++ b/res/drawable-mdpi/home_button_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/home_button_pressed.png b/res/drawable-mdpi/home_button_pressed.png
index aa91732..d4a0ab4 100644
--- a/res/drawable-mdpi/home_button_pressed.png
+++ b/res/drawable-mdpi/home_button_pressed.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_focus.png b/res/drawable-mdpi/ic_home_arrows_1_focus.png
old mode 100644
new mode 100755
index fd95862..4f0cd67
--- a/res/drawable-mdpi/ic_home_arrows_1_focus.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_focus.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_focus_right.png b/res/drawable-mdpi/ic_home_arrows_1_focus_right.png
old mode 100644
new mode 100755
index 2a7059f..ab68ca0
--- a/res/drawable-mdpi/ic_home_arrows_1_focus_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_focus_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_normal.png b/res/drawable-mdpi/ic_home_arrows_1_normal.png
old mode 100644
new mode 100755
index c72a4bf..c6cd7ac
--- a/res/drawable-mdpi/ic_home_arrows_1_normal.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_normal_right.png b/res/drawable-mdpi/ic_home_arrows_1_normal_right.png
old mode 100644
new mode 100755
index 90819e6..09aecec
--- a/res/drawable-mdpi/ic_home_arrows_1_normal_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_normal_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_press.png b/res/drawable-mdpi/ic_home_arrows_1_press.png
old mode 100644
new mode 100755
index 70011d7..f0856b3
--- a/res/drawable-mdpi/ic_home_arrows_1_press.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_press.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_1_press_right.png b/res/drawable-mdpi/ic_home_arrows_1_press_right.png
old mode 100644
new mode 100755
index 45ea6f8..6de7644
--- a/res/drawable-mdpi/ic_home_arrows_1_press_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_1_press_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_focus.png b/res/drawable-mdpi/ic_home_arrows_2_focus.png
old mode 100644
new mode 100755
index 1f1164a..06b5b9b
--- a/res/drawable-mdpi/ic_home_arrows_2_focus.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_focus.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_focus_right.png b/res/drawable-mdpi/ic_home_arrows_2_focus_right.png
old mode 100644
new mode 100755
index 330ee39..c7cc2ab
--- a/res/drawable-mdpi/ic_home_arrows_2_focus_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_focus_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_normal.png b/res/drawable-mdpi/ic_home_arrows_2_normal.png
old mode 100644
new mode 100755
index dc01737..a9e5ef7
--- a/res/drawable-mdpi/ic_home_arrows_2_normal.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_normal_right.png b/res/drawable-mdpi/ic_home_arrows_2_normal_right.png
old mode 100644
new mode 100755
index dc843c6..3b3f677
--- a/res/drawable-mdpi/ic_home_arrows_2_normal_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_normal_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_press.png b/res/drawable-mdpi/ic_home_arrows_2_press.png
old mode 100644
new mode 100755
index 294b331..2918ba9
--- a/res/drawable-mdpi/ic_home_arrows_2_press.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_press.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_2_press_right.png b/res/drawable-mdpi/ic_home_arrows_2_press_right.png
old mode 100644
new mode 100755
index 4fc9d0f..7b14e5d
--- a/res/drawable-mdpi/ic_home_arrows_2_press_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_2_press_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_focus.png b/res/drawable-mdpi/ic_home_arrows_3_focus.png
old mode 100644
new mode 100755
index 7ada5ca..6353219
--- a/res/drawable-mdpi/ic_home_arrows_3_focus.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_focus.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_focus_right.png b/res/drawable-mdpi/ic_home_arrows_3_focus_right.png
old mode 100644
new mode 100755
index 98d76ef..ae8ef96
--- a/res/drawable-mdpi/ic_home_arrows_3_focus_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_focus_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_normal.png b/res/drawable-mdpi/ic_home_arrows_3_normal.png
old mode 100644
new mode 100755
index 1ee2372..8bfde0e
--- a/res/drawable-mdpi/ic_home_arrows_3_normal.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_normal_right.png b/res/drawable-mdpi/ic_home_arrows_3_normal_right.png
old mode 100644
new mode 100755
index 90a93fa..4375b8b
--- a/res/drawable-mdpi/ic_home_arrows_3_normal_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_normal_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_press.png b/res/drawable-mdpi/ic_home_arrows_3_press.png
old mode 100644
new mode 100755
index 7c98a29..44483a2
--- a/res/drawable-mdpi/ic_home_arrows_3_press.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_press.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_3_press_right.png b/res/drawable-mdpi/ic_home_arrows_3_press_right.png
old mode 100644
new mode 100755
index 5cfd28c..9aa576e
--- a/res/drawable-mdpi/ic_home_arrows_3_press_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_3_press_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_focus.png b/res/drawable-mdpi/ic_home_arrows_4_focus.png
old mode 100644
new mode 100755
index 84f3a7b..45e4f34
--- a/res/drawable-mdpi/ic_home_arrows_4_focus.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_focus.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_focus_right.png b/res/drawable-mdpi/ic_home_arrows_4_focus_right.png
old mode 100644
new mode 100755
index 813f863..a1806db
--- a/res/drawable-mdpi/ic_home_arrows_4_focus_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_focus_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_normal.png b/res/drawable-mdpi/ic_home_arrows_4_normal.png
old mode 100644
new mode 100755
index 477f725..eab4aae
--- a/res/drawable-mdpi/ic_home_arrows_4_normal.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_normal_right.png b/res/drawable-mdpi/ic_home_arrows_4_normal_right.png
old mode 100644
new mode 100755
index f8a8612..9e885ac
--- a/res/drawable-mdpi/ic_home_arrows_4_normal_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_normal_right.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_press.png b/res/drawable-mdpi/ic_home_arrows_4_press.png
old mode 100644
new mode 100755
index 7b8f207..e8283a8
--- a/res/drawable-mdpi/ic_home_arrows_4_press.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_press.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_arrows_4_press_right.png b/res/drawable-mdpi/ic_home_arrows_4_press_right.png
old mode 100644
new mode 100755
index 4d9c2ca..0be086e
--- a/res/drawable-mdpi/ic_home_arrows_4_press_right.png
+++ b/res/drawable-mdpi/ic_home_arrows_4_press_right.png
Binary files differ
diff --git a/res/drawable-mdpi/trashcan.png b/res/drawable-mdpi/trashcan.png
old mode 100644
new mode 100755
index d356f45..54ba1a7
--- a/res/drawable-mdpi/trashcan.png
+++ b/res/drawable-mdpi/trashcan.png
Binary files differ
diff --git a/res/drawable-mdpi/trashcan_hover.png b/res/drawable-mdpi/trashcan_hover.png
old mode 100644
new mode 100755
index 7dda19e..fbffc9b
--- a/res/drawable-mdpi/trashcan_hover.png
+++ b/res/drawable-mdpi/trashcan_hover.png
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_beach.jpg b/res/drawable-mdpi/wallpaper_beach.jpg
new file mode 100644
index 0000000..b502092
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_beach.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_beach_small.jpg b/res/drawable-mdpi/wallpaper_beach_small.jpg
new file mode 100644
index 0000000..46051cc
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_beach_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_blue.jpg b/res/drawable-mdpi/wallpaper_blue.jpg
new file mode 100644
index 0000000..0edd6bd
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_blue.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_blue_small.jpg b/res/drawable-mdpi/wallpaper_blue_small.jpg
new file mode 100644
index 0000000..5cf585a
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_blue_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_bluedotgrid.jpg b/res/drawable-mdpi/wallpaper_bluedotgrid.jpg
deleted file mode 100644
index 468edfe..0000000
--- a/res/drawable-mdpi/wallpaper_bluedotgrid.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_bluedotgrid_small.jpg b/res/drawable-mdpi/wallpaper_bluedotgrid_small.jpg
deleted file mode 100644
index 1ff9568..0000000
--- a/res/drawable-mdpi/wallpaper_bluedotgrid_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_brown.jpg b/res/drawable-mdpi/wallpaper_brown.jpg
deleted file mode 100644
index 9b7ef20..0000000
--- a/res/drawable-mdpi/wallpaper_brown.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_brown_small.jpg b/res/drawable-mdpi/wallpaper_brown_small.jpg
deleted file mode 100644
index e5b417e..0000000
--- a/res/drawable-mdpi/wallpaper_brown_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_canyon.jpg b/res/drawable-mdpi/wallpaper_canyon.jpg
deleted file mode 100644
index 1b129fd..0000000
--- a/res/drawable-mdpi/wallpaper_canyon.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_canyon_small.jpg b/res/drawable-mdpi/wallpaper_canyon_small.jpg
deleted file mode 100644
index fd4d72f..0000000
--- a/res/drawable-mdpi/wallpaper_canyon_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_cloud.jpg b/res/drawable-mdpi/wallpaper_cloud.jpg
deleted file mode 100644
index f3b5545..0000000
--- a/res/drawable-mdpi/wallpaper_cloud.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_cloud_small.jpg b/res/drawable-mdpi/wallpaper_cloud_small.jpg
deleted file mode 100644
index 0e4c14c..0000000
--- a/res/drawable-mdpi/wallpaper_cloud_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_desert.jpg b/res/drawable-mdpi/wallpaper_desert.jpg
deleted file mode 100644
index 47daa79..0000000
--- a/res/drawable-mdpi/wallpaper_desert.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_desert_small.jpg b/res/drawable-mdpi/wallpaper_desert_small.jpg
deleted file mode 100644
index 9252d36..0000000
--- a/res/drawable-mdpi/wallpaper_desert_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_despair.jpg b/res/drawable-mdpi/wallpaper_despair.jpg
deleted file mode 100644
index 57e8235..0000000
--- a/res/drawable-mdpi/wallpaper_despair.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_despair_small.jpg b/res/drawable-mdpi/wallpaper_despair_small.jpg
deleted file mode 100644
index fc8e3c6..0000000
--- a/res/drawable-mdpi/wallpaper_despair_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_electric.jpg b/res/drawable-mdpi/wallpaper_electric.jpg
deleted file mode 100644
index f7800af..0000000
--- a/res/drawable-mdpi/wallpaper_electric.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_electric_small.jpg b/res/drawable-mdpi/wallpaper_electric_small.jpg
deleted file mode 100644
index 66dd573..0000000
--- a/res/drawable-mdpi/wallpaper_electric_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_field.jpg b/res/drawable-mdpi/wallpaper_field.jpg
deleted file mode 100644
index 5bab9b5..0000000
--- a/res/drawable-mdpi/wallpaper_field.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_field_small.jpg b/res/drawable-mdpi/wallpaper_field_small.jpg
deleted file mode 100644
index 20d9a48..0000000
--- a/res/drawable-mdpi/wallpaper_field_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_galaxy.jpg b/res/drawable-mdpi/wallpaper_galaxy.jpg
deleted file mode 100644
index de0f3ff..0000000
--- a/res/drawable-mdpi/wallpaper_galaxy.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_galaxy_small.jpg b/res/drawable-mdpi/wallpaper_galaxy_small.jpg
deleted file mode 100644
index 69d48a2..0000000
--- a/res/drawable-mdpi/wallpaper_galaxy_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_goldengate.jpg b/res/drawable-mdpi/wallpaper_goldengate.jpg
deleted file mode 100644
index 2271091..0000000
--- a/res/drawable-mdpi/wallpaper_goldengate.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_goldengate_small.jpg b/res/drawable-mdpi/wallpaper_goldengate_small.jpg
deleted file mode 100644
index e9aca1e..0000000
--- a/res/drawable-mdpi/wallpaper_goldengate_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grass.jpg b/res/drawable-mdpi/wallpaper_grass.jpg
deleted file mode 100644
index e9dc541..0000000
--- a/res/drawable-mdpi/wallpaper_grass.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grass_night.jpg b/res/drawable-mdpi/wallpaper_grass_night.jpg
deleted file mode 100644
index b9c74c9..0000000
--- a/res/drawable-mdpi/wallpaper_grass_night.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grass_night_small.jpg b/res/drawable-mdpi/wallpaper_grass_night_small.jpg
deleted file mode 100644
index 353eb18..0000000
--- a/res/drawable-mdpi/wallpaper_grass_night_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grass_small.jpg b/res/drawable-mdpi/wallpaper_grass_small.jpg
deleted file mode 100644
index dc45738..0000000
--- a/res/drawable-mdpi/wallpaper_grass_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_gray.jpg b/res/drawable-mdpi/wallpaper_gray.jpg
deleted file mode 100644
index 913f053..0000000
--- a/res/drawable-mdpi/wallpaper_gray.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_gray_small.jpg b/res/drawable-mdpi/wallpaper_gray_small.jpg
deleted file mode 100644
index d083a74..0000000
--- a/res/drawable-mdpi/wallpaper_gray_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_green.jpg b/res/drawable-mdpi/wallpaper_green.jpg
new file mode 100644
index 0000000..36c9e08
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_green.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_green_small.jpg b/res/drawable-mdpi/wallpaper_green_small.jpg
new file mode 100644
index 0000000..d7c28ec
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_green_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_greengray.jpg b/res/drawable-mdpi/wallpaper_greengray.jpg
deleted file mode 100644
index 1f3c86c..0000000
--- a/res/drawable-mdpi/wallpaper_greengray.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_greengray_small.jpg b/res/drawable-mdpi/wallpaper_greengray_small.jpg
deleted file mode 100644
index ebf7066..0000000
--- a/res/drawable-mdpi/wallpaper_greengray_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grey.jpg b/res/drawable-mdpi/wallpaper_grey.jpg
new file mode 100644
index 0000000..ca48e6a
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_grey.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_grey_small.jpg b/res/drawable-mdpi/wallpaper_grey_small.jpg
new file mode 100644
index 0000000..1734d2e
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_grey_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_hazybluedots.jpg b/res/drawable-mdpi/wallpaper_hazybluedots.jpg
deleted file mode 100644
index fe6aeb4..0000000
--- a/res/drawable-mdpi/wallpaper_hazybluedots.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_hazybluedots_small.jpg b/res/drawable-mdpi/wallpaper_hazybluedots_small.jpg
deleted file mode 100644
index c645dea..0000000
--- a/res/drawable-mdpi/wallpaper_hazybluedots_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_jellyfish.jpg b/res/drawable-mdpi/wallpaper_jellyfish.jpg
new file mode 100644
index 0000000..659228b
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_jellyfish.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_jellyfish_small.jpg b/res/drawable-mdpi/wallpaper_jellyfish_small.jpg
new file mode 100644
index 0000000..4e5d134
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_jellyfish_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_lake.jpg b/res/drawable-mdpi/wallpaper_lake.jpg
new file mode 100644
index 0000000..5ba522f
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_lake.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_lake_small.jpg b/res/drawable-mdpi/wallpaper_lake_small.jpg
new file mode 100644
index 0000000..36d56cc
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_lake_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_lightgrad.jpg b/res/drawable-mdpi/wallpaper_lightgrad.jpg
deleted file mode 100644
index 35a45fa..0000000
--- a/res/drawable-mdpi/wallpaper_lightgrad.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_lightgrad_small.jpg b/res/drawable-mdpi/wallpaper_lightgrad_small.jpg
deleted file mode 100644
index f909da7..0000000
--- a/res/drawable-mdpi/wallpaper_lightgrad_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_monumentvalley.jpg b/res/drawable-mdpi/wallpaper_monumentvalley.jpg
deleted file mode 100644
index 1bb5f2c..0000000
--- a/res/drawable-mdpi/wallpaper_monumentvalley.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_monumentvalley_small.jpg b/res/drawable-mdpi/wallpaper_monumentvalley_small.jpg
deleted file mode 100644
index 9ea3309..0000000
--- a/res/drawable-mdpi/wallpaper_monumentvalley_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_mountain.jpg b/res/drawable-mdpi/wallpaper_mountain.jpg
new file mode 100644
index 0000000..1376177
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_mountain.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_mountain_small.jpg b/res/drawable-mdpi/wallpaper_mountain_small.jpg
new file mode 100644
index 0000000..e2d5ac2
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_mountain_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexuspattern.jpg b/res/drawable-mdpi/wallpaper_nexuspattern.jpg
deleted file mode 100644
index 212a7b1..0000000
--- a/res/drawable-mdpi/wallpaper_nexuspattern.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexuspattern_small.jpg b/res/drawable-mdpi/wallpaper_nexuspattern_small.jpg
deleted file mode 100644
index 8e474a5..0000000
--- a/res/drawable-mdpi/wallpaper_nexuspattern_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexusrain.jpg b/res/drawable-mdpi/wallpaper_nexusrain.jpg
deleted file mode 100644
index 46c2971..0000000
--- a/res/drawable-mdpi/wallpaper_nexusrain.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexusrain_small.jpg b/res/drawable-mdpi/wallpaper_nexusrain_small.jpg
deleted file mode 100644
index a239339..0000000
--- a/res/drawable-mdpi/wallpaper_nexusrain_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexuswallpaper1.png b/res/drawable-mdpi/wallpaper_nexuswallpaper1.png
deleted file mode 100644
index 2856da0..0000000
--- a/res/drawable-mdpi/wallpaper_nexuswallpaper1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexuswallpaper1_small.jpg b/res/drawable-mdpi/wallpaper_nexuswallpaper1_small.jpg
deleted file mode 100644
index 70882bb..0000000
--- a/res/drawable-mdpi/wallpaper_nexuswallpaper1_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_path.jpg b/res/drawable-mdpi/wallpaper_path.jpg
new file mode 100644
index 0000000..e1c98c0
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_path.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_path_small.jpg b/res/drawable-mdpi/wallpaper_path_small.jpg
new file mode 100644
index 0000000..f47d7a7
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_path_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_pcut.jpg b/res/drawable-mdpi/wallpaper_pcut.jpg
deleted file mode 100644
index bb9914d..0000000
--- a/res/drawable-mdpi/wallpaper_pcut.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_pcut_small.jpg b/res/drawable-mdpi/wallpaper_pcut_small.jpg
deleted file mode 100644
index bd19775..0000000
--- a/res/drawable-mdpi/wallpaper_pcut_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_pink.jpg b/res/drawable-mdpi/wallpaper_pink.jpg
new file mode 100644
index 0000000..74403e5
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_pink.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_pink_small.jpg b/res/drawable-mdpi/wallpaper_pink_small.jpg
new file mode 100644
index 0000000..42b1770
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_pink_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_road.jpg b/res/drawable-mdpi/wallpaper_road.jpg
new file mode 100644
index 0000000..3aaa639
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_road.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_road_small.jpg b/res/drawable-mdpi/wallpaper_road_small.jpg
new file mode 100644
index 0000000..0b0c390
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_road_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_ropelights.jpg b/res/drawable-mdpi/wallpaper_ropelights.jpg
deleted file mode 100644
index ca7862f..0000000
--- a/res/drawable-mdpi/wallpaper_ropelights.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_ropelights_small.jpg b/res/drawable-mdpi/wallpaper_ropelights_small.jpg
deleted file mode 100644
index ac6fb29..0000000
--- a/res/drawable-mdpi/wallpaper_ropelights_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_snow_leopard.jpg b/res/drawable-mdpi/wallpaper_snow_leopard.jpg
new file mode 100644
index 0000000..bcbc51e
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_snow_leopard.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_snow_leopard_small.jpg b/res/drawable-mdpi/wallpaper_snow_leopard_small.jpg
new file mode 100644
index 0000000..99db5c6
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_snow_leopard_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_sunrise.jpg b/res/drawable-mdpi/wallpaper_sunrise.jpg
new file mode 100644
index 0000000..4ee8d5d
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_sunrise.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_sunrise_small.jpg b/res/drawable-mdpi/wallpaper_sunrise_small.jpg
new file mode 100644
index 0000000..248b7e7
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_sunrise_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_sunset.jpg b/res/drawable-mdpi/wallpaper_sunset.jpg
new file mode 100644
index 0000000..bcfd8d4
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_sunset.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_sunset_small.jpg b/res/drawable-mdpi/wallpaper_sunset_small.jpg
new file mode 100644
index 0000000..d5e5add
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_sunset_small.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_tree.jpg b/res/drawable-mdpi/wallpaper_tree.jpg
deleted file mode 100644
index f998bea..0000000
--- a/res/drawable-mdpi/wallpaper_tree.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_tree_small.jpg b/res/drawable-mdpi/wallpaper_tree_small.jpg
deleted file mode 100644
index 425305a..0000000
--- a/res/drawable-mdpi/wallpaper_tree_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_x67.jpg b/res/drawable-mdpi/wallpaper_x67.jpg
deleted file mode 100644
index 400aa27..0000000
--- a/res/drawable-mdpi/wallpaper_x67.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_x67_small.jpg b/res/drawable-mdpi/wallpaper_x67_small.jpg
deleted file mode 100644
index 10e0faa..0000000
--- a/res/drawable-mdpi/wallpaper_x67_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_zanzibar.jpg b/res/drawable-mdpi/wallpaper_zanzibar.jpg
index 9218895..fb13374 100644
--- a/res/drawable-mdpi/wallpaper_zanzibar.jpg
+++ b/res/drawable-mdpi/wallpaper_zanzibar.jpg
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_zanzibar_small.jpg b/res/drawable-mdpi/wallpaper_zanzibar_small.jpg
index affdc8c..700a7fe 100644
--- a/res/drawable-mdpi/wallpaper_zanzibar_small.jpg
+++ b/res/drawable-mdpi/wallpaper_zanzibar_small.jpg
Binary files differ
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index bfb54aa..d3ab7f5 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
android:layout_width="match_parent"
diff --git a/res/layout-land/workspace_screen.xml b/res/layout-land/workspace_screen.xml
index a58ea07..315e68b 100644
--- a/res/layout-land/workspace_screen.xml
+++ b/res/layout-land/workspace_screen.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.CellLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index a758a0d..de6998d 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
android:layout_width="match_parent"
diff --git a/res/layout-port/workspace_screen.xml b/res/layout-port/workspace_screen.xml
index 4929c2f..96df91b 100644
--- a/res/layout-port/workspace_screen.xml
+++ b/res/layout-port/workspace_screen.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.CellLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index 7975df4..fadf736 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -14,20 +14,7 @@
limitations under the License.
-->
-<!-- Replace with AllAppsView to use 2D version -->
-<com.android.launcher2.AllApps3D
- xmlns:android="http://schemas.android.com/apk/res/android"
-
- android:id="@+id/all_apps_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
-
- android:scrollbarStyle="outsideInset"
- android:drawSelectorOnTop="false"
- android:listSelector="@drawable/grid_selector"
- android:verticalSpacing="10dip"
- android:numColumns="4"
- android:fadingEdgeLength="20dip"
- android:padding="2dip"
- android:cacheColorHint="#FF000000"
- />
+<!-- switch to all_apps_3d on devices that support RenderScript -->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include layout="@layout/all_apps_2d" />
+</merge>
diff --git a/res/layout/all_apps_2d.xml b/res/layout/all_apps_2d.xml
new file mode 100644
index 0000000..f22b8ea
--- /dev/null
+++ b/res/layout/all_apps_2d.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<!-- Sapphire gets 2D all apps view -->
+<com.android.launcher2.AllApps2D
+ xmlns:android="http://schemas.android.com/apk/res/android"
+
+ android:id="@+id/all_apps_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="2dip"
+
+ >
+ <GridView android:id="@+id/all_apps_2d_grid"
+ android:tag="all_apps_2d_grid"
+ android:scrollbars="none"
+ android:drawSelectorOnTop="false"
+ android:listSelector="@drawable/grid_selector"
+ android:verticalSpacing="10dip"
+ android:numColumns="4"
+ android:fadingEdgeLength="48dip"
+ android:cacheColorHint="#FF000000"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentBottom="true"
+ android:layout_marginBottom="24dip"
+ android:layout_marginTop="8dip"
+ android:nextFocusDown="@+id/all_apps_2d_home"
+ />
+
+ <ImageButton android:id="@+id/all_apps_2d_home"
+ android:tag="all_apps_2d_home"
+ android:src="@drawable/home_button"
+ android:background="#00000000"
+ android:layout_centerHorizontal="true"
+ android:layout_alignParentBottom="true"
+ android:layout_width="wrap_content"
+ android:layout_height="64dip"
+ android:nextFocusUp="@+id/all_apps_2d_grid"
+ />
+
+</com.android.launcher2.AllApps2D>
diff --git a/res/layout/all_apps_3d.xml b/res/layout/all_apps_3d.xml
new file mode 100644
index 0000000..7975df4
--- /dev/null
+++ b/res/layout/all_apps_3d.xml
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<!-- Replace with AllAppsView to use 2D version -->
+<com.android.launcher2.AllApps3D
+ xmlns:android="http://schemas.android.com/apk/res/android"
+
+ android:id="@+id/all_apps_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+
+ android:scrollbarStyle="outsideInset"
+ android:drawSelectorOnTop="false"
+ android:listSelector="@drawable/grid_selector"
+ android:verticalSpacing="10dip"
+ android:numColumns="4"
+ android:fadingEdgeLength="20dip"
+ android:padding="2dip"
+ android:cacheColorHint="#FF000000"
+ />
diff --git a/res/raw/allapps.rs b/res/raw/allapps.rs
index 4f6e284..312800f 100644
--- a/res/raw/allapps.rs
+++ b/res/raw/allapps.rs
@@ -370,9 +370,9 @@
} else {
g_Zoom += dz;
}
- g_Animation = powf(1-g_Zoom, 3);
updateReadback();
}
+ g_Animation = powf(1-g_Zoom, 3);
// Set clear value to dim the background based on the zoom position.
if ((g_Zoom < 0.001f) && (state->zoomTarget < 0.001f) && !g_SpecialHWWar) {
diff --git a/res/values-mdpi/wallpapers.xml b/res/values-mdpi/wallpapers.xml
new file mode 100644
index 0000000..33039b0
--- /dev/null
+++ b/res/values-mdpi/wallpapers.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2009 Google Inc.
+ *
+ * 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>
+ <string-array name="wallpapers" translatable="false">
+ <item>wallpaper_lake</item>
+ <item>wallpaper_sunset</item>
+ <item>wallpaper_beach</item>
+ <item>wallpaper_snow_leopard</item>
+ <item>wallpaper_path</item>
+ <item>wallpaper_sunrise</item>
+ <item>wallpaper_mountain</item>
+ <item>wallpaper_road</item>
+ <item>wallpaper_jellyfish</item>
+ <item>wallpaper_zanzibar</item>
+ <item>wallpaper_blue</item>
+ <item>wallpaper_grey</item>
+ <item>wallpaper_green</item>
+ <item>wallpaper_pink</item>
+ </string-array>
+</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 56717e9..3057f2b 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -1,4 +1,4 @@
<resources>
- <integer name="config_allAppsFadeInTime">1000</integer>
+ <integer name="config_allAppsFadeInTime">700</integer>
<integer name="config_allAppsFadeOutTime">250</integer>
</resources>
diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml
index 4213d36..f33d8c3 100644
--- a/res/xml/default_workspace.xml
+++ b/res/xml/default_workspace.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2">
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
<!-- Left screen [1] -->
<favorite
diff --git a/src/com/android/launcher2/AddAdapter.java b/src/com/android/launcher2/AddAdapter.java
index 77f1f55..24c31ff 100644
--- a/src/com/android/launcher2/AddAdapter.java
+++ b/src/com/android/launcher2/AddAdapter.java
@@ -27,6 +27,8 @@
import java.util.ArrayList;
+import com.android.launcher.R;
+
/**
* Adapter showing the types of items that can be added to a {@link Workspace}.
*/
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java
index 55eb217..1262880 100644
--- a/src/com/android/launcher2/AllApps2D.java
+++ b/src/com/android/launcher2/AllApps2D.java
@@ -19,26 +19,15 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.PixelFormat;
-import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
-import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.ViewGroup;
-import android.view.MotionEvent;
import android.view.LayoutInflater;
-import android.view.SoundEffectConstants;
-import android.view.SurfaceHolder;
-import android.view.VelocityTracker;
import android.view.View;
-import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.ViewConfiguration;
-import android.view.accessibility.AccessibilityEvent;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.TextView;
@@ -47,10 +36,9 @@
import android.widget.RelativeLayout;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
+import com.android.launcher.R;
public class AllApps2D
extends RelativeLayout
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java
index acf75e1..f571eff 100644
--- a/src/com/android/launcher2/AllApps3D.java
+++ b/src/com/android/launcher2/AllApps3D.java
@@ -23,9 +23,7 @@
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.graphics.Rect;
-import android.os.SystemClock;
import android.renderscript.Allocation;
-import android.renderscript.Dimension;
import android.renderscript.Element;
import android.renderscript.ProgramFragment;
import android.renderscript.ProgramStore;
@@ -39,6 +37,7 @@
import android.renderscript.SimpleMesh;
import android.renderscript.Type;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -52,8 +51,8 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
+import com.android.launcher.R;
public class AllApps3D extends RSSurfaceView
implements AllAppsView, View.OnClickListener, View.OnLongClickListener, DragSource {
@@ -100,21 +99,21 @@
* One of the SELECTION_ constants.
*/
private int mLastSelection;
-
+
/**
* Used to keep track of the selection when AllAppsView loses window focus
*/
private int mLastSelectedIcon;
-
+
private VelocityTracker mVelocityTracker;
private int mTouchTracking;
private int mMotionDownRawX;
private int mMotionDownRawY;
private int mDownIconIndex = -1;
private int mCurrentIconIndex = -1;
-
+
private boolean mShouldGainFocus;
-
+
private boolean mHaveSurface = false;
private boolean mZoomDirty = false;
private boolean mAnimateNextZoom;
@@ -123,26 +122,33 @@
private float mPosX;
private float mVelocity;
private AAMessage mMessageProc;
-
+
+ private int mColumnsPerPage;
+ private int mRowsPerPage;
+
+ @SuppressWarnings({"UnusedDeclaration"})
static class Defines {
public static final int ALLOC_PARAMS = 0;
public static final int ALLOC_STATE = 1;
public static final int ALLOC_ICON_IDS = 3;
public static final int ALLOC_LABEL_IDS = 4;
public static final int ALLOC_VP_CONSTANTS = 5;
-
- public static final int COLUMNS_PER_PAGE = 4;
- public static final int ROWS_PER_PAGE = 4;
-
+
+ public static final int COLUMNS_PER_PAGE_PORTRAIT = 4;
+ public static final int ROWS_PER_PAGE_PORTRAIT = 4;
+
+ public static final int COLUMNS_PER_PAGE_LANDSCAPE = 6;
+ public static final int ROWS_PER_PAGE_LANDSCAPE = 3;
+
public static final int ICON_WIDTH_PX = 64;
public static final int ICON_TEXTURE_WIDTH_PX = 74;
public static final int SELECTION_TEXTURE_WIDTH_PX = 74 + 20;
-
+
public static final int ICON_HEIGHT_PX = 64;
public static final int ICON_TEXTURE_HEIGHT_PX = 74;
public static final int SELECTION_TEXTURE_HEIGHT_PX = 74 + 20;
}
-
+
public AllApps3D(Context context, AttributeSet attrs) {
super(context, attrs);
setFocusable(true);
@@ -151,15 +157,27 @@
final ViewConfiguration config = ViewConfiguration.get(context);
mSlop = config.getScaledTouchSlop();
mMaxFlingVelocity = config.getScaledMaximumFlingVelocity();
-
+
setOnClickListener(this);
setOnLongClickListener(this);
setZOrderOnTop(true);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
-
+
mRS = createRenderScript(true);
+
+ final DisplayMetrics metrics = getResources().getDisplayMetrics();
+ final boolean isPortrait = metrics.widthPixels < metrics.heightPixels;
+ mColumnsPerPage = isPortrait ? Defines.COLUMNS_PER_PAGE_PORTRAIT :
+ Defines.COLUMNS_PER_PAGE_LANDSCAPE;
+ mRowsPerPage = isPortrait ? Defines.ROWS_PER_PAGE_PORTRAIT :
+ Defines.ROWS_PER_PAGE_LANDSCAPE;
}
-
+
+ @SuppressWarnings({"UnusedDeclaration"})
+ public AllApps3D(Context context, AttributeSet attrs, int defStyle) {
+ this(context, attrs);
+ }
+
/**
* Note that this implementation prohibits this view from ever being reattached.
*/
@@ -169,7 +187,7 @@
mRS.mMessageCallback = null;
mRS = null;
}
-
+
/**
* If you have an attached click listener, View always plays the click sound!?!?
* Deal with sound effects by hand.
@@ -180,15 +198,11 @@
playSoundEffect(sound);
setSoundEffectsEnabled(old);
}
-
- public AllApps3D(Context context, AttributeSet attrs, int defStyle) {
- this(context, attrs);
- }
-
+
public void setLauncher(Launcher launcher) {
mLauncher = launcher;
}
-
+
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
super.surfaceDestroyed(holder);
@@ -199,15 +213,15 @@
mZoomDirty = true;
mHaveSurface = false;
}
-
+
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
//long startTime = SystemClock.uptimeMillis();
-
+
super.surfaceChanged(holder, format, w, h);
-
+
mHaveSurface = true;
-
+
if (mRollo == null) {
mRollo = new RolloRS();
mRollo.init(getResources(), w, h);
@@ -221,15 +235,11 @@
}
mRollo.dirtyCheck();
mRollo.resize(w, h);
-
+
if (mRS != null) {
mRS.mMessageCallback = mMessageProc = new AAMessage();
}
-
- Resources res = getContext().getResources();
- int barHeight = (int)res.getDimension(R.dimen.button_bar_height);
-
-
+
if (mRollo.mUniformAlloc != null) {
float tf[] = new float[] {72.f, 72.f,
120.f, 120.f, 0.f, 0.f,
@@ -242,14 +252,14 @@
tf[10] = -((float)w / 2) - 0.25f;
tf[11] = -((float)h / 2) - 0.25f;
}
-
+
mRollo.mUniformAlloc.data(tf);
}
-
+
//long endTime = SystemClock.uptimeMillis();
//Log.d(TAG, "surfaceChanged took " + (endTime-startTime) + "ms");
}
-
+
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
@@ -260,20 +270,20 @@
mRollo.setHomeSelected(SELECTED_NONE);
mRollo.clearSelectedIcon();
mRollo.mState.save();
- } else if (hasWindowFocus) {
+ } else {
if (mRollo.mState.iconCount > 0) {
if (mLastSelection == SELECTION_ICONS) {
int selection = mLastSelectedIcon;
final int firstIcon = Math.round(mPosX) *
- Defines.COLUMNS_PER_PAGE;
+ mColumnsPerPage;
if (selection < 0 || // No selection
selection < firstIcon || // off the top of the screen
selection >= mRollo.mState.iconCount || // past last icon
selection >= firstIcon + // past last icon on screen
- (Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE)) {
+ (mColumnsPerPage * mRowsPerPage)) {
selection = firstIcon;
}
-
+
// Select the first icon when we gain window focus
mRollo.selectIcon(selection, SELECTED_FOCUSED);
mRollo.mState.save();
@@ -285,15 +295,15 @@
}
}
}
-
+
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
-
+
if (!isVisible()) {
return;
}
-
+
if (gainFocus) {
if (mRollo != null) {
gainFocus();
@@ -314,27 +324,27 @@
}
}
}
-
+
private void gainFocus() {
if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
// Select the first icon when we gain keyboard focus
mArrowNavigation = true;
- mRollo.selectIcon(Math.round(mPosX) * Defines.COLUMNS_PER_PAGE,
+ mRollo.selectIcon(Math.round(mPosX) * mColumnsPerPage,
SELECTED_FOCUSED);
mRollo.mState.save();
}
}
-
+
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
-
+
boolean handled = false;
-
+
if (!isVisible()) {
return false;
}
final int iconCount = mRollo.mState.iconCount;
-
+
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) {
if (mArrowNavigation) {
if (mLastSelection == SELECTION_HOME) {
@@ -350,36 +360,36 @@
}
}
}
-
+
if (iconCount > 0) {
mArrowNavigation = true;
-
+
int currentSelection = mRollo.mState.selectedIconIndex;
int currentTopRow = Math.round(mPosX);
-
- // The column of the current selection, in the range 0..COLUMNS_PER_PAGE-1
- final int currentPageCol = currentSelection % Defines.COLUMNS_PER_PAGE;
-
- // The row of the current selection, in the range 0..ROWS_PER_PAGE-1
- final int currentPageRow = (currentSelection - (currentTopRow*Defines.COLUMNS_PER_PAGE))
- / Defines.ROWS_PER_PAGE;
-
+
+ // The column of the current selection, in the range 0..COLUMNS_PER_PAGE_PORTRAIT-1
+ final int currentPageCol = currentSelection % mColumnsPerPage;
+
+ // The row of the current selection, in the range 0..ROWS_PER_PAGE_PORTRAIT-1
+ final int currentPageRow = (currentSelection - (currentTopRow* mColumnsPerPage))
+ / mRowsPerPage;
+
int newSelection = currentSelection;
-
+
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
if (mLastSelection == SELECTION_HOME) {
mRollo.setHomeSelected(SELECTED_NONE);
- int lastRowCount = iconCount % Defines.COLUMNS_PER_PAGE;
+ int lastRowCount = iconCount % mColumnsPerPage;
if (lastRowCount == 0) {
- lastRowCount = Defines.COLUMNS_PER_PAGE;
+ lastRowCount = mColumnsPerPage;
}
- newSelection = iconCount - lastRowCount + (Defines.COLUMNS_PER_PAGE / 2);
+ newSelection = iconCount - lastRowCount + (mColumnsPerPage / 2);
if (newSelection >= iconCount) {
newSelection = iconCount-1;
}
- int target = (newSelection / Defines.COLUMNS_PER_PAGE)
- - (Defines.ROWS_PER_PAGE - 1);
+ int target = (newSelection / mColumnsPerPage)
+ - (mRowsPerPage - 1);
if (target < 0) {
target = 0;
}
@@ -388,28 +398,28 @@
}
} else {
if (currentPageRow > 0) {
- newSelection = currentSelection - Defines.COLUMNS_PER_PAGE;
+ newSelection = currentSelection - mColumnsPerPage;
} else if (currentTopRow > 0) {
- newSelection = currentSelection - Defines.COLUMNS_PER_PAGE;
- mRollo.moveTo(newSelection / Defines.COLUMNS_PER_PAGE);
+ newSelection = currentSelection - mColumnsPerPage;
+ mRollo.moveTo(newSelection / mColumnsPerPage);
} else if (currentPageRow != 0) {
- newSelection = currentTopRow * Defines.ROWS_PER_PAGE;
+ newSelection = currentTopRow * mRowsPerPage;
}
}
handled = true;
break;
-
+
case KeyEvent.KEYCODE_DPAD_DOWN: {
- final int rowCount = iconCount / Defines.COLUMNS_PER_PAGE
- + (iconCount % Defines.COLUMNS_PER_PAGE == 0 ? 0 : 1);
- final int currentRow = currentSelection / Defines.COLUMNS_PER_PAGE;
+ final int rowCount = iconCount / mColumnsPerPage
+ + (iconCount % mColumnsPerPage == 0 ? 0 : 1);
+ final int currentRow = currentSelection / mColumnsPerPage;
if (mLastSelection != SELECTION_HOME) {
if (currentRow < rowCount-1) {
mRollo.setHomeSelected(SELECTED_NONE);
if (currentSelection < 0) {
newSelection = 0;
} else {
- newSelection = currentSelection + Defines.COLUMNS_PER_PAGE;
+ newSelection = currentSelection + mColumnsPerPage;
}
if (newSelection >= iconCount) {
// Go from D to G in this arrangement:
@@ -417,9 +427,9 @@
// E F G
newSelection = iconCount - 1;
}
- if (currentPageRow >= Defines.ROWS_PER_PAGE - 1) {
- mRollo.moveTo((newSelection / Defines.COLUMNS_PER_PAGE) -
- Defines.ROWS_PER_PAGE + 1);
+ if (currentPageRow >= mRowsPerPage - 1) {
+ mRollo.moveTo((newSelection / mColumnsPerPage) -
+ mRowsPerPage + 1);
}
} else {
newSelection = -1;
@@ -439,7 +449,7 @@
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (mLastSelection != SELECTION_HOME) {
- if ((currentPageCol < Defines.COLUMNS_PER_PAGE - 1) &&
+ if ((currentPageCol < mColumnsPerPage - 1) &&
(currentSelection < iconCount - 1)) {
newSelection = currentSelection + 1;
}
@@ -454,42 +464,44 @@
}
return handled;
}
-
+
@Override
public boolean onTouchEvent(MotionEvent ev)
{
mArrowNavigation = false;
-
+
if (!isVisible()) {
return true;
}
-
+
if (mLocks != 0) {
return true;
}
-
+
super.onTouchEvent(ev);
-
+
int x = (int)ev.getX();
int y = (int)ev.getY();
-
+
+ final boolean isPortrait = getWidth() < getHeight();
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
- if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) {
+ if ((isPortrait && y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) ||
+ (!isPortrait && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1])) {
mTouchTracking = TRACKING_HOME;
mRollo.setHomeSelected(SELECTED_PRESSED);
mRollo.mState.save();
mCurrentIconIndex = -1;
} else {
mTouchTracking = TRACKING_FLING;
-
+
mMotionDownRawX = (int)ev.getRawX();
mMotionDownRawY = (int)ev.getRawY();
-
+
mRollo.mState.newPositionX = ev.getRawY() / getHeight();
mRollo.mState.newTouchDown = 1;
-
+
if (!mRollo.checkClickOK()) {
mRollo.clearSelectedIcon();
} else {
@@ -510,15 +522,16 @@
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_OUTSIDE:
if (mTouchTracking == TRACKING_HOME) {
- mRollo.setHomeSelected(y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]
+ mRollo.setHomeSelected((isPortrait &&
+ y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) || (!isPortrait
+ && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1])
? SELECTED_PRESSED : SELECTED_NONE);
mRollo.mState.save();
} else if (mTouchTracking == TRACKING_FLING) {
- int rawX = (int)ev.getRawX();
int rawY = (int)ev.getRawY();
int slop;
slop = Math.abs(rawY - mMotionDownRawY);
-
+
if (!mStartedScrolling && slop < mSlop) {
// don't update anything so when we do start scrolling
// below, we get the right delta.
@@ -537,7 +550,7 @@
mRollo.mState.newPositionX = ev.getRawY() / getHeight();
mRollo.mState.newTouchDown = 1;
mRollo.move();
-
+
mStartedScrolling = true;
mRollo.clearSelectedIcon();
mVelocityTracker.addMovement(ev);
@@ -549,7 +562,8 @@
case MotionEvent.ACTION_CANCEL:
if (mTouchTracking == TRACKING_HOME) {
if (action == MotionEvent.ACTION_UP) {
- if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) {
+ if ((isPortrait && y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) ||
+ (!isPortrait && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1])) {
reallyPlaySoundEffect(SoundEffectConstants.CLICK);
mLauncher.closeAllApps(true);
}
@@ -560,13 +574,13 @@
} else if (mTouchTracking == TRACKING_FLING) {
mRollo.mState.newTouchDown = 0;
mRollo.mState.newPositionX = ev.getRawY() / getHeight();
-
+
mVelocityTracker.computeCurrentVelocity(1000 /* px/sec */, mMaxFlingVelocity);
mRollo.mState.flingVelocity = mVelocityTracker.getYVelocity() / getHeight();
mRollo.clearSelectedIcon();
mRollo.mState.save();
mRollo.fling();
-
+
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker = null;
@@ -575,10 +589,10 @@
mTouchTracking = TRACKING_NONE;
break;
}
-
+
return true;
}
-
+
public void onClick(View v) {
if (mLocks != 0 || !isVisible()) {
return;
@@ -590,7 +604,7 @@
mLauncher.startActivitySafely(app.intent);
}
}
-
+
public boolean onLongClick(View v) {
if (mLocks != 0 || !isVisible()) {
return true;
@@ -598,25 +612,23 @@
if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex
&& mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
ApplicationInfo app = mAllAppsList.get(mCurrentIconIndex);
-
+
Bitmap bmp = app.iconBitmap;
final int w = bmp.getWidth();
final int h = bmp.getHeight();
-
+
// We don't really have an accurate location to use. This will do.
int screenX = mMotionDownRawX - (w / 2);
int screenY = mMotionDownRawY - h;
-
- int left = (mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
- int top = (mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
+
mDragController.startDrag(bmp, screenX, screenY,
0, 0, w, h, this, app, DragController.DRAG_ACTION_COPY);
-
+
mLauncher.closeAllApps(true);
}
return true;
}
-
+
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SELECTED) {
@@ -653,14 +665,14 @@
}
return false;
}
-
+
public void setDragController(DragController dragger) {
mDragController = dragger;
}
-
+
public void onDropCompleted(View target, boolean success) {
}
-
+
/**
* Zoom to the specifed level.
*
@@ -675,33 +687,32 @@
if (mRollo == null || !mHaveSurface) {
mZoomDirty = true;
mZoom = zoom;
- return;
} else {
mRollo.setZoom(zoom, animate);
}
}
-
+
public boolean isVisible() {
return mZoom > 0.001f;
}
-
+
public boolean isOpaque() {
return mZoom > 0.999f;
}
-
+
public void setApps(ArrayList<ApplicationInfo> list) {
if (mRS == null) {
// We've been removed from the window. Don't bother with all this.
return;
}
-
+
mAllAppsList = list;
if (mRollo != null) {
mRollo.setApps(list);
}
mLocks &= ~LOCK_ICONS_PENDING;
}
-
+
public void addApps(ArrayList<ApplicationInfo> list) {
if (mAllAppsList == null) {
// Not done loading yet. We'll find out about it later.
@@ -711,12 +722,12 @@
// We've been removed from the window. Don't bother with all this.
return;
}
-
+
final int N = list.size();
if (mRollo != null) {
mRollo.reallocAppsList(mRollo.mState.iconCount + N);
}
-
+
for (int i=0; i<N; i++) {
final ApplicationInfo item = list.get(i);
int index = Collections.binarySearch(mAllAppsList, item,
@@ -729,24 +740,23 @@
mRollo.addApp(index, item);
}
}
-
+
if (mRollo != null) {
mRollo.saveAppsList();
}
}
-
+
public void removeApps(ArrayList<ApplicationInfo> list) {
if (mAllAppsList == null) {
// Not done loading yet. We'll find out about it later.
return;
}
-
+
final int N = list.size();
for (int i=0; i<N; i++) {
final ApplicationInfo item = list.get(i);
int index = findAppByComponent(mAllAppsList, item);
if (index >= 0) {
- int ic = mRollo != null ? mRollo.mState.iconCount : 666;
mAllAppsList.remove(index);
if (mRollo != null) {
mRollo.removeApp(index);
@@ -756,18 +766,18 @@
// Try to recover. This should keep us from crashing for now.
}
}
-
+
if (mRollo != null) {
mRollo.saveAppsList();
}
}
-
+
public void updateApps(String packageName, ArrayList<ApplicationInfo> list) {
// Just remove and add, because they may need to be re-sorted.
removeApps(list);
addApps(list);
}
-
+
private static int findAppByComponent(ArrayList<ApplicationInfo> list, ApplicationInfo item) {
ComponentName component = item.intent.getComponent();
final int N = list.size();
@@ -779,15 +789,17 @@
}
return -1;
}
-
+
+ /*
private static int countPages(int iconCount) {
- int iconsPerPage = Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE;
+ int iconsPerPage = getColumnsCount() * Defines.ROWS_PER_PAGE_PORTRAIT;
int pages = iconCount / iconsPerPage;
if (pages*iconsPerPage != iconCount) {
pages++;
}
return pages;
}
+ */
class AAMessage extends RenderScript.RSMessage {
public void run() {
@@ -797,13 +809,13 @@
mZoomDirty = false;
}
}
-
+
public class RolloRS {
-
+
// Allocations ======
private int mWidth;
private int mHeight;
-
+
private Resources mRes;
private Script mScript;
private Script.Invokable mInvokeMove;
@@ -811,7 +823,7 @@
private Script.Invokable mInvokeFling;
private Script.Invokable mInvokeResetWAR;
private Script.Invokable mInvokeSetZoom;
-
+
private ProgramStore mPSIcons;
private ProgramFragment mPFTexMip;
private ProgramFragment mPFTexMipAlpha;
@@ -820,45 +832,45 @@
private ProgramVertex mPVCurve;
private SimpleMesh mMesh;
private ProgramVertex.MatrixAllocation mPVA;
-
+
private Allocation mUniformAlloc;
-
+
private Allocation mHomeButtonNormal;
private Allocation mHomeButtonFocused;
private Allocation mHomeButtonPressed;
-
+
private Allocation[] mIcons;
private int[] mIconIds;
private Allocation mAllocIconIds;
-
+
private Allocation[] mLabels;
private int[] mLabelIds;
private Allocation mAllocLabelIds;
private Allocation mSelectedIcon;
-
+
private int[] mTouchYBorders;
private int[] mTouchXBorders;
-
+
private Bitmap mSelectionBitmap;
private Canvas mSelectionCanvas;
-
+
Params mParams;
State mState;
-
+
class BaseAlloc {
Allocation mAlloc;
Type mType;
-
+
void save() {
mAlloc.data(this);
}
}
-
+
private boolean checkClickOK() {
return (Math.abs(mVelocity) < 0.4f) &&
(Math.abs(mPosX - Math.round(mPosX)) < 0.4f);
}
-
+
class Params extends BaseAlloc {
Params() {
mType = Type.createFromClass(mRS, Params.class, 1, "ParamsClass");
@@ -869,13 +881,13 @@
public int bubbleHeight;
public int bubbleBitmapWidth;
public int bubbleBitmapHeight;
-
+
public int homeButtonWidth;
public int homeButtonHeight;
public int homeButtonTextureWidth;
public int homeButtonTextureHeight;
}
-
+
class State extends BaseAlloc {
public float newPositionX;
public int newTouchDown;
@@ -886,17 +898,17 @@
public float zoomTarget;
public int homeButtonId;
public float targetPos;
-
+
State() {
mType = Type.createFromClass(mRS, State.class, 1, "StateClass");
mAlloc = Allocation.createTyped(mRS, mType);
save();
}
}
-
+
public RolloRS() {
}
-
+
public void init(Resources res, int width, int height) {
mRes = res;
mWidth = width;
@@ -909,10 +921,10 @@
initTouchState();
initRs();
}
-
+
public void initMesh() {
SimpleMesh.TriangleMeshBuilder tm = new SimpleMesh.TriangleMeshBuilder(mRS, 2, 0);
-
+
for (int ct=0; ct < 16; ct++) {
float pos = (1.f / (16.f - 1)) * ct;
tm.addVertex(0.0f, pos);
@@ -925,90 +937,90 @@
mMesh = tm.create();
mMesh.setName("SMCell");
}
-
+
void resize(int w, int h) {
mPVA.setupProjectionNormalized(w, h);
mWidth = w;
mHeight = h;
}
-
+
private void initProgramVertex() {
mPVA = new ProgramVertex.MatrixAllocation(mRS);
resize(mWidth, mHeight);
-
+
ProgramVertex.Builder pvb = new ProgramVertex.Builder(mRS, null, null);
pvb.setTextureMatrixEnable(true);
mPV = pvb.create();
mPV.setName("PV");
mPV.bindAllocation(mPVA);
-
+
Element.Builder eb = new Element.Builder(mRS);
eb.add(Element.createVector(mRS, Element.DataType.FLOAT_32, 2), "ImgSize");
eb.add(Element.createVector(mRS, Element.DataType.FLOAT_32, 4), "Position");
eb.add(Element.createVector(mRS, Element.DataType.FLOAT_32, 2), "BendPos");
eb.add(Element.createVector(mRS, Element.DataType.FLOAT_32, 4), "ScaleOffset");
Element e = eb.create();
-
+
mUniformAlloc = Allocation.createSized(mRS, e, 1);
-
+
initMesh();
ProgramVertex.ShaderBuilder sb = new ProgramVertex.ShaderBuilder(mRS);
- String t = new String("void main() {\n" +
- // Animation
- " float ani = UNI_Position.z;\n" +
-
- " float bendY1 = UNI_BendPos.x;\n" +
- " float bendY2 = UNI_BendPos.y;\n" +
- " float bendAngle = 47.0 * (3.14 / 180.0);\n" +
- " float bendDistance = bendY1 * 0.4;\n" +
- " float distanceDimLevel = 0.6;\n" +
-
- " float bendStep = (bendAngle / bendDistance) * (bendAngle * 0.5);\n" +
- " float aDy = cos(bendAngle);\n" +
- " float aDz = sin(bendAngle);\n" +
-
- " float scale = (2.0 / 480.0);\n" +
- " float x = UNI_Position.x + UNI_ImgSize.x * (1.0 - ani) * (ATTRIB_position.x - 0.5);\n" +
- " float ys= UNI_Position.y + UNI_ImgSize.y * (1.0 - ani) * ATTRIB_position.y;\n" +
- " float y = 0.0;\n" +
- " float z = 0.0;\n" +
- " float lum = 1.0;\n" +
-
- " float cv = min(ys, bendY1 - bendDistance) - (bendY1 - bendDistance);\n" +
- " y += cv * aDy;\n" +
- " z += -cv * aDz;\n" +
- " cv = clamp(ys, bendY1 - bendDistance, bendY1) - bendY1;\n" + // curve range
- " lum += cv / bendDistance * distanceDimLevel;\n" +
- " y += cv * cos(cv * bendStep);\n" +
- " z += cv * sin(cv * bendStep);\n" +
-
- " cv = max(ys, bendY2 + bendDistance) - (bendY2 + bendDistance);\n" +
- " y += cv * aDy;\n" +
- " z += cv * aDz;\n" +
- " cv = clamp(ys, bendY2, bendY2 + bendDistance) - bendY2;\n" +
- " lum -= cv / bendDistance * distanceDimLevel;\n" +
- " y += cv * cos(cv * bendStep);\n" +
- " z += cv * sin(cv * bendStep);\n" +
-
- " y += clamp(ys, bendY1, bendY2);\n" +
-
- " vec4 pos;\n" +
- " pos.x = (x + UNI_ScaleOffset.z) * UNI_ScaleOffset.x;\n" +
- " pos.y = (y + UNI_ScaleOffset.w) * UNI_ScaleOffset.x;\n" +
- " pos.z = z * UNI_ScaleOffset.x;\n" +
- " pos.w = 1.0;\n" +
-
- " pos.x *= 1.0 + ani * 4.0;\n" +
- " pos.y *= 1.0 + ani * 4.0;\n" +
- " pos.z -= ani * 1.5;\n" +
- " lum *= 1.0 - ani;\n" +
-
- " gl_Position = UNI_MVP * pos;\n" +
- " varColor.rgba = vec4(lum, lum, lum, 1.0);\n" +
- " varTex0.xy = ATTRIB_position;\n" +
- " varTex0.y = 1.0 - varTex0.y;\n" +
- " varTex0.zw = vec2(0.0, 0.0);\n" +
- "}\n");
+ String t = "void main() {\n" +
+ // Animation
+ " float ani = UNI_Position.z;\n" +
+
+ " float bendY1 = UNI_BendPos.x;\n" +
+ " float bendY2 = UNI_BendPos.y;\n" +
+ " float bendAngle = 47.0 * (3.14 / 180.0);\n" +
+ " float bendDistance = bendY1 * 0.4;\n" +
+ " float distanceDimLevel = 0.6;\n" +
+
+ " float bendStep = (bendAngle / bendDistance) * (bendAngle * 0.5);\n" +
+ " float aDy = cos(bendAngle);\n" +
+ " float aDz = sin(bendAngle);\n" +
+
+ " float scale = (2.0 / 480.0);\n" +
+ " float x = UNI_Position.x + UNI_ImgSize.x * (1.0 - ani) * (ATTRIB_position.x - 0.5);\n" +
+ " float ys= UNI_Position.y + UNI_ImgSize.y * (1.0 - ani) * ATTRIB_position.y;\n" +
+ " float y = 0.0;\n" +
+ " float z = 0.0;\n" +
+ " float lum = 1.0;\n" +
+
+ " float cv = min(ys, bendY1 - bendDistance) - (bendY1 - bendDistance);\n" +
+ " y += cv * aDy;\n" +
+ " z += -cv * aDz;\n" +
+ " cv = clamp(ys, bendY1 - bendDistance, bendY1) - bendY1;\n" + // curve range
+ " lum += cv / bendDistance * distanceDimLevel;\n" +
+ " y += cv * cos(cv * bendStep);\n" +
+ " z += cv * sin(cv * bendStep);\n" +
+
+ " cv = max(ys, bendY2 + bendDistance) - (bendY2 + bendDistance);\n" +
+ " y += cv * aDy;\n" +
+ " z += cv * aDz;\n" +
+ " cv = clamp(ys, bendY2, bendY2 + bendDistance) - bendY2;\n" +
+ " lum -= cv / bendDistance * distanceDimLevel;\n" +
+ " y += cv * cos(cv * bendStep);\n" +
+ " z += cv * sin(cv * bendStep);\n" +
+
+ " y += clamp(ys, bendY1, bendY2);\n" +
+
+ " vec4 pos;\n" +
+ " pos.x = (x + UNI_ScaleOffset.z) * UNI_ScaleOffset.x;\n" +
+ " pos.y = (y + UNI_ScaleOffset.w) * UNI_ScaleOffset.x;\n" +
+ " pos.z = z * UNI_ScaleOffset.x;\n" +
+ " pos.w = 1.0;\n" +
+
+ " pos.x *= 1.0 + ani * 4.0;\n" +
+ " pos.y *= 1.0 + ani * 4.0;\n" +
+ " pos.z -= ani * 1.5;\n" +
+ " lum *= 1.0 - ani;\n" +
+
+ " gl_Position = UNI_MVP * pos;\n" +
+ " varColor.rgba = vec4(lum, lum, lum, 1.0);\n" +
+ " varTex0.xy = ATTRIB_position;\n" +
+ " varTex0.y = 1.0 - varTex0.y;\n" +
+ " varTex0.zw = vec2(0.0, 0.0);\n" +
+ "}\n";
sb.setShader(t);
sb.addConstant(mUniformAlloc.getType());
sb.addInput(mMesh.getVertexType(0).getElement());
@@ -1016,10 +1028,10 @@
mPVCurve.setName("PVCurve");
mPVCurve.bindAllocation(mPVA);
mPVCurve.bindConstants(mUniformAlloc, 1);
-
+
mRS.contextBindProgramVertex(mPV);
}
-
+
private void initProgramFragment() {
Sampler.Builder sb = new Sampler.Builder(mRS);
sb.setMin(Sampler.Value.LINEAR_MIP_LINEAR);
@@ -1027,30 +1039,30 @@
sb.setWrapS(Sampler.Value.CLAMP);
sb.setWrapT(Sampler.Value.CLAMP);
Sampler linear = sb.create();
-
+
sb.setMin(Sampler.Value.NEAREST);
sb.setMag(Sampler.Value.NEAREST);
Sampler nearest = sb.create();
-
+
ProgramFragment.Builder bf = new ProgramFragment.Builder(mRS);
bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE,
ProgramFragment.Builder.Format.RGBA, 0);
mPFTexMip = bf.create();
mPFTexMip.setName("PFTexMip");
mPFTexMip.bindSampler(linear, 0);
-
+
mPFTexNearest = bf.create();
mPFTexNearest.setName("PFTexNearest");
mPFTexNearest.bindSampler(nearest, 0);
-
+
bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE,
ProgramFragment.Builder.Format.ALPHA, 0);
mPFTexMipAlpha = bf.create();
mPFTexMipAlpha.setName("PFTexMipAlpha");
mPFTexMipAlpha.bindSampler(linear, 0);
-
+
}
-
+
private void initProgramStore() {
ProgramStore.Builder bs = new ProgramStore.Builder(mRS, null, null);
bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
@@ -1061,23 +1073,23 @@
mPSIcons = bs.create();
mPSIcons.setName("PSIcons");
}
-
+
private void initGl() {
- mTouchXBorders = new int[Defines.COLUMNS_PER_PAGE+1];
- mTouchYBorders = new int[Defines.ROWS_PER_PAGE+1];
+ mTouchXBorders = new int[mColumnsPerPage +1];
+ mTouchYBorders = new int[mRowsPerPage +1];
}
-
+
private void initData() {
mParams = new Params();
mState = new State();
-
+
final Utilities.BubbleText bubble = new Utilities.BubbleText(getContext());
-
+
mParams.bubbleWidth = bubble.getBubbleWidth();
mParams.bubbleHeight = bubble.getMaxBubbleHeight();
mParams.bubbleBitmapWidth = bubble.getBitmapWidth();
mParams.bubbleBitmapHeight = bubble.getBitmapHeight();
-
+
mHomeButtonNormal = Allocation.createFromBitmapResource(mRS, mRes,
R.drawable.home_button_normal, Element.RGBA_8888(mRS), false);
mHomeButtonNormal.uploadToTexture(0);
@@ -1091,22 +1103,19 @@
mParams.homeButtonHeight = 68;
mParams.homeButtonTextureWidth = 128;
mParams.homeButtonTextureHeight = 128;
-
+
mState.homeButtonId = mHomeButtonNormal.getID();
-
+
mParams.save();
mState.save();
-
+
mSelectionBitmap = Bitmap.createBitmap(Defines.SELECTION_TEXTURE_WIDTH_PX,
Defines.SELECTION_TEXTURE_HEIGHT_PX, Bitmap.Config.ARGB_8888);
mSelectionCanvas = new Canvas(mSelectionBitmap);
-
+
setApps(null);
}
-
- private void initScript(int id) {
- }
-
+
private void initRs() {
ScriptC.Builder sb = new ScriptC.Builder(mRS);
sb.setScript(mRes, R.raw.allapps);
@@ -1127,33 +1136,32 @@
mScript.bindAllocation(mAllocIconIds, Defines.ALLOC_ICON_IDS);
mScript.bindAllocation(mAllocLabelIds, Defines.ALLOC_LABEL_IDS);
mScript.bindAllocation(mUniformAlloc, Defines.ALLOC_VP_CONSTANTS);
-
+
mRS.contextBindRootScript(mScript);
}
-
+
void dirtyCheck() {
if (mZoomDirty) {
setZoom(mNextZoom, mAnimateNextZoom);
}
}
-
+
+ @SuppressWarnings({"ConstantConditions"})
private void setApps(ArrayList<ApplicationInfo> list) {
final int count = list != null ? list.size() : 0;
int allocCount = count;
if (allocCount < 1) {
allocCount = 1;
}
-
+
mIcons = new Allocation[count];
mIconIds = new int[allocCount];
mAllocIconIds = Allocation.createSized(mRS, Element.USER_I32(mRS), allocCount);
-
+
mLabels = new Allocation[count];
mLabelIds = new int[allocCount];
mAllocLabelIds = Allocation.createSized(mRS, Element.USER_I32(mRS), allocCount);
-
- Element ie8888 = Element.RGBA_8888(mRS);
-
+
mState.iconCount = count;
for (int i=0; i < mState.iconCount; i++) {
createAppIconAllocations(i, list.get(i));
@@ -1163,7 +1171,7 @@
}
saveAppsList();
}
-
+
private void setZoom(float zoom, boolean animate) {
mRollo.clearSelectedIcon();
mRollo.setHomeSelected(SELECTED_NONE);
@@ -1177,16 +1185,16 @@
mRollo.mInvokeSetZoom.execute();
}
}
-
+
private void createAppIconAllocations(int index, ApplicationInfo item) {
mIcons[index] = Allocation.createFromBitmap(mRS, item.iconBitmap,
- Element.RGBA_8888(mRS), true);
+ Element.RGBA_8888(mRS), false);
mLabels[index] = Allocation.createFromBitmap(mRS, item.titleBitmap,
- Element.A_8(mRS), true);
+ Element.A_8(mRS), false);
mIconIds[index] = mIcons[index].getID();
mLabelIds[index] = mLabels[index].getID();
}
-
+
private void uploadAppIcon(int index, ApplicationInfo item) {
if (mIconIds[index] != mIcons[index].getID()) {
throw new IllegalStateException("uploadAppIcon index=" + index
@@ -1194,10 +1202,10 @@
+ " mIconsIds[index]=" + mIconIds[index]
+ " item=" + item);
}
- mIcons[index].uploadToTexture(0);
- mLabels[index].uploadToTexture(0);
+ mIcons[index].uploadToTexture(true, 0);
+ mLabels[index].uploadToTexture(true, 0);
}
-
+
/**
* Puts the empty spaces at the end. Updates mState.iconCount. You must
* fill in the values and call saveAppsList().
@@ -1206,62 +1214,62 @@
Allocation[] icons = new Allocation[count];
int[] iconIds = new int[count];
mAllocIconIds = Allocation.createSized(mRS, Element.USER_I32(mRS), count);
-
+
Allocation[] labels = new Allocation[count];
int[] labelIds = new int[count];
mAllocLabelIds = Allocation.createSized(mRS, Element.USER_I32(mRS), count);
-
+
final int oldCount = mRollo.mState.iconCount;
-
+
System.arraycopy(mIcons, 0, icons, 0, oldCount);
System.arraycopy(mIconIds, 0, iconIds, 0, oldCount);
System.arraycopy(mLabels, 0, labels, 0, oldCount);
System.arraycopy(mLabelIds, 0, labelIds, 0, oldCount);
-
+
mIcons = icons;
mIconIds = iconIds;
mLabels = labels;
mLabelIds = labelIds;
}
-
+
/**
* Handle the allocations for the new app. Make sure you call saveAppsList when done.
*/
private void addApp(int index, ApplicationInfo item) {
final int count = mState.iconCount - index;
final int dest = index + 1;
-
+
System.arraycopy(mIcons, index, mIcons, dest, count);
System.arraycopy(mIconIds, index, mIconIds, dest, count);
System.arraycopy(mLabels, index, mLabels, dest, count);
System.arraycopy(mLabelIds, index, mLabelIds, dest, count);
-
+
createAppIconAllocations(index, item);
uploadAppIcon(index, item);
mRollo.mState.iconCount++;
}
-
+
/**
* Handle the allocations for the removed app. Make sure you call saveAppsList when done.
*/
private void removeApp(int index) {
final int count = mState.iconCount - index - 1;
final int src = index + 1;
-
+
System.arraycopy(mIcons, src, mIcons, index, count);
System.arraycopy(mIconIds, src, mIconIds, index, count);
System.arraycopy(mLabels, src, mLabels, index, count);
System.arraycopy(mLabelIds, src, mLabelIds, index, count);
-
+
mRollo.mState.iconCount--;
final int last = mState.iconCount;
-
+
mIcons[last] = null;
mIconIds[last] = 0;
mLabels[last] = null;
mLabelIds[last] = 0;
}
-
+
/**
* Send the apps list structures to RS.
*/
@@ -1269,93 +1277,96 @@
// WTF: how could mScript be not null but mAllocIconIds null b/2460740.
if (mScript != null && mAllocIconIds != null) {
mRS.contextBindRootScript(null);
-
+
mAllocIconIds.data(mIconIds);
mAllocLabelIds.data(mLabelIds);
-
+
mScript.bindAllocation(mAllocIconIds, Defines.ALLOC_ICON_IDS);
mScript.bindAllocation(mAllocLabelIds, Defines.ALLOC_LABEL_IDS);
-
+
mState.save();
-
+
// Note: mScript may be null if we haven't initialized it yet.
// In that case, this is a no-op.
if (mInvokeResetWAR != null) {
mInvokeResetWAR.execute();
}
-
+
mRS.contextBindRootScript(mScript);
}
}
-
+
void initTouchState() {
- int width = getWidth();
- int height = getHeight();
- int cellHeight = 145;//iconsSize / Defines.ROWS_PER_PAGE;
- int cellWidth = width / Defines.COLUMNS_PER_PAGE;
-
- int centerY = (height / 2);
- mTouchYBorders[0] = centerY - (cellHeight * 2);
- mTouchYBorders[1] = centerY - cellHeight;
- mTouchYBorders[2] = centerY;
- mTouchYBorders[3] = centerY + cellHeight;
- mTouchYBorders[4] = centerY + (cellHeight * 2);
-
- int centerX = (width / 2);
- mTouchXBorders[0] = 0;
- mTouchXBorders[1] = centerX - (width / 4);
- mTouchXBorders[2] = centerX;
- mTouchXBorders[3] = centerX + (width / 4);
- mTouchXBorders[4] = width;
+ boolean isPortrait = getWidth() < getHeight();
+ // TODO: Put this in a config file/define
+ int cellHeight = 145;//iconsSize / Defines.ROWS_PER_PAGE_PORTRAIT;
+ if (!isPortrait) cellHeight -= 12;
+ int centerY = (int) (getHeight() * (isPortrait ? 0.5f : 0.47f));
+ if (!isPortrait) centerY += cellHeight / 2;
+ int half = (int) Math.floor((mRowsPerPage + 1) / 2);
+ int end = mTouchYBorders.length - (half + 1);
+
+ for (int i = -half; i <= end; i++) {
+ mTouchYBorders[i + half] = centerY + i * cellHeight;
+ }
+
+ int x = 0;
+ // TODO: Put this in a config file/define
+ int columnWidth = 120;
+ for (int i = 0; i < mColumnsPerPage + 1; i++) {
+ mTouchXBorders[i] = x;
+ x += columnWidth;
+ }
}
-
+
void fling() {
mInvokeFling.execute();
}
-
+
void move() {
mInvokeMove.execute();
}
-
+
void moveTo(float row) {
mState.targetPos = row;
mState.save();
mInvokeMoveTo.execute();
}
-
+
int chooseTappedIcon(int x, int y, float pos) {
// Adjust for scroll position if not zero.
y += (pos - ((int)pos)) * (mTouchYBorders[1] - mTouchYBorders[0]);
-
+
int col = -1;
int row = -1;
- for (int i=0; i<Defines.COLUMNS_PER_PAGE; i++) {
+ final int columnsCount = mColumnsPerPage;
+ for (int i=0; i< columnsCount; i++) {
if (x >= mTouchXBorders[i] && x < mTouchXBorders[i+1]) {
col = i;
break;
}
}
- for (int i=0; i<Defines.ROWS_PER_PAGE; i++) {
+ final int rowsCount = mRowsPerPage;
+ for (int i=0; i< rowsCount; i++) {
if (y >= mTouchYBorders[i] && y < mTouchYBorders[i+1]) {
row = i;
break;
}
}
-
+
if (row < 0 || col < 0) {
return -1;
}
-
- int index = (((int)pos) * Defines.COLUMNS_PER_PAGE)
- + (row * Defines.ROWS_PER_PAGE) + col;
-
+
+ int index = (((int)pos) * columnsCount) + (row * columnsCount) + col;
+
if (index >= mState.iconCount) {
return -1;
} else {
return index;
}
}
-
+
/**
* You need to call save() on mState on your own after calling this.
*
@@ -1366,7 +1377,7 @@
selectIcon(index, pressed);
return index;
}
-
+
/**
* Select the icon at the given index.
*
@@ -1383,22 +1394,22 @@
if (pressed == SELECTED_FOCUSED) {
mLastSelection = SELECTION_ICONS;
}
-
+
int prev = mState.selectedIconIndex;
mState.selectedIconIndex = index;
-
+
ApplicationInfo info = mAllAppsList.get(index);
Bitmap selectionBitmap = mSelectionBitmap;
-
+
Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,
selectionBitmap.getWidth(), selectionBitmap.getHeight(),
pressed == SELECTED_PRESSED, info.iconBitmap);
-
+
mSelectedIcon = Allocation.createFromBitmap(mRS, selectionBitmap,
Element.RGBA_8888(mRS), false);
mSelectedIcon.uploadToTexture(0);
mState.selectedIconTexture = mSelectedIcon.getID();
-
+
if (prev != index) {
if (info.title != null && info.title.length() > 0) {
//setContentDescription(info.title);
@@ -1407,14 +1418,14 @@
}
}
}
-
+
/**
* You need to call save() on mState on your own after calling this.
*/
void clearSelectedIcon() {
mState.selectedIconIndex = -1;
}
-
+
void setHomeSelected(int mode) {
final int prev = mLastSelection;
switch (mode) {
@@ -1433,11 +1444,11 @@
break;
}
}
-
+
public void dumpState() {
Log.d(TAG, "mRollo.mWidth=" + mWidth);
Log.d(TAG, "mRollo.mHeight=" + mHeight);
- Log.d(TAG, "mRollo.mIcons=" + mIcons);
+ Log.d(TAG, "mRollo.mIcons=" + Arrays.toString(mIcons));
if (mIcons != null) {
Log.d(TAG, "mRollo.mIcons.length=" + mIcons.length);
}
@@ -1470,7 +1481,7 @@
Log.d(TAG, "mRollo.mParams.homeButtonTextureHeight=" + mParams.homeButtonTextureHeight);
}
}
-
+
public void dumpState() {
Log.d(TAG, "mRS=" + mRS);
Log.d(TAG, "mRollo=" + mRollo);
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 01a6df4..04f4040 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -16,44 +16,12 @@
package com.android.launcher2;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.PixelFormat;
-import android.graphics.Rect;
-import android.graphics.drawable.BitmapDrawable;
-import android.os.SystemClock;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.ViewGroup;
-import android.view.MotionEvent;
-import android.view.LayoutInflater;
-import android.view.SoundEffectConstants;
-import android.view.SurfaceHolder;
-import android.view.VelocityTracker;
-import android.view.View;
-import android.view.animation.Animation;
-import android.view.animation.AnimationUtils;
-import android.view.ViewConfiguration;
-import android.view.accessibility.AccessibilityEvent;
-import android.widget.AdapterView;
-import android.widget.TextView;
-import android.widget.ArrayAdapter;
-import android.widget.GridView;
-
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-
public interface AllAppsView {
public interface Watcher {
public void zoomed(float zoom);
- };
+ }
public void setLauncher(Launcher launcher);
@@ -75,5 +43,3 @@
public void dumpState();
}
-
-
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index eaaff1c..4a56e1b 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -25,6 +25,8 @@
import android.graphics.drawable.Drawable;
import android.text.Layout;
+import com.android.launcher.R;
+
/**
* TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan
* because we want to make the bubble taller than the text and TextView's clip is
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 8b141a4..9d39c2c 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -32,6 +32,8 @@
import java.util.ArrayList;
+import com.android.launcher.R;
+
public class CellLayout extends ViewGroup {
private boolean mPortrait;
diff --git a/src/com/android/launcher2/DeleteZone.java b/src/com/android/launcher2/DeleteZone.java
index fabeb4a..9065de4 100644
--- a/src/com/android/launcher2/DeleteZone.java
+++ b/src/com/android/launcher2/DeleteZone.java
@@ -33,6 +33,8 @@
import android.graphics.RectF;
import android.graphics.drawable.TransitionDrawable;
+import com.android.launcher.R;
+
public class DeleteZone extends ImageView implements DropTarget, DragController.DragListener {
private static final int ORIENTATION_HORIZONTAL = 1;
private static final int TRANSITION_DURATION = 250;
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 435004d..cd3eae8 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -29,6 +29,8 @@
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
+import com.android.launcher.R;
+
/**
* Represents a set of icons chosen by the user or generated by the system.
*/
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 826336c..0013644 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -24,6 +24,8 @@
import android.view.LayoutInflater;
import android.view.ViewGroup;
+import com.android.launcher.R;
+
/**
* An icon that can appear on in the workspace representing an {@link UserFolder}.
*/
diff --git a/src/com/android/launcher2/HandleView.java b/src/com/android/launcher2/HandleView.java
index e07334e..e2e5745 100644
--- a/src/com/android/launcher2/HandleView.java
+++ b/src/com/android/launcher2/HandleView.java
@@ -25,6 +25,8 @@
import android.view.KeyEvent;
import android.view.View;
+import com.android.launcher.R;
+
public class HandleView extends ImageView {
private static final int ORIENTATION_HORIZONTAL = 1;
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 9a2f73f..3fc568b 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -23,6 +23,8 @@
import android.database.Cursor;
import android.widget.Toast;
+import com.android.launcher.R;
+
public class InstallShortcutReceiver extends BroadcastReceiver {
private static final String ACTION_INSTALL_SHORTCUT =
"com.android.launcher.action.INSTALL_SHORTCUT";
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 5146ffd..903db1d 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -26,16 +26,13 @@
import android.app.WallpaperManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
-import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
@@ -63,7 +60,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnLongClickListener;
-import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
@@ -81,6 +77,8 @@
import java.io.IOException;
import java.io.DataInputStream;
+import com.android.launcher.R;
+
/**
* Default launcher application.
*/
@@ -1001,7 +999,7 @@
intent.setComponent(appWidget.configure);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
- startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
+ startActivityForResultSafely(intent, REQUEST_CREATE_APPWIDGET);
} else {
// Otherwise just add it
onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data);
@@ -1288,6 +1286,19 @@
"or use the exported attribute for this activity.", e);
}
}
+
+ void startActivityForResultSafely(Intent intent, int requestCode) {
+ try {
+ startActivityForResult(intent, requestCode);
+ } catch (ActivityNotFoundException e) {
+ Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
+ } catch (SecurityException e) {
+ Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
+ Log.e(TAG, "Launcher does not have the permission to launch " + intent +
+ ". Make sure to create a MAIN intent-filter for the corresponding activity " +
+ "or use the exported attribute for this activity.", e);
+ }
+ }
private void handleFolderClick(FolderInfo folderInfo) {
if (!folderInfo.opened) {
@@ -1765,8 +1776,6 @@
private AddAdapter mAdapter;
Dialog createDialog() {
- mWaitingForResult = true;
-
mAdapter = new AddAdapter(Launcher.this);
final AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this);
@@ -1856,6 +1865,7 @@
}
public void onShow(DialogInterface dialog) {
+ mWaitingForResult = true;
}
}
diff --git a/src/com/android/launcher2/LauncherAppWidgetHostView.java b/src/com/android/launcher2/LauncherAppWidgetHostView.java
index d8fe499..c45140e 100644
--- a/src/com/android/launcher2/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher2/LauncherAppWidgetHostView.java
@@ -23,6 +23,8 @@
import android.view.View;
import android.view.ViewConfiguration;
+import com.android.launcher.R;
+
/**
* {@inheritDoc}
*/
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 16e5c3b..8790fd7 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -50,6 +50,8 @@
import java.util.HashMap;
import java.util.List;
+import com.android.launcher.R;
+
/**
* Maintains in-memory state of the Launcher. It is expected that there should be only one
* LauncherModel object held in a static. Also provide APIs for updating the database state
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 14c83b3..9f55e91 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -45,12 +45,10 @@
import android.util.AttributeSet;
import android.net.Uri;
import android.text.TextUtils;
-import android.os.*;
import android.provider.Settings;
import java.io.IOException;
import java.net.URISyntaxException;
-import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParserException;
@@ -59,6 +57,8 @@
import com.android.internal.util.XmlUtils;
import com.android.launcher2.LauncherSettings.Favorites;
+import com.android.launcher.R;
+
public class LauncherProvider extends ContentProvider {
private static final String TAG = "Launcher.LauncherProvider";
private static final boolean LOGD = false;
@@ -69,9 +69,6 @@
static final String AUTHORITY = "com.android.launcher2.settings";
- static final String EXTRA_BIND_SOURCES = "com.android.launcher2.settings.bindsources";
- static final String EXTRA_BIND_TARGETS = "com.android.launcher2.settings.bindtargets";
-
static final String TABLE_FAVORITES = "favorites";
static final String PARAMETER_NOTIFY = "notify";
@@ -485,8 +482,6 @@
Cursor c = null;
try {
boolean logged = false;
- final ContentValues values = new ContentValues();
- final ContentResolver cr = mContext.getContentResolver();
final SQLiteStatement update = db.compileStatement("UPDATE favorites "
+ "SET icon=? WHERE _id=?");
@@ -587,7 +582,6 @@
String updateWhere = Favorites._ID + "=" + favoriteId;
db.update(TABLE_FAVORITES, values, updateWhere, null);
- ComponentName cn = null;
if (favoriteType == Favorites.ITEM_TYPE_WIDGET_CLOCK) {
appWidgetManager.bindAppWidgetId(appWidgetId,
new ComponentName("com.android.alarmclock",
diff --git a/src/com/android/launcher2/LiveFolder.java b/src/com/android/launcher2/LiveFolder.java
index ecd9bdf..c85a844 100644
--- a/src/com/android/launcher2/LiveFolder.java
+++ b/src/com/android/launcher2/LiveFolder.java
@@ -29,6 +29,8 @@
import java.lang.ref.WeakReference;
+import com.android.launcher.R;
+
public class LiveFolder extends Folder {
private AsyncTask<LiveFolderInfo,Void,Cursor> mLoadingTask;
diff --git a/src/com/android/launcher2/LiveFolderAdapter.java b/src/com/android/launcher2/LiveFolderAdapter.java
index 58b43e3..fb9c6a3 100644
--- a/src/com/android/launcher2/LiveFolderAdapter.java
+++ b/src/com/android/launcher2/LiveFolderAdapter.java
@@ -36,6 +36,8 @@
import java.util.HashMap;
import java.lang.ref.SoftReference;
+import com.android.launcher.R;
+
class LiveFolderAdapter extends CursorAdapter {
private boolean mIsList;
private LayoutInflater mInflater;
diff --git a/src/com/android/launcher2/LiveFolderIcon.java b/src/com/android/launcher2/LiveFolderIcon.java
index f80928b..5b73a59 100644
--- a/src/com/android/launcher2/LiveFolderIcon.java
+++ b/src/com/android/launcher2/LiveFolderIcon.java
@@ -23,6 +23,8 @@
import android.view.LayoutInflater;
import android.graphics.Bitmap;
+import com.android.launcher.R;
+
public class LiveFolderIcon extends FolderIcon {
public LiveFolderIcon(Context context, AttributeSet attrs) {
super(context, attrs);
diff --git a/src/com/android/launcher2/ShortcutsAdapter.java b/src/com/android/launcher2/ShortcutsAdapter.java
index 212b5d6..19c3af0 100644
--- a/src/com/android/launcher2/ShortcutsAdapter.java
+++ b/src/com/android/launcher2/ShortcutsAdapter.java
@@ -26,17 +26,17 @@
import java.util.ArrayList;
+import com.android.launcher.R;
+
/**
* GridView adapter to show the list of applications and shortcuts
*/
public class ShortcutsAdapter extends ArrayAdapter<ShortcutInfo> {
private final LayoutInflater mInflater;
- private final PackageManager mPackageManager;
private final IconCache mIconCache;
public ShortcutsAdapter(Context context, ArrayList<ShortcutInfo> apps) {
super(context, 0, apps);
- mPackageManager = context.getPackageManager();
mInflater = LayoutInflater.from(context);
mIconCache = ((LauncherApplication)context.getApplicationContext()).getIconCache();
}
diff --git a/src/com/android/launcher2/UninstallShortcutReceiver.java b/src/com/android/launcher2/UninstallShortcutReceiver.java
index e65c6a0..eb4ee4c 100644
--- a/src/com/android/launcher2/UninstallShortcutReceiver.java
+++ b/src/com/android/launcher2/UninstallShortcutReceiver.java
@@ -26,6 +26,8 @@
import java.net.URISyntaxException;
+import com.android.launcher.R;
+
public class UninstallShortcutReceiver extends BroadcastReceiver {
private static final String ACTION_UNINSTALL_SHORTCUT =
"com.android.launcher.action.UNINSTALL_SHORTCUT";
diff --git a/src/com/android/launcher2/UserFolder.java b/src/com/android/launcher2/UserFolder.java
index 1489492..d49c27a 100644
--- a/src/com/android/launcher2/UserFolder.java
+++ b/src/com/android/launcher2/UserFolder.java
@@ -8,6 +8,8 @@
import android.view.View;
import android.widget.ArrayAdapter;
+import com.android.launcher.R;
+
/**
* Folder which contains applications or shortcuts chosen by the user.
*
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index fbe489e..7bc1e82 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -38,6 +38,8 @@
import android.content.res.Resources;
import android.content.Context;
+import com.android.launcher.R;
+
/**
* Various utilities shared amongst the Launcher's classes.
*/
@@ -232,7 +234,6 @@
private final TextPaint mTextPaint;
- private final float mBubblePadding;
private final RectF mBubbleRect = new RectF();
private final float mTextWidth;
@@ -251,18 +252,16 @@
final float scale = metrics.density;
mDensity = metrics.densityDpi;
- final float paddingLeft = 5.0f * scale;
- final float paddingRight = 5.0f * scale;
+ final float paddingLeft = 2.0f * scale;
+ final float paddingRight = 2.0f * scale;
final float cellWidth = resources.getDimension(R.dimen.title_texture_width);
- final float bubbleWidth = cellWidth - paddingLeft - paddingRight;
- mBubblePadding = 3.0f * scale;
RectF bubbleRect = mBubbleRect;
bubbleRect.left = 0;
bubbleRect.top = 0;
bubbleRect.right = (int) cellWidth;
- mTextWidth = bubbleWidth - mBubblePadding - mBubblePadding;
+ mTextWidth = cellWidth - paddingLeft - paddingRight;
TextPaint textPaint = mTextPaint = new TextPaint();
textPaint.setTypeface(Typeface.DEFAULT);
diff --git a/src/com/android/launcher2/WallpaperChooser.java b/src/com/android/launcher2/WallpaperChooser.java
index 8045059..bf8ba2e 100644
--- a/src/com/android/launcher2/WallpaperChooser.java
+++ b/src/com/android/launcher2/WallpaperChooser.java
@@ -38,6 +38,8 @@
import java.io.IOException;
import java.util.ArrayList;
+import com.android.launcher.R;
+
public class WallpaperChooser extends Activity implements AdapterView.OnItemSelectedListener,
OnClickListener {
private static final String TAG = "Launcher.WallpaperChooser";
@@ -76,7 +78,11 @@
mImages = new ArrayList<Integer>(24);
final Resources resources = getResources();
- final String packageName = getApplication().getPackageName();
+ // Context.getPackageName() may return the "original" package name,
+ // com.android.launcher2; Resources needs the real package name,
+ // com.android.launcher. So we ask Resources for what it thinks the
+ // package name should be.
+ final String packageName = resources.getResourcePackageName(R.array.wallpapers);
addWallpapers(resources, packageName, R.array.wallpapers);
addWallpapers(resources, packageName, R.array.extra_wallpapers);
@@ -93,6 +99,7 @@
if (thumbRes != 0) {
mThumbs.add(thumbRes);
mImages.add(res);
+ // Log.d(TAG, "addWallpapers: [" + packageName + "]: " + extra + " (" + res + ")");
}
}
}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index e64c487..824ef5f 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -44,6 +44,8 @@
import java.util.ArrayList;
+import com.android.launcher.R;
+
/**
* The workspace is a wide area with a wallpaper and a finite number of screens. Each
* screen contains a number of icons, folders or widgets the user can interact with.