diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..a9fa30a
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2008 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+#LOCAL_MODULE_TAGS := user
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := Launcher2
+
+LOCAL_OVERRIDES_PACKAGES := Launcher
+
+include $(BUILD_PACKAGE)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 0000000..af66610
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<manifest
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.launcher2"
+    >
+    
+    <permission
+        android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
+        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+        android:protectionLevel="normal"
+        android:label="@string/permlab_install_shortcut"
+        android:description="@string/permdesc_install_shortcut" />
+    <permission
+        android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
+        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+        android:protectionLevel="normal"
+        android:label="@string/permlab_uninstall_shortcut"
+        android:description="@string/permdesc_uninstall_shortcut"/>
+    <permission
+        android:name="com.android.launcher.permission.READ_SETTINGS"
+        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+        android:protectionLevel="normal"
+        android:label="@string/permlab_read_settings"
+        android:description="@string/permdesc_read_settings"/>
+    <permission
+        android:name="com.android.launcher.permission.WRITE_SETTINGS"
+        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+        android:protectionLevel="normal"
+        android:label="@string/permlab_write_settings"
+        android:description="@string/permdesc_write_settings"/>
+
+    <uses-permission android:name="android.permission.CALL_PHONE" />
+    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
+    <uses-permission android:name="android.permission.GET_TASKS" />
+    <uses-permission android:name="android.permission.READ_CONTACTS"/>
+    <uses-permission android:name="android.permission.SET_WALLPAPER" />
+    <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+    <uses-permission android:name="android.permission.BIND_APPWIDGET" />
+    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
+    <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
+    
+    <application
+        android:name="LauncherApplication"
+        android:label="@string/application_name"
+        android:icon="@drawable/ic_launcher_home">
+
+        <activity
+            android:name="Launcher"
+            android:launchMode="singleTask"
+            android:clearTaskOnLaunch="true"
+            android:stateNotNeeded="true"
+            android:theme="@style/Theme"
+            android:screenOrientation="nosensor"
+            android:windowSoftInputMode="stateUnspecified|adjustPan">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.HOME" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.MONKEY"/>
+            </intent-filter>
+        </activity>
+
+        <activity
+            android:name="WallpaperChooser"
+            android:label="@string/pick_wallpaper"
+            android:icon="@drawable/ic_launcher_wallpaper"
+            android:screenOrientation="nosensor"
+            android:finishOnCloseSystemDialogs="true">
+            <intent-filter>
+                <action android:name="android.intent.action.SET_WALLPAPER" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+
+        <!-- Enable system-default search mode for any activity in Home -->
+        <meta-data
+            android:name="android.app.default_searchable"
+            android:value="*" />
+
+        <!-- Intent received used to install shortcuts from other applications -->
+        <receiver
+            android:name=".InstallShortcutReceiver"
+            android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
+            <intent-filter>
+                <action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
+            </intent-filter>
+        </receiver>
+
+        <!-- Intent received used to uninstall shortcuts from other applications -->
+        <receiver
+            android:name=".UninstallShortcutReceiver"
+            android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
+            <intent-filter>
+                <action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
+            </intent-filter>
+        </receiver>
+
+        <!-- The settings provider contains Home's data, like the workspace favorites -->
+        <provider
+            android:name="LauncherProvider"
+            android:authorities="com.android.launcher2.settings"
+            android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
+            android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
+
+    </application>
+</manifest>
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_APACHE2
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   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.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/res/anim/fade_in_fast.xml b/res/anim/fade_in_fast.xml
new file mode 100644
index 0000000..5faef96
--- /dev/null
+++ b/res/anim/fade_in_fast.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_interpolator"
+
+    android:fromAlpha="0.0"
+    android:toAlpha="1.0"
+
+    android:duration="@android:integer/config_shortAnimTime" />
diff --git a/res/anim/fade_out_fast.xml b/res/anim/fade_out_fast.xml
new file mode 100644
index 0000000..310e007
--- /dev/null
+++ b/res/anim/fade_out_fast.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_interpolator"
+
+    android:fromAlpha="1.0"
+    android:toAlpha="0.0"
+
+    android:duration="@android:integer/config_shortAnimTime" />
diff --git a/res/color/bright_text_dark_focused.xml b/res/color/bright_text_dark_focused.xml
new file mode 100644
index 0000000..4beb72c
--- /dev/null
+++ b/res/color/bright_text_dark_focused.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_window_focused="true" android:state_focused="true" android:color="#000" />
+    <item android:state_window_focused="false" android:state_focused="true" android:color="#FFF" />
+    <item android:state_window_focused="false" android:color="#FFF" />
+    <item android:state_selected="true" android:color="#000" />
+    <item android:state_pressed="true" android:color="#000" />
+    <item android:color="#FFF" />
+</selector>
diff --git a/res/drawable-hdpi/all_apps_button_focused.png b/res/drawable-hdpi/all_apps_button_focused.png
new file mode 100644
index 0000000..94f7b08
--- /dev/null
+++ b/res/drawable-hdpi/all_apps_button_focused.png
Binary files differ
diff --git a/res/drawable-hdpi/all_apps_button_normal.png b/res/drawable-hdpi/all_apps_button_normal.png
new file mode 100644
index 0000000..188d528
--- /dev/null
+++ b/res/drawable-hdpi/all_apps_button_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/all_apps_button_pressed.png b/res/drawable-hdpi/all_apps_button_pressed.png
new file mode 100644
index 0000000..600dea9
--- /dev/null
+++ b/res/drawable-hdpi/all_apps_button_pressed.png
Binary files differ
diff --git a/res/drawable-hdpi/bg_appwidget_error.9.png b/res/drawable-hdpi/bg_appwidget_error.9.png
new file mode 100644
index 0000000..59d9822
--- /dev/null
+++ b/res/drawable-hdpi/bg_appwidget_error.9.png
Binary files differ
diff --git a/res/drawable-hdpi/box_launcher_bottom.9.png b/res/drawable-hdpi/box_launcher_bottom.9.png
new file mode 100644
index 0000000..f08c7a2
--- /dev/null
+++ b/res/drawable-hdpi/box_launcher_bottom.9.png
Binary files differ
diff --git a/res/drawable-hdpi/box_launcher_top_normal.9.png b/res/drawable-hdpi/box_launcher_top_normal.9.png
new file mode 100644
index 0000000..98997ad
--- /dev/null
+++ b/res/drawable-hdpi/box_launcher_top_normal.9.png
Binary files differ
diff --git a/res/drawable-hdpi/box_launcher_top_pressed.9.png b/res/drawable-hdpi/box_launcher_top_pressed.9.png
new file mode 100644
index 0000000..f52fd48
--- /dev/null
+++ b/res/drawable-hdpi/box_launcher_top_pressed.9.png
Binary files differ
diff --git a/res/drawable-hdpi/box_launcher_top_selected.9.png b/res/drawable-hdpi/box_launcher_top_selected.9.png
new file mode 100644
index 0000000..8cacf0e
--- /dev/null
+++ b/res/drawable-hdpi/box_launcher_top_selected.9.png
Binary files differ
diff --git a/res/drawable-hdpi/focused_application_background.9.png b/res/drawable-hdpi/focused_application_background.9.png
new file mode 100644
index 0000000..7bf37ef
--- /dev/null
+++ b/res/drawable-hdpi/focused_application_background.9.png
Binary files differ
diff --git a/res/drawable-hdpi/home_button_focused.png b/res/drawable-hdpi/home_button_focused.png
new file mode 100644
index 0000000..08b1fcb
--- /dev/null
+++ b/res/drawable-hdpi/home_button_focused.png
Binary files differ
diff --git a/res/drawable-hdpi/home_button_normal.png b/res/drawable-hdpi/home_button_normal.png
new file mode 100644
index 0000000..4afcce8
--- /dev/null
+++ b/res/drawable-hdpi/home_button_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/home_button_pressed.png b/res/drawable-hdpi/home_button_pressed.png
new file mode 100644
index 0000000..aa91732
--- /dev/null
+++ b/res/drawable-hdpi/home_button_pressed.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_focus.png b/res/drawable-hdpi/ic_home_arrows_1_focus.png
new file mode 100644
index 0000000..fd95862
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_focus.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_focus_right.png b/res/drawable-hdpi/ic_home_arrows_1_focus_right.png
new file mode 100644
index 0000000..2a7059f
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_focus_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_normal.png b/res/drawable-hdpi/ic_home_arrows_1_normal.png
new file mode 100644
index 0000000..c72a4bf
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_normal_right.png b/res/drawable-hdpi/ic_home_arrows_1_normal_right.png
new file mode 100644
index 0000000..90819e6
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_normal_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_press.png b/res/drawable-hdpi/ic_home_arrows_1_press.png
new file mode 100644
index 0000000..70011d7
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_press.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_1_press_right.png b/res/drawable-hdpi/ic_home_arrows_1_press_right.png
new file mode 100644
index 0000000..45ea6f8
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_1_press_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_focus.png b/res/drawable-hdpi/ic_home_arrows_2_focus.png
new file mode 100644
index 0000000..1f1164a
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_focus.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_focus_right.png b/res/drawable-hdpi/ic_home_arrows_2_focus_right.png
new file mode 100644
index 0000000..330ee39
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_focus_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_normal.png b/res/drawable-hdpi/ic_home_arrows_2_normal.png
new file mode 100644
index 0000000..dc01737
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_normal_right.png b/res/drawable-hdpi/ic_home_arrows_2_normal_right.png
new file mode 100644
index 0000000..dc843c6
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_normal_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_press.png b/res/drawable-hdpi/ic_home_arrows_2_press.png
new file mode 100644
index 0000000..294b331
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_press.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_2_press_right.png b/res/drawable-hdpi/ic_home_arrows_2_press_right.png
new file mode 100644
index 0000000..4fc9d0f
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_2_press_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_focus.png b/res/drawable-hdpi/ic_home_arrows_3_focus.png
new file mode 100644
index 0000000..7ada5ca
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_focus.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_focus_right.png b/res/drawable-hdpi/ic_home_arrows_3_focus_right.png
new file mode 100644
index 0000000..98d76ef
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_focus_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_normal.png b/res/drawable-hdpi/ic_home_arrows_3_normal.png
new file mode 100644
index 0000000..1ee2372
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_normal_right.png b/res/drawable-hdpi/ic_home_arrows_3_normal_right.png
new file mode 100644
index 0000000..90a93fa
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_normal_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_press.png b/res/drawable-hdpi/ic_home_arrows_3_press.png
new file mode 100644
index 0000000..7c98a29
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_press.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_3_press_right.png b/res/drawable-hdpi/ic_home_arrows_3_press_right.png
new file mode 100644
index 0000000..5cfd28c
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_3_press_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_focus.png b/res/drawable-hdpi/ic_home_arrows_4_focus.png
new file mode 100644
index 0000000..84f3a7b
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_focus.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_focus_right.png b/res/drawable-hdpi/ic_home_arrows_4_focus_right.png
new file mode 100644
index 0000000..813f863
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_focus_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_normal.png b/res/drawable-hdpi/ic_home_arrows_4_normal.png
new file mode 100644
index 0000000..477f725
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_normal.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_normal_right.png b/res/drawable-hdpi/ic_home_arrows_4_normal_right.png
new file mode 100644
index 0000000..f8a8612
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_normal_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_press.png b/res/drawable-hdpi/ic_home_arrows_4_press.png
new file mode 100644
index 0000000..7b8f207
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_press.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_arrows_4_press_right.png b/res/drawable-hdpi/ic_home_arrows_4_press_right.png
new file mode 100644
index 0000000..4d9c2ca
--- /dev/null
+++ b/res/drawable-hdpi/ic_home_arrows_4_press_right.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_application.png b/res/drawable-hdpi/ic_launcher_application.png
new file mode 100644
index 0000000..8074c4c
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_application.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_appwidget.png b/res/drawable-hdpi/ic_launcher_appwidget.png
new file mode 100644
index 0000000..3dc8b20
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_appwidget.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_folder.png b/res/drawable-hdpi/ic_launcher_folder.png
new file mode 100644
index 0000000..dd71327
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_folder.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_folder_open.png b/res/drawable-hdpi/ic_launcher_folder_open.png
new file mode 100644
index 0000000..5b3fcec
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_folder_open.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_home.png b/res/drawable-hdpi/ic_launcher_home.png
new file mode 100644
index 0000000..74f6bd7
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_home.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_shortcut.png b/res/drawable-hdpi/ic_launcher_shortcut.png
new file mode 100644
index 0000000..93ab2df
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_shortcut.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_wallpaper.png b/res/drawable-hdpi/ic_launcher_wallpaper.png
new file mode 100644
index 0000000..dcd8709
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_wallpaper.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_search_widget.png b/res/drawable-hdpi/ic_search_widget.png
new file mode 100644
index 0000000..06b9b25
--- /dev/null
+++ b/res/drawable-hdpi/ic_search_widget.png
Binary files differ
diff --git a/res/drawable-hdpi/pattern_carbon_fiber_dark.png b/res/drawable-hdpi/pattern_carbon_fiber_dark.png
new file mode 100644
index 0000000..427936f
--- /dev/null
+++ b/res/drawable-hdpi/pattern_carbon_fiber_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/placeholder_google.png b/res/drawable-hdpi/placeholder_google.png
new file mode 100644
index 0000000..923c8b8
--- /dev/null
+++ b/res/drawable-hdpi/placeholder_google.png
Binary files differ
diff --git a/res/drawable-hdpi/preview_bg.9.png b/res/drawable-hdpi/preview_bg.9.png
new file mode 100644
index 0000000..5647144
--- /dev/null
+++ b/res/drawable-hdpi/preview_bg.9.png
Binary files differ
diff --git a/res/drawable-hdpi/preview_bg_focus.9.png b/res/drawable-hdpi/preview_bg_focus.9.png
new file mode 100644
index 0000000..31200fd
--- /dev/null
+++ b/res/drawable-hdpi/preview_bg_focus.9.png
Binary files differ
diff --git a/res/drawable-hdpi/preview_bg_press.9.png b/res/drawable-hdpi/preview_bg_press.9.png
new file mode 100644
index 0000000..9cb1266
--- /dev/null
+++ b/res/drawable-hdpi/preview_bg_press.9.png
Binary files differ
diff --git a/res/drawable-hdpi/search_button_bg.9.png b/res/drawable-hdpi/search_button_bg.9.png
new file mode 100644
index 0000000..9fba3d1
--- /dev/null
+++ b/res/drawable-hdpi/search_button_bg.9.png
Binary files differ
diff --git a/res/drawable-hdpi/search_button_voice.png b/res/drawable-hdpi/search_button_voice.png
new file mode 100644
index 0000000..a60f7d9
--- /dev/null
+++ b/res/drawable-hdpi/search_button_voice.png
Binary files differ
diff --git a/res/drawable-hdpi/search_floater.9.png b/res/drawable-hdpi/search_floater.9.png
new file mode 100644
index 0000000..02441d0
--- /dev/null
+++ b/res/drawable-hdpi/search_floater.9.png
Binary files differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_default.9.png b/res/drawable-hdpi/textfield_searchwidget_default.9.png
new file mode 100644
index 0000000..2fe637d
--- /dev/null
+++ b/res/drawable-hdpi/textfield_searchwidget_default.9.png
Binary files differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_pressed.9.png b/res/drawable-hdpi/textfield_searchwidget_pressed.9.png
new file mode 100644
index 0000000..58af9ba
--- /dev/null
+++ b/res/drawable-hdpi/textfield_searchwidget_pressed.9.png
Binary files differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_selected.9.png b/res/drawable-hdpi/textfield_searchwidget_selected.9.png
new file mode 100644
index 0000000..8a84fdc
--- /dev/null
+++ b/res/drawable-hdpi/textfield_searchwidget_selected.9.png
Binary files differ
diff --git a/res/drawable-hdpi/trashcan.png b/res/drawable-hdpi/trashcan.png
new file mode 100644
index 0000000..d356f45
--- /dev/null
+++ b/res/drawable-hdpi/trashcan.png
Binary files differ
diff --git a/res/drawable-hdpi/trashcan_hover.png b/res/drawable-hdpi/trashcan_hover.png
new file mode 100644
index 0000000..7dda19e
--- /dev/null
+++ b/res/drawable-hdpi/trashcan_hover.png
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_bluedotgrid.jpg b/res/drawable-hdpi/wallpaper_bluedotgrid.jpg
new file mode 100644
index 0000000..468edfe
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_bluedotgrid.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_bluedotgrid_small.jpg b/res/drawable-hdpi/wallpaper_bluedotgrid_small.jpg
new file mode 100644
index 0000000..1ff9568
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_bluedotgrid_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_brown.jpg b/res/drawable-hdpi/wallpaper_brown.jpg
new file mode 100644
index 0000000..9b7ef20
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_brown.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_brown_small.jpg b/res/drawable-hdpi/wallpaper_brown_small.jpg
new file mode 100644
index 0000000..e5b417e
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_brown_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_canyon.jpg b/res/drawable-hdpi/wallpaper_canyon.jpg
new file mode 100644
index 0000000..1b129fd
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_canyon.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_canyon_small.jpg b/res/drawable-hdpi/wallpaper_canyon_small.jpg
new file mode 100644
index 0000000..fd4d72f
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_canyon_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_cloud.jpg b/res/drawable-hdpi/wallpaper_cloud.jpg
new file mode 100644
index 0000000..f3b5545
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_cloud.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_cloud_small.jpg b/res/drawable-hdpi/wallpaper_cloud_small.jpg
new file mode 100644
index 0000000..0e4c14c
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_cloud_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_desert.jpg b/res/drawable-hdpi/wallpaper_desert.jpg
new file mode 100644
index 0000000..47daa79
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_desert.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_desert_small.jpg b/res/drawable-hdpi/wallpaper_desert_small.jpg
new file mode 100644
index 0000000..9252d36
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_desert_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_despair.jpg b/res/drawable-hdpi/wallpaper_despair.jpg
new file mode 100644
index 0000000..57e8235
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_despair.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_despair_small.jpg b/res/drawable-hdpi/wallpaper_despair_small.jpg
new file mode 100644
index 0000000..fc8e3c6
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_despair_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_electric.jpg b/res/drawable-hdpi/wallpaper_electric.jpg
new file mode 100644
index 0000000..f7800af
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_electric.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_electric_small.jpg b/res/drawable-hdpi/wallpaper_electric_small.jpg
new file mode 100644
index 0000000..66dd573
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_electric_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_field.jpg b/res/drawable-hdpi/wallpaper_field.jpg
new file mode 100644
index 0000000..5bab9b5
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_field.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_field_small.jpg b/res/drawable-hdpi/wallpaper_field_small.jpg
new file mode 100644
index 0000000..20d9a48
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_field_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_galaxy.jpg b/res/drawable-hdpi/wallpaper_galaxy.jpg
new file mode 100644
index 0000000..de0f3ff
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_galaxy.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_galaxy_small.jpg b/res/drawable-hdpi/wallpaper_galaxy_small.jpg
new file mode 100644
index 0000000..69d48a2
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_galaxy_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_goldengate.jpg b/res/drawable-hdpi/wallpaper_goldengate.jpg
new file mode 100644
index 0000000..2271091
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_goldengate.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_goldengate_small.jpg b/res/drawable-hdpi/wallpaper_goldengate_small.jpg
new file mode 100644
index 0000000..e9aca1e
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_goldengate_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_grass.jpg b/res/drawable-hdpi/wallpaper_grass.jpg
new file mode 100644
index 0000000..e9dc541
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_grass.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_grass_night.jpg b/res/drawable-hdpi/wallpaper_grass_night.jpg
new file mode 100644
index 0000000..b9c74c9
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_grass_night.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_grass_night_small.jpg b/res/drawable-hdpi/wallpaper_grass_night_small.jpg
new file mode 100644
index 0000000..353eb18
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_grass_night_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_grass_small.jpg b/res/drawable-hdpi/wallpaper_grass_small.jpg
new file mode 100644
index 0000000..dc45738
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_grass_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_gray.jpg b/res/drawable-hdpi/wallpaper_gray.jpg
new file mode 100644
index 0000000..913f053
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_gray.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_gray_small.jpg b/res/drawable-hdpi/wallpaper_gray_small.jpg
new file mode 100644
index 0000000..d083a74
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_gray_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_greengray.jpg b/res/drawable-hdpi/wallpaper_greengray.jpg
new file mode 100644
index 0000000..1f3c86c
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_greengray.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_greengray_small.jpg b/res/drawable-hdpi/wallpaper_greengray_small.jpg
new file mode 100644
index 0000000..ebf7066
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_greengray_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_hazybluedots.jpg b/res/drawable-hdpi/wallpaper_hazybluedots.jpg
new file mode 100644
index 0000000..fe6aeb4
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_hazybluedots.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_hazybluedots_small.jpg b/res/drawable-hdpi/wallpaper_hazybluedots_small.jpg
new file mode 100644
index 0000000..c645dea
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_hazybluedots_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_lightgrad.jpg b/res/drawable-hdpi/wallpaper_lightgrad.jpg
new file mode 100644
index 0000000..35a45fa
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_lightgrad.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_lightgrad_small.jpg b/res/drawable-hdpi/wallpaper_lightgrad_small.jpg
new file mode 100644
index 0000000..f909da7
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_lightgrad_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_monumentvalley.jpg b/res/drawable-hdpi/wallpaper_monumentvalley.jpg
new file mode 100644
index 0000000..1bb5f2c
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_monumentvalley.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_monumentvalley_small.jpg b/res/drawable-hdpi/wallpaper_monumentvalley_small.jpg
new file mode 100644
index 0000000..9ea3309
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_monumentvalley_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexuspattern.jpg b/res/drawable-hdpi/wallpaper_nexuspattern.jpg
new file mode 100644
index 0000000..212a7b1
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexuspattern.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexuspattern_small.jpg b/res/drawable-hdpi/wallpaper_nexuspattern_small.jpg
new file mode 100644
index 0000000..8e474a5
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexuspattern_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexusrain.jpg b/res/drawable-hdpi/wallpaper_nexusrain.jpg
new file mode 100644
index 0000000..46c2971
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexusrain.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexusrain_small.jpg b/res/drawable-hdpi/wallpaper_nexusrain_small.jpg
new file mode 100644
index 0000000..a239339
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexusrain_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexuswallpaper1.png b/res/drawable-hdpi/wallpaper_nexuswallpaper1.png
new file mode 100644
index 0000000..2856da0
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexuswallpaper1.png
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_nexuswallpaper1_small.jpg b/res/drawable-hdpi/wallpaper_nexuswallpaper1_small.jpg
new file mode 100644
index 0000000..70882bb
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_nexuswallpaper1_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_pcut.jpg b/res/drawable-hdpi/wallpaper_pcut.jpg
new file mode 100644
index 0000000..bb9914d
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_pcut.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_pcut_small.jpg b/res/drawable-hdpi/wallpaper_pcut_small.jpg
new file mode 100644
index 0000000..bd19775
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_pcut_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_ropelights.jpg b/res/drawable-hdpi/wallpaper_ropelights.jpg
new file mode 100644
index 0000000..ca7862f
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_ropelights.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_ropelights_small.jpg b/res/drawable-hdpi/wallpaper_ropelights_small.jpg
new file mode 100644
index 0000000..ac6fb29
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_ropelights_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_tree.jpg b/res/drawable-hdpi/wallpaper_tree.jpg
new file mode 100644
index 0000000..f998bea
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_tree.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_tree_small.jpg b/res/drawable-hdpi/wallpaper_tree_small.jpg
new file mode 100644
index 0000000..425305a
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_tree_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_x67.jpg b/res/drawable-hdpi/wallpaper_x67.jpg
new file mode 100644
index 0000000..400aa27
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_x67.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_x67_small.jpg b/res/drawable-hdpi/wallpaper_x67_small.jpg
new file mode 100644
index 0000000..10e0faa
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_x67_small.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_zanzibar.jpg b/res/drawable-hdpi/wallpaper_zanzibar.jpg
new file mode 100644
index 0000000..9218895
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_zanzibar.jpg
Binary files differ
diff --git a/res/drawable-hdpi/wallpaper_zanzibar_small.jpg b/res/drawable-hdpi/wallpaper_zanzibar_small.jpg
new file mode 100644
index 0000000..affdc8c
--- /dev/null
+++ b/res/drawable-hdpi/wallpaper_zanzibar_small.jpg
Binary files differ
diff --git a/res/drawable/all_apps_button.xml b/res/drawable/all_apps_button.xml
new file mode 100644
index 0000000..9f6b8ac
--- /dev/null
+++ b/res/drawable/all_apps_button.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/all_apps_button_pressed" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/all_apps_button_focused" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/all_apps_button_normal" />
+    <item android:drawable="@drawable/all_apps_button_normal" />
+</selector>
+
diff --git a/res/drawable/box_launcher_top.xml b/res/drawable/box_launcher_top.xml
new file mode 100644
index 0000000..20c07c4
--- /dev/null
+++ b/res/drawable/box_launcher_top.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/box_launcher_top_pressed" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/box_launcher_top_selected" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/box_launcher_top_normal" />
+    <item android:drawable="@drawable/box_launcher_top_normal" />
+</selector>
+
diff --git a/res/drawable/delete_zone_selector.xml b/res/drawable/delete_zone_selector.xml
new file mode 100644
index 0000000..0c54b1d7
--- /dev/null
+++ b/res/drawable/delete_zone_selector.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+*/
+-->
+
+<transition xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/trashcan"  />
+    <item android:drawable="@drawable/trashcan_hover"  />
+</transition>
diff --git a/res/drawable/grid_selector.xml b/res/drawable/grid_selector.xml
new file mode 100644
index 0000000..009cfe1
--- /dev/null
+++ b/res/drawable/grid_selector.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+*/
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/pressed_application_background" />
+    <item android:state_focused="false" android:drawable="@drawable/focused_application_background" />
+    <item android:state_window_focused="true" android:drawable="@drawable/focused_application_background" />
+    <item android:state_window_focused="false" android:drawable="@android:color/transparent" />
+</selector>
diff --git a/res/drawable/home_arrows_left.xml b/res/drawable/home_arrows_left.xml
new file mode 100644
index 0000000..82df258
--- /dev/null
+++ b/res/drawable/home_arrows_left.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:maxLevel="0" android:drawable="@android:color/transparent" />
+    <item android:maxLevel="1" android:drawable="@drawable/home_arrows_left_1" />
+    <item android:maxLevel="2" android:drawable="@drawable/home_arrows_left_2" />
+    <item android:maxLevel="3" android:drawable="@drawable/home_arrows_left_3" />
+    <item android:maxLevel="4" android:drawable="@drawable/home_arrows_left_4" />
+</level-list>
diff --git a/res/drawable/home_arrows_left_1.xml b/res/drawable/home_arrows_left_1.xml
new file mode 100644
index 0000000..f61f39e
--- /dev/null
+++ b/res/drawable/home_arrows_left_1.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_1_press" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_1_focus" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_1_normal" />
+    <item android:drawable="@drawable/ic_home_arrows_1_normal" />
+</selector>
diff --git a/res/drawable/home_arrows_left_2.xml b/res/drawable/home_arrows_left_2.xml
new file mode 100644
index 0000000..888a258
--- /dev/null
+++ b/res/drawable/home_arrows_left_2.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_2_press" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_2_focus" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_2_normal" />
+    <item android:drawable="@drawable/ic_home_arrows_2_normal" />
+</selector>
diff --git a/res/drawable/home_arrows_left_3.xml b/res/drawable/home_arrows_left_3.xml
new file mode 100644
index 0000000..4dbdf15
--- /dev/null
+++ b/res/drawable/home_arrows_left_3.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_3_press" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_3_focus" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_3_normal" />
+    <item android:drawable="@drawable/ic_home_arrows_3_normal" />
+</selector>
diff --git a/res/drawable/home_arrows_left_4.xml b/res/drawable/home_arrows_left_4.xml
new file mode 100644
index 0000000..31b381d
--- /dev/null
+++ b/res/drawable/home_arrows_left_4.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_4_press" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_4_focus" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_4_normal" />
+    <item android:drawable="@drawable/ic_home_arrows_4_normal" />
+</selector>
diff --git a/res/drawable/home_arrows_right.xml b/res/drawable/home_arrows_right.xml
new file mode 100644
index 0000000..8ab0dec
--- /dev/null
+++ b/res/drawable/home_arrows_right.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:maxLevel="0" android:drawable="@drawable/home_arrows_right_4" />
+    <item android:maxLevel="1" android:drawable="@drawable/home_arrows_right_3" />
+    <item android:maxLevel="2" android:drawable="@drawable/home_arrows_right_2" />
+    <item android:maxLevel="3" android:drawable="@drawable/home_arrows_right_1" />
+    <item android:maxLevel="4" android:drawable="@android:color/transparent" />
+</level-list>
diff --git a/res/drawable/home_arrows_right_1.xml b/res/drawable/home_arrows_right_1.xml
new file mode 100644
index 0000000..f49b760
--- /dev/null
+++ b/res/drawable/home_arrows_right_1.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_1_press_right" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_1_focus_right" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_1_normal_right" />
+    <item android:drawable="@drawable/ic_home_arrows_1_normal_right" />
+</selector>
diff --git a/res/drawable/home_arrows_right_2.xml b/res/drawable/home_arrows_right_2.xml
new file mode 100644
index 0000000..17318a3
--- /dev/null
+++ b/res/drawable/home_arrows_right_2.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_2_press_right" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_2_focus_right" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_2_normal_right" />
+    <item android:drawable="@drawable/ic_home_arrows_2_normal_right" />
+</selector>
diff --git a/res/drawable/home_arrows_right_3.xml b/res/drawable/home_arrows_right_3.xml
new file mode 100644
index 0000000..375f8e3
--- /dev/null
+++ b/res/drawable/home_arrows_right_3.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_3_press_right" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_3_focus_right" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_3_normal_right" />
+    <item android:drawable="@drawable/ic_home_arrows_3_normal_right" />
+</selector>
diff --git a/res/drawable/home_arrows_right_4.xml b/res/drawable/home_arrows_right_4.xml
new file mode 100644
index 0000000..06627c6
--- /dev/null
+++ b/res/drawable/home_arrows_right_4.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/ic_home_arrows_4_press_right" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/ic_home_arrows_4_focus_right" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/ic_home_arrows_4_normal_right" />
+    <item android:drawable="@drawable/ic_home_arrows_4_normal_right" />
+</selector>
diff --git a/res/drawable/pressed_application_background.9.png b/res/drawable/pressed_application_background.9.png
new file mode 100644
index 0000000..b09f595
--- /dev/null
+++ b/res/drawable/pressed_application_background.9.png
Binary files differ
diff --git a/res/drawable/preview_background.xml b/res/drawable/preview_background.xml
new file mode 100644
index 0000000..0054aa0
--- /dev/null
+++ b/res/drawable/preview_background.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/preview_bg_press" />
+    <item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/preview_bg_focus" />
+    <item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/preview_bg" />
+    <item android:drawable="@drawable/preview_bg" />
+</selector>
diff --git a/res/drawable/shortcut_selector.xml b/res/drawable/shortcut_selector.xml
new file mode 100644
index 0000000..884bccf
--- /dev/null
+++ b/res/drawable/shortcut_selector.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+*/
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/pressed_application_background" />
+    <item android:state_window_focused="true" android:state_focused="true" android:drawable="@drawable/focused_application_background" />
+    <item android:state_window_focused="false" android:state_focused="true" android:drawable="@android:color/transparent" />
+</selector>
diff --git a/res/drawable/textfield_searchwidget.xml b/res/drawable/textfield_searchwidget.xml
new file mode 100644
index 0000000..80f3dca
--- /dev/null
+++ b/res/drawable/textfield_searchwidget.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    
+﻿   <item android:state_window_focused="false" android:state_enabled="true"
+        android:drawable="@drawable/textfield_searchwidget_default" />
+    
+    <item android:state_pressed="true"
+        android:drawable="@drawable/textfield_searchwidget_pressed" />
+    
+    <item android:state_enabled="true" android:state_focused="true"
+        android:drawable="@drawable/textfield_searchwidget_selected" />
+    
+    <item android:state_enabled="true"
+        android:drawable="@drawable/textfield_searchwidget_default" />
+    
+</selector>
diff --git a/res/layout-land/application.xml b/res/layout-land/application.xml
new file mode 100644
index 0000000..6de5658
--- /dev/null
+++ b/res/layout-land/application.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Landscape" />
diff --git a/res/layout-land/application_boxed.xml b/res/layout-land/application_boxed.xml
new file mode 100644
index 0000000..7656b58
--- /dev/null
+++ b/res/layout-land/application_boxed.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/name"
+    android:layout_width="fill_parent"
+    android:layout_height="88dip"
+
+    android:paddingLeft="2dip"
+    android:paddingRight="2dip"
+    android:paddingTop="5dip"
+    android:paddingBottom="2dip"
+    android:drawablePadding="0dip"
+
+    android:textSize="13dip"
+    android:maxLines="2"
+    android:ellipsize="marquee"
+    android:fadingEdge="horizontal"
+    android:textColor="@color/bright_text_dark_focused"
+    android:gravity="top|center_horizontal" />
diff --git a/res/layout-land/folder_icon.xml b/res/layout-land/folder_icon.xml
new file mode 100644
index 0000000..c76a756
--- /dev/null
+++ b/res/layout-land/folder_icon.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.FolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Landscape" />
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
new file mode 100644
index 0000000..d2009b8
--- /dev/null
+++ b/res/layout-land/launcher.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<com.android.launcher2.DragLayer
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+
+    android:id="@+id/drag_layer"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+
+    <com.android.launcher2.AllAppsView
+        android:id="@+id/all_apps_view"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+
+        android:scrollbarStyle="outsideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="4" />
+
+    <!-- The workspace contains 3 screens of cells -->
+    <com.android.launcher2.Workspace
+        android:id="@+id/workspace"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:scrollbars="horizontal"
+        android:fadeScrollbars="true"
+        launcher:defaultScreen="2">
+
+        <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
+
+    </com.android.launcher2.Workspace>
+
+    <ImageView
+        android:id="@+id/previous_screen"
+        android:layout_width="93dip"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|left"
+        android:layout_marginLeft="6dip"
+
+        android:src="@drawable/home_arrows_left"
+        
+        android:onClick="previousScreen"
+
+        android:focusable="true"
+        android:clickable="true" />
+
+    <ImageView
+        android:id="@+id/next_screen"
+        android:layout_width="93dip"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|right"
+        android:layout_marginRight="6dip"
+
+        android:src="@drawable/home_arrows_right"
+        
+        android:onClick="nextScreen"
+        
+        android:focusable="true"
+        android:clickable="true" />
+
+    <com.android.launcher2.HandleView
+        android:id="@+id/all_apps_button"
+        android:layout_width="@dimen/button_bar_height"
+        android:layout_height="fill_parent"
+        android:layout_gravity="right|center_vertical"
+
+        android:focusable="true"
+        android:clickable="true"
+
+        android:scaleType="center"
+        android:src="@drawable/all_apps_button"
+        launcher:direction="vertical"
+        />
+
+    <com.android.launcher2.DeleteZone
+        android:id="@+id/delete_zone"
+        android:layout_width="49dip"
+        android:layout_height="fill_parent"
+
+        android:scaleType="center"
+        android:src="@drawable/delete_zone_selector"
+        android:visibility="invisible"
+        launcher:direction="vertical"
+        />
+
+</com.android.launcher2.DragLayer>
diff --git a/res/layout-land/live_folder_grid.xml b/res/layout-land/live_folder_grid.xml
new file mode 100644
index 0000000..572c295
--- /dev/null
+++ b/res/layout-land/live_folder_grid.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<com.android.launcher2.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical">
+    
+    <Button
+        android:id="@+id/folder_close"
+    	android:background="@drawable/box_launcher_top"
+        android:gravity="left|center_vertical"
+        android:textSize="14sp"
+        android:textColor="#404040"
+        android:textStyle="bold"
+        android:layout_width="fill_parent"
+    	android:layout_height="wrap_content" />
+
+    <GridView
+        android:id="@+id/folder_content"
+        android:layout_width="fill_parent"
+    	android:layout_height="0dip"
+    	android:layout_weight="1"
+            
+        android:cacheColorHint="#ff333333"
+        android:background="@drawable/box_launcher_bottom"
+
+        android:scrollbarAlwaysDrawVerticalTrack="true"
+        android:scrollbarStyle="insideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="5" />
+
+</com.android.launcher2.LiveFolder>
diff --git a/res/layout-land/live_folder_icon.xml b/res/layout-land/live_folder_icon.xml
new file mode 100644
index 0000000..64c2d44
--- /dev/null
+++ b/res/layout-land/live_folder_icon.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<com.android.launcher2.LiveFolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Landscape" />
diff --git a/res/layout-land/user_folder.xml b/res/layout-land/user_folder.xml
new file mode 100644
index 0000000..645c02f
--- /dev/null
+++ b/res/layout-land/user_folder.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.UserFolder xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical">
+    
+    <Button
+        android:id="@+id/folder_close"
+    	android:background="@drawable/box_launcher_top"
+        android:gravity="left|center_vertical"
+        android:textSize="14sp"
+        android:textColor="#404040"
+        android:textStyle="bold"
+        android:layout_width="fill_parent"
+    	android:layout_height="wrap_content" />
+
+    <GridView
+        android:id="@id/folder_content"
+        android:layout_width="fill_parent"
+    	android:layout_height="0dip"
+    	android:layout_weight="1"
+            
+        android:cacheColorHint="#ff333333"
+        android:background="@drawable/box_launcher_bottom"
+
+        android:scrollbarAlwaysDrawVerticalTrack="true"
+        android:scrollbarStyle="insideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="5" />
+
+</com.android.launcher2.UserFolder>
diff --git a/res/layout-land/workspace_screen.xml b/res/layout-land/workspace_screen.xml
new file mode 100644
index 0000000..531bac2
--- /dev/null
+++ b/res/layout-land/workspace_screen.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.CellLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+
+    launcher:cellWidth="@dimen/workspace_cell_width"
+    launcher:cellHeight="@dimen/workspace_cell_height"
+    launcher:longAxisStartPadding="0dip"
+    launcher:longAxisEndPadding="55dip"
+    launcher:shortAxisStartPadding="0dip"
+    launcher:shortAxisEndPadding="0dip"
+    launcher:shortAxisCells="4"
+    launcher:longAxisCells="4" />
diff --git a/res/layout-port/application.xml b/res/layout-port/application.xml
new file mode 100644
index 0000000..f904a66
--- /dev/null
+++ b/res/layout-port/application.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Portrait" />
diff --git a/res/layout-port/application_boxed.xml b/res/layout-port/application_boxed.xml
new file mode 100644
index 0000000..a6991d5
--- /dev/null
+++ b/res/layout-port/application_boxed.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/name"
+    android:layout_width="fill_parent"
+    android:layout_height="88dip"
+
+    android:paddingLeft="2dip"
+    android:paddingRight="2dip"
+    android:paddingTop="5dip"
+    android:paddingBottom="2dip"
+    android:drawablePadding="0dip"
+        
+    android:textSize="13dip"
+    android:maxLines="2"
+    android:ellipsize="marquee"
+    android:fadingEdge="horizontal"
+    android:textColor="@color/bright_text_dark_focused"
+    android:gravity="top|center_horizontal" />
diff --git a/res/layout-port/folder_icon.xml b/res/layout-port/folder_icon.xml
new file mode 100644
index 0000000..49049cf
--- /dev/null
+++ b/res/layout-port/folder_icon.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.FolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Portrait" />
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
new file mode 100644
index 0000000..001f3e3
--- /dev/null
+++ b/res/layout-port/launcher.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<com.android.launcher2.DragLayer
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+
+    android:id="@+id/drag_layer"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+
+    <com.android.launcher2.AllAppsView
+        android:id="@+id/all_apps_view"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+
+        android:scrollbarStyle="outsideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="4"
+        />
+
+    <!-- The workspace contains 3 screens of cells -->
+    <com.android.launcher2.Workspace
+        android:id="@+id/workspace"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        launcher:defaultScreen="2">
+
+        <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
+        <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
+                
+    </com.android.launcher2.Workspace>
+
+    <ImageView
+        android:id="@+id/previous_screen"
+        android:layout_width="93dip"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|left"
+        android:layout_marginLeft="6dip"
+
+        android:src="@drawable/home_arrows_left"
+        
+        android:onClick="previousScreen"
+
+        android:focusable="true"
+        android:clickable="true" />
+
+    <ImageView
+        android:id="@+id/next_screen"
+        android:layout_width="93dip"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|right"
+        android:layout_marginRight="6dip"
+
+        android:src="@drawable/home_arrows_right"
+        
+        android:onClick="nextScreen"
+        
+        android:focusable="true"
+        android:clickable="true" />
+
+    <com.android.launcher2.HandleView
+        android:id="@+id/all_apps_button"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|center_horizontal"
+
+        android:focusable="true"
+        android:clickable="true"
+
+        android:scaleType="center"
+        android:src="@drawable/all_apps_button"
+        launcher:direction="horizontal"
+        />
+
+    <com.android.launcher2.DeleteZone
+        android:id="@+id/delete_zone"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/button_bar_height"
+        android:layout_gravity="bottom|center_horizontal"
+
+        android:scaleType="center"
+        android:src="@drawable/delete_zone_selector"
+        android:visibility="invisible"
+        launcher:direction="horizontal"
+        />
+
+</com.android.launcher2.DragLayer>
diff --git a/res/layout-port/live_folder_grid.xml b/res/layout-port/live_folder_grid.xml
new file mode 100644
index 0000000..51e5e47
--- /dev/null
+++ b/res/layout-port/live_folder_grid.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<com.android.launcher2.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical">
+        
+    <Button
+        android:id="@+id/folder_close"
+   		android:background="@drawable/box_launcher_top"
+        android:gravity="left|center_vertical"
+        android:textSize="14sp"
+        android:textColor="#404040"
+        android:textStyle="bold"
+        android:layout_width="fill_parent"
+    	android:layout_height="wrap_content" />
+
+    <GridView
+        android:id="@id/folder_content"
+        android:layout_width="fill_parent"
+    	android:layout_height="0dip"
+    	android:layout_weight="1"
+
+        android:cacheColorHint="#ff333333"
+        android:background="@drawable/box_launcher_bottom"
+
+        android:scrollbarAlwaysDrawVerticalTrack="true"
+        android:scrollbarStyle="insideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="4" />
+
+</com.android.launcher2.LiveFolder>
diff --git a/res/layout-port/live_folder_icon.xml b/res/layout-port/live_folder_icon.xml
new file mode 100644
index 0000000..e3cd49e
--- /dev/null
+++ b/res/layout-port/live_folder_icon.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<com.android.launcher2.LiveFolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
+ 	style="@style/WorkspaceIcon.Portrait" />
diff --git a/res/layout-port/user_folder.xml b/res/layout-port/user_folder.xml
new file mode 100644
index 0000000..6a189dc
--- /dev/null
+++ b/res/layout-port/user_folder.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.UserFolder xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical">
+        
+    <Button
+        android:id="@+id/folder_close"
+   		android:background="@drawable/box_launcher_top"
+        android:gravity="left|center_vertical"
+        android:textSize="14sp"
+        android:textColor="#404040"
+        android:textStyle="bold"
+        android:layout_width="fill_parent"
+    	android:layout_height="wrap_content" />
+
+    <GridView
+        android:id="@id/folder_content"
+        android:layout_width="fill_parent"
+    	android:layout_height="0dip"
+    	android:layout_weight="1"
+
+        android:cacheColorHint="#ff333333"
+        android:background="@drawable/box_launcher_bottom"
+
+        android:scrollbarAlwaysDrawVerticalTrack="true"
+        android:scrollbarStyle="insideInset"
+        android:drawSelectorOnTop="false"
+        android:listSelector="@drawable/grid_selector"
+
+        android:verticalSpacing="10dip"
+        android:numColumns="4" />
+
+</com.android.launcher2.UserFolder>
diff --git a/res/layout-port/workspace_screen.xml b/res/layout-port/workspace_screen.xml
new file mode 100644
index 0000000..531bac2
--- /dev/null
+++ b/res/layout-port/workspace_screen.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.CellLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+
+    launcher:cellWidth="@dimen/workspace_cell_width"
+    launcher:cellHeight="@dimen/workspace_cell_height"
+    launcher:longAxisStartPadding="0dip"
+    launcher:longAxisEndPadding="55dip"
+    launcher:shortAxisStartPadding="0dip"
+    launcher:shortAxisEndPadding="0dip"
+    launcher:shortAxisCells="4"
+    launcher:longAxisCells="4" />
diff --git a/res/layout/add_list_item.xml b/res/layout/add_list_item.xml
new file mode 100644
index 0000000..f276511
--- /dev/null
+++ b/res/layout/add_list_item.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:textAppearance="?android:attr/textAppearanceLargeInverse"
+    android:gravity="center_vertical"
+    android:drawablePadding="14dip"
+    android:paddingLeft="15dip"
+    android:paddingRight="15dip" />
diff --git a/res/layout/application_list.xml b/res/layout/application_list.xml
new file mode 100644
index 0000000..29f7400
--- /dev/null
+++ b/res/layout/application_list.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="?android:attr/listPreferredItemHeight"
+
+    android:paddingLeft="10dip"
+
+    android:orientation="horizontal">
+
+    <ImageView android:id="@+id/icon"
+        android:layout_width="@android:dimen/app_icon_size"
+        android:layout_height="@android:dimen/app_icon_size"
+        android:layout_gravity="center_vertical"
+        android:scaleType="fitCenter" />
+
+    <LinearLayout
+        android:layout_width="0dip"
+        android:layout_weight="1.0"
+        android:layout_height="fill_parent"
+
+        android:paddingLeft="8dip"
+        android:paddingRight="8dip"
+
+        android:orientation="vertical"
+        android:gravity="center_vertical">
+
+        <TextView android:id="@+id/name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+
+            android:singleLine="true"
+            android:ellipsize="end"
+
+            android:textAppearance="?android:attr/textAppearanceLarge" />
+
+        <TextView android:id="@+id/description"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+
+            android:layout_below="@id/name"
+            android:layout_alignLeft="@id/name"
+
+            android:singleLine="true"
+            android:ellipsize="end"
+
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="?android:attr/textColorSecondary" />
+
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/res/layout/appwidget_error.xml b/res/layout/appwidget_error.xml
new file mode 100644
index 0000000..03d4ae4
--- /dev/null
+++ b/res/layout/appwidget_error.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:paddingTop="10dip"
+    android:paddingBottom="10dip"
+    android:paddingLeft="20dip"
+    android:paddingRight="20dip"
+    android:gravity="center"
+    android:background="@drawable/bg_appwidget_error"
+    android:textAppearance="?android:attr/textAppearanceMediumInverse"
+    android:textColor="@color/appwidget_error_color"
+    android:text="@string/gadget_error_text"
+    />
diff --git a/res/layout/list_category.xml b/res/layout/list_category.xml
new file mode 100644
index 0000000..1e8d04c
--- /dev/null
+++ b/res/layout/list_category.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    style="?android:attr/listSeparatorTextViewStyle" />
diff --git a/res/layout/list_checkbox_2lines.xml b/res/layout/list_checkbox_2lines.xml
new file mode 100644
index 0000000..ed80c5f
--- /dev/null
+++ b/res/layout/list_checkbox_2lines.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:gravity="center_vertical"
+    android:paddingRight="?android:attr/scrollbarSize">
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="15dip"
+        android:layout_marginRight="6dip"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="6dip"
+        android:layout_weight="1">
+
+        <TextView android:id="@+id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+
+        <TextView android:id="@+id/summary"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/title"
+            android:layout_alignLeft="@id/title"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:maxLines="2" />
+
+    </RelativeLayout>
+
+    <CheckBox
+        android:id="@+id/checkbox"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="4dip"
+        android:layout_gravity="center_vertical"
+        android:focusable="false"
+        android:clickable="false" />
+
+</LinearLayout>
diff --git a/res/layout/live_folder_list.xml b/res/layout/live_folder_list.xml
new file mode 100644
index 0000000..cf3d2f1
--- /dev/null
+++ b/res/layout/live_folder_list.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2008, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<com.android.launcher2.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical">
+    
+    <Button
+        android:id="@+id/folder_close"
+    	android:background="@drawable/box_launcher_top"
+        android:gravity="left|center_vertical"
+        android:textSize="14sp"
+        android:textColor="#404040"
+        android:textStyle="bold"
+        android:layout_width="fill_parent"
+    	android:layout_height="wrap_content" />
+
+    <ListView
+        android:id="@id/folder_content"
+        android:layout_width="fill_parent"
+    	android:layout_height="0dip"
+    	android:layout_weight="1"
+
+        android:cacheColorHint="#ff333333"
+        android:background="@drawable/box_launcher_bottom" />
+
+</com.android.launcher2.LiveFolder>
diff --git a/res/layout/pick_item.xml b/res/layout/pick_item.xml
new file mode 100644
index 0000000..f276511
--- /dev/null
+++ b/res/layout/pick_item.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:textAppearance="?android:attr/textAppearanceLargeInverse"
+    android:gravity="center_vertical"
+    android:drawablePadding="14dip"
+    android:paddingLeft="15dip"
+    android:paddingRight="15dip" />
diff --git a/res/layout/rename_folder.xml b/res/layout/rename_folder.xml
new file mode 100644
index 0000000..cbb42b4
--- /dev/null
+++ b/res/layout/rename_folder.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:padding="20dip"
+    android:orientation="vertical">
+
+    <TextView 
+        android:id="@+id/label"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:text="@string/rename_folder_label"
+        android:gravity="left"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+            
+    <EditText
+        android:id="@+id/folder_name"
+        android:layout_height="wrap_content"
+        android:layout_width="fill_parent"
+        android:scrollHorizontally="true"
+        android:autoText="false"
+        android:capitalize="none"
+        android:gravity="fill_horizontal"
+        android:maxLength="30"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+</LinearLayout>
diff --git a/res/layout/wallpaper_chooser.xml b/res/layout/wallpaper_chooser.xml
new file mode 100644
index 0000000..7267246
--- /dev/null
+++ b/res/layout/wallpaper_chooser.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+
+    <ImageView android:id="@+id/wallpaper"
+        android:layout_width="fill_parent"
+        android:layout_height="0dip"
+        android:layout_weight="1.0"
+        android:scaleType="fitCenter" />
+
+    <Gallery android:id="@+id/gallery"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" />
+        
+    <Button android:id="@+id/set"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/wallpaper_instructions"
+        android:layout_gravity="center_horizontal" />
+
+</LinearLayout>
+
diff --git a/res/layout/wallpaper_item.xml b/res/layout/wallpaper_item.xml
new file mode 100644
index 0000000..6727483
--- /dev/null
+++ b/res/layout/wallpaper_item.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:background="?android:attr/galleryItemBackground"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:scaleType="fitXY"
+    android:focusable="true" />
diff --git a/res/layout/widget_search.xml b/res/layout/widget_search.xml
new file mode 100644
index 0000000..a346723
--- /dev/null
+++ b/res/layout/widget_search.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.launcher2.Search 
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
+    android:id="@+id/widget_search"  
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical"
+    android:gravity="center">
+
+    <LinearLayout
+        android:id="@+id/search_plate"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:paddingLeft="14dip"
+        android:paddingRight="14dip"
+        android:paddingTop="13dip"
+        android:paddingBottom="12dip"
+        android:background="@drawable/search_floater" >
+
+        <TextView
+            android:id="@+id/search_src_text"
+            android:layout_width="0dip"
+            android:layout_height="42dip"
+            android:layout_weight="1.0"
+            android:editable="false"
+            android:focusable="true"
+            android:inputType="none"
+            android:background="@drawable/textfield_searchwidget"
+            android:textAppearance="?android:attr/textAppearanceMediumInverse"
+            android:textColor="@android:color/primary_text_light"
+        />
+        
+        <ImageButton 
+            android:id="@+id/search_voice_btn"
+            android:layout_width="wrap_content"
+            android:layout_height="42dip"
+            android:layout_marginLeft="4dip"
+            android:background="@*android:drawable/btn_search_dialog_voice"
+            android:src="@*android:drawable/ic_btn_speak_now"
+        />
+
+    </LinearLayout>
+
+</com.android.launcher2.Search>
diff --git a/res/raw/rollo.c b/res/raw/rollo.c
new file mode 100644
index 0000000..6a41727
--- /dev/null
+++ b/res/raw/rollo.c
@@ -0,0 +1,432 @@
+#pragma version(1)
+#pragma stateVertex(PV)
+#pragma stateFragment(PFTexLinear)
+#pragma stateStore(PSIcons)
+
+#define PI 3.14159f
+
+
+// Attraction to center values from page edge to page center.
+float g_AttractionTable[9];
+float g_FrictionTable[9];
+float g_PhysicsTableSize;
+
+float g_PosPage;
+float g_PosVelocity;
+float g_LastPositionX;
+int g_LastTouchDown;
+float g_DT;
+int g_LastTime;
+int g_PageCount;
+float g_Zoom;
+
+// Drawing constants, should be parameters ======
+#define VIEW_ANGLE 1.28700222f
+
+float g_OldPosPage;
+float g_OldPosVelocity;
+float g_OldZoom;
+
+int g_DrawLastFrame;
+int lastFrame(int draw) {
+    // We draw one extra frame to work around the last frame post bug.
+    // We also need to track if we drew the last frame to deal with large DT
+    // in the physics.
+    int ret = g_DrawLastFrame | draw;
+    g_DrawLastFrame = draw;
+    return ret;  // should return draw instead.
+}
+
+void updateReadback() {
+    if ((g_OldPosPage != g_PosPage) ||
+        (g_OldPosVelocity != g_PosVelocity) ||
+        (g_OldZoom != g_Zoom)) {
+
+        g_OldPosPage = g_PosPage;
+        g_OldPosVelocity = g_PosVelocity;
+        g_OldZoom = g_Zoom;
+
+        int i[3];
+        i[0] = g_PosPage * (1 << 16);
+        i[1] = g_PosVelocity * (1 << 16);
+        i[2] = g_OldZoom * (1 << 16);
+        sendToClient(&i[0], 1, 12, 1);
+    }
+}
+
+void init() {
+    g_AttractionTable[0] = 6.5f;
+    g_AttractionTable[1] = 6.5f;
+    g_AttractionTable[2] = 7.0f;
+    g_AttractionTable[3] = 6.0f;
+    g_AttractionTable[4] = -6.0f;
+    g_AttractionTable[5] = -7.0f;
+    g_AttractionTable[6] = -6.5f;
+    g_AttractionTable[7] = -6.5f;
+    g_AttractionTable[8] = -6.5f;  // dup 7 to avoid a clamp later
+    g_FrictionTable[0] = 3.5f;
+    g_FrictionTable[1] = 3.6f;
+    g_FrictionTable[2] = 4.0f;
+    g_FrictionTable[3] = 5.0f;
+    g_FrictionTable[4] = 5.0f;
+    g_FrictionTable[5] = 4.0f;
+    g_FrictionTable[6] = 3.6f;
+    g_FrictionTable[7] = 3.5f;
+    g_FrictionTable[8] = 3.5f;  // dup 7 to avoid a clamp later
+    g_PhysicsTableSize = 7;
+
+    g_PosVelocity = 0;
+    g_PosPage = 0;
+    g_LastTouchDown = 0;
+    g_LastPositionX = 0;
+    g_Zoom = 0;
+}
+
+void resetHWWar() {
+}
+
+void move() {
+    if (g_LastTouchDown) {
+        float dx = -(state->newPositionX - g_LastPositionX);
+        g_PosVelocity = 0;
+        g_PosPage += dx;
+
+        float pmin = -0.25f;
+        float pmax = (g_PageCount - 1) + 0.25f;
+        g_PosPage = clampf(g_PosPage, pmin, pmax);
+    }
+    g_LastTouchDown = state->newTouchDown;
+    g_LastPositionX = state->newPositionX;
+    //debugF("Move P", g_PosPage);
+}
+
+void fling() {
+    g_LastTouchDown = 0;
+    g_PosVelocity = -state->flingVelocityX;
+    float av = fabsf(g_PosVelocity);
+    float minVel = 3.5f;
+
+    minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
+
+    if (av < minVel && av > 0.2f) {
+        if (g_PosVelocity > 0) {
+            g_PosVelocity = minVel;
+        } else {
+            g_PosVelocity = -minVel;
+        }
+    }
+
+    if (g_PosPage <= 0) {
+        g_PosVelocity = maxf(0, g_PosVelocity);
+    }
+    if (g_PosPage > (g_PageCount - 1)) {
+        g_PosVelocity = minf(0, g_PosVelocity);
+    }
+    //debugF("fling v", g_PosVelocity);
+}
+
+void touchUp() {
+    g_LastTouchDown = 0;
+}
+
+int
+count_pages(int iconCount)
+{
+    int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
+    int pages = iconCount / iconsPerPage;
+    if (pages*iconsPerPage != iconCount) {
+        pages++;
+    }
+    return pages;
+}
+
+float
+modf(float x, float y)
+{
+    return x-(y*floorf(x/y));
+}
+
+void updatePos() {
+    if (g_LastTouchDown) {
+        return;
+    }
+
+    float tablePosNorm = fracf(g_PosPage + 0.5f);
+    float tablePosF = tablePosNorm * g_PhysicsTableSize;
+    int tablePosI = tablePosF;
+    float tablePosFrac = tablePosF - tablePosI;
+    float accel = lerpf(g_AttractionTable[tablePosI],
+                        g_AttractionTable[tablePosI + 1],
+                        tablePosFrac) * g_DT;
+    float friction = lerpf(g_FrictionTable[tablePosI],
+                           g_FrictionTable[tablePosI + 1],
+                           tablePosFrac) * g_DT;
+    //debugF("  accel", accel);
+    //debugF("  friction", friction);
+
+    // If our velocity is low OR acceleration is opposing it, apply it.
+    if (fabsf(g_PosVelocity) < 1.0f || (g_PosVelocity * accel) < 0) {
+        g_PosVelocity += accel;
+    }
+
+    if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) {
+        // Special get back to center and overcome friction physics.
+        float t = tablePosNorm - 0.5f;
+        if (fabsf(t) < (friction * g_DT)) {
+            // really close, just snap
+            g_PosPage = roundf(g_PosPage);
+            g_PosVelocity = 0;
+        } else {
+            if (t > 0) {
+                g_PosVelocity = -friction;
+            } else {
+                g_PosVelocity = friction;
+            }
+        }
+    } else {
+        // Normal physics
+        if (g_PosVelocity > 0) {
+            g_PosVelocity -= friction;
+            g_PosVelocity = maxf(g_PosVelocity, 0);
+        } else {
+            g_PosVelocity += friction;
+            g_PosVelocity = minf(g_PosVelocity, 0);
+        }
+    }
+    g_PosPage += g_PosVelocity * g_DT;
+
+    // Check for out of boundry conditions.
+    if (g_PosPage < 0 && g_PosVelocity < 0) {
+        float damp = 1.0 + (g_PosPage * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+    if (g_PosPage > (g_PageCount-1) && g_PosVelocity > 0) {
+        float damp = 1.0 - ((g_PosPage - g_PageCount + 1) * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+}
+
+float
+far_size(float sizeAt0)
+{
+    return sizeAt0 * (RADIUS+2) / 2; // -2 is the camera z=(z-camZ)/z
+}
+
+void
+draw_page(int icon, int lastIcon, float centerAngle, float scale)
+{
+    int row;
+    int col;
+
+    //debugF("center angle", centerAngle);
+
+    float iconTextureWidth = ICON_WIDTH_PX / (float)ICON_TEXTURE_WIDTH_PX;
+    float iconTextureHeight = ICON_HEIGHT_PX / (float)ICON_TEXTURE_HEIGHT_PX;
+
+    float iconWidthAngle = VIEW_ANGLE * ICON_WIDTH_PX / SCREEN_WIDTH_PX;
+    float columnGutterAngle = iconWidthAngle * 0.9f;
+
+    float farIconSize = FAR_ICON_SIZE;
+    float iconGutterHeight = farIconSize * 1.3f;
+
+    float farIconTextureSize = far_size(2 * ICON_TEXTURE_WIDTH_PX / (float)SCREEN_WIDTH_PX);
+
+    float normalizedLabelWidth = 2 * params->bubbleWidth / (float)SCREEN_WIDTH_PX;
+    float farLabelHeight = far_size(params->bubbleHeight * (normalizedLabelWidth / params->bubbleWidth));
+
+    for (row=0; row<ROWS_PER_PAGE && icon<=lastIcon; row++) {
+        float angle = centerAngle;
+        angle -= (columnGutterAngle + iconWidthAngle) * 1.5f;
+
+        float iconTop = (farIconSize + iconGutterHeight) * (1.85f + ICON_TOP_OFFSET)
+                - row * (farIconSize + iconGutterHeight);
+        float iconBottom = iconTop - farIconSize;
+
+        float labelY = iconBottom - farLabelHeight;
+        float iconTextureTop = iconTop + (0.5f * (farIconTextureSize - farIconSize));
+        float iconTextureBottom = iconTextureTop - farIconTextureSize;
+
+        for (col=0; col<COLUMNS_PER_PAGE && icon<=lastIcon; col++) {
+            // icon
+            float sine = sinf(angle);
+            float cosine = cosf(angle);
+
+            float centerX = sine * RADIUS;
+            float centerZ = cosine * RADIUS / scale;
+
+            if (scale > 1.f) {
+                centerX *= scale;
+            }
+
+            float iconLeftX = centerX  - (/*cosine * */ farIconTextureSize * .5);
+            float iconRightX = centerX + (/*cosine * */ farIconTextureSize * .5);
+            float iconLeftZ = centerZ;// + (sine * farIconTextureSize * .5);
+            float iconRightZ = centerZ;// - (sine * farIconTextureSize * .5);
+
+            color(1.0f, 1.0f, 1.0f, 0.99f);
+            if (state->selectedIconIndex == icon) {
+                bindTexture(NAMED_PFTexLinear, 0, state->selectedIconTexture);
+                drawQuadTexCoords(
+                        iconLeftX, iconTextureTop, iconLeftZ,       0.0f, 0.0f,
+                        iconRightX, iconTextureTop, iconRightZ,     1.0f, 0.0f,
+                        iconRightX, iconTextureBottom, iconRightZ,  1.0f, 1.0f,
+                        iconLeftX, iconTextureBottom, iconLeftZ,    0.0f, 1.0f);
+            } else {
+                bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_ICON_IDS, icon));
+                drawQuadTexCoords(
+                        iconLeftX, iconTextureTop, iconLeftZ,       0.0f, 0.0f,
+                        iconRightX, iconTextureTop, iconRightZ,     1.0f, 0.0f,
+                        iconRightX, iconTextureBottom, iconRightZ,  1.0f, 1.0f,
+                        iconLeftX, iconTextureBottom, iconLeftZ,    0.0f, 1.0f);
+            }
+
+            // label
+            if (scale < 1.2f) {
+                float a = (1.2f - maxf(scale, 1.0f)) * 5;
+                color(1.0f, 1.0f, 1.0f, a);
+                bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_LABEL_IDS, icon));
+                drawSprite(centerX, labelY, centerZ,
+                           params->bubbleBitmapWidth, params->bubbleBitmapHeight);
+            }
+
+            angle += columnGutterAngle + iconWidthAngle;
+            icon++;
+        }
+    }
+}
+
+void
+draw_home_button()
+{
+    color(1.0f, 1.0f, 1.0f, 1.0f);
+    bindTexture(NAMED_PFTexLinear, 0, state->homeButtonId);
+
+    float scale = 2.0f / SCREEN_WIDTH_PX;
+
+    float x = 0.0f;
+
+    float y = -(SCREEN_HEIGHT_PX / (float)SCREEN_WIDTH_PX);
+    y += g_Zoom * (scale * params->homeButtonTextureHeight / 2);
+
+    float z = 0.0f;
+    drawSprite(x, y, z, params->homeButtonTextureWidth, params->homeButtonTextureHeight);
+}
+
+int
+main(int launchID)
+{
+    // Compute dt in seconds.
+    int newTime = uptimeMillis();
+    g_DT = (newTime - g_LastTime) / 1000.f;
+    g_LastTime = newTime;
+
+    if (!g_DrawLastFrame) {
+        // If we stopped rendering we cannot use DT.
+        // assume 30fps in this case.
+        g_DT = 0.033f;
+    }
+    if (g_DT > 0.2f) {
+        // physics may break if DT is large.
+        g_DT = 0.2f;
+    }
+
+    //debugF("zoom", g_Zoom);
+    if (g_Zoom != state->zoomTarget) {
+        float dz = (state->zoomTarget - g_Zoom) * g_DT * 5;
+        if (dz && (fabsf(dz) < 0.03f)) {
+            if (dz > 0) {
+                dz = 0.03f;
+            } else {
+                dz = -0.03f;
+            }
+        }
+        if (fabsf(g_Zoom - state->zoomTarget) < fabsf(dz)) {
+            g_Zoom = state->zoomTarget;
+        } else {
+            g_Zoom += dz;
+        }
+        updateReadback();
+    }
+
+    // Set clear value to dim the background based on the zoom position.
+    if ((g_Zoom < 0.001f) && (state->zoomTarget < 0.001f)) {
+        pfClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+        // When we're zoomed out and not tracking motion events, reset the pos to 0.
+        if (!g_LastTouchDown) {
+            g_PosPage = 0;
+        }
+        return lastFrame(0);
+    } else if (g_Zoom < 0.85f) {
+        pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
+    } else {
+        pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
+    }
+
+    // icons & labels
+    int iconCount = state->iconCount;
+    g_PageCount = count_pages(iconCount);
+
+    updatePos(0.1f);
+    updateReadback();
+
+    //debugF("    draw g_PosPage", g_PosPage);
+
+    // Draw the icons ========================================
+
+    // Bug makes 1.0f alpha fail.
+    color(1.0f, 1.0f, 1.0f, 0.99f);
+
+    if (iconCount <= 0) {
+        return lastFrame(0);
+    }
+    int lastIcon = iconCount-1;
+
+    int page = g_PosPage;
+    float currentPagePosition = g_PosPage - page;
+
+    int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
+    int icon = clamp(iconsPerPage * page, 0, lastIcon);
+
+    float scale = (1 / g_Zoom);
+
+    float pageAngle = VIEW_ANGLE * 1.2f;
+    draw_page(icon, lastIcon, -pageAngle*currentPagePosition, scale);
+    draw_page(icon+iconsPerPage, lastIcon, (-pageAngle*currentPagePosition)+pageAngle, scale);
+
+    // Draw the border lines for debugging ========================================
+    /*
+    bindProgramVertex(NAMED_PVOrtho);
+    bindProgramFragment(NAMED_PFOrtho);
+    bindProgramFragmentStore(NAMED_PFSText);
+
+    color(1.0f, 1.0f, 0.0f, 0.99f);
+    int i;
+    for (i=0; i<ROWS_PER_PAGE+1; i++) {
+        int y = loadI32(ALLOC_Y_BORDERS, i);
+        drawRect(0, y, SCREEN_WIDTH_PX, y+1, 0.0f);
+    }
+    for (i=0; i<COLUMNS_PER_PAGE+1; i++) {
+        int x = loadI32(ALLOC_X_BORDERS, i);
+        drawRect(x, 0, x+1, SCREEN_HEIGHT_PX, 0.0f);
+    }
+    */
+
+    // Draw the home button ========================================
+    draw_home_button();
+
+    /*
+    bindTexture(NAMED_PFOrtho, 0, loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_ID));
+    float handleLeft = 40 + (320 * (scrollXPx/(float)(maxScrollXPx)));
+    float handleTop = 680;
+    float handleWidth = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_WIDTH);
+    float handleHeight = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_HEIGHT);
+    drawRect(handleLeft, handleTop, handleLeft+handleWidth, handleTop+handleHeight, 0.0f);
+    */
+
+    // Bug workaround where the last frame is not always displayed
+    // So we keep rendering until the bug is fixed.
+    return lastFrame((g_PosVelocity != 0) || fracf(g_PosPage) || (g_Zoom != state->zoomTarget));
+}
+
diff --git a/res/raw/rollo2.c b/res/raw/rollo2.c
new file mode 100644
index 0000000..eb87063
--- /dev/null
+++ b/res/raw/rollo2.c
@@ -0,0 +1,404 @@
+#pragma version(1)
+#pragma stateVertex(PV)
+#pragma stateFragment(PFTexLinear)
+#pragma stateStore(PSIcons)
+
+#define PI 3.14159f
+
+
+// Attraction to center values from page edge to page center.
+float g_AttractionTable[9];
+float g_FrictionTable[9];
+float g_PhysicsTableSize;
+
+float g_PosPage;
+float g_PosVelocity;
+float g_LastPositionX;
+int g_LastTouchDown;
+float g_DT;
+int g_LastTime;
+int g_PageCount;
+float g_Zoom;
+float g_OldPosPage;
+float g_OldPosVelocity;
+float g_OldZoom;
+
+// Drawing constants, should be parameters ======
+#define VIEW_ANGLE 1.28700222f
+
+int g_DrawLastFrame;
+int lastFrame(int draw) {
+    // We draw one extra frame to work around the last frame post bug.
+    // We also need to track if we drew the last frame to deal with large DT
+    // in the physics.
+    int ret = g_DrawLastFrame | draw;
+    g_DrawLastFrame = draw;
+    return ret;  // should return draw instead.
+}
+
+void updateReadback() {
+    if ((g_OldPosPage != g_PosPage) ||
+        (g_OldPosVelocity != g_PosVelocity) ||
+        (g_OldZoom != g_Zoom)) {
+
+        g_OldPosPage = g_PosPage;
+        g_OldPosVelocity = g_PosVelocity;
+        g_OldZoom = g_Zoom;
+
+        int i[3];
+        i[0] = g_PosPage * (1 << 16);
+        i[1] = g_PosVelocity * (1 << 16);
+        i[2] = g_OldZoom * (1 << 16);
+        sendToClient(&i[0], 1, 12, 1);
+    }
+}
+
+void init() {
+    g_AttractionTable[0] = 6.5f;
+    g_AttractionTable[1] = 6.5f;
+    g_AttractionTable[2] = 7.0f;
+    g_AttractionTable[3] = 6.0f;
+    g_AttractionTable[4] = -6.0f;
+    g_AttractionTable[5] = -7.0f;
+    g_AttractionTable[6] = -6.5f;
+    g_AttractionTable[7] = -6.5f;
+    g_AttractionTable[8] = -6.5f;  // dup 7 to avoid a clamp later
+    g_FrictionTable[0] = 3.5f;
+    g_FrictionTable[1] = 3.6f;
+    g_FrictionTable[2] = 4.0f;
+    g_FrictionTable[3] = 5.0f;
+    g_FrictionTable[4] = 5.0f;
+    g_FrictionTable[5] = 4.0f;
+    g_FrictionTable[6] = 3.6f;
+    g_FrictionTable[7] = 3.5f;
+    g_FrictionTable[8] = 3.5f;  // dup 7 to avoid a clamp later
+    g_PhysicsTableSize = 7;
+
+    g_PosVelocity = 0;
+    g_PosPage = 0;
+    g_LastTouchDown = 0;
+    g_LastPositionX = 0;
+    g_Zoom = 0;
+}
+
+void resetHWWar() {
+}
+
+void move() {
+    if (g_LastTouchDown) {
+        float dx = -(state->newPositionX - g_LastPositionX);
+        g_PosVelocity = 0;
+        g_PosPage += dx;
+
+        float pmin = -0.25f;
+        float pmax = (g_PageCount - 1) + 0.25f;
+        g_PosPage = clampf(g_PosPage, pmin, pmax);
+    }
+    g_LastTouchDown = state->newTouchDown;
+    g_LastPositionX = state->newPositionX;
+    //debugF("Move P", g_PosPage);
+}
+
+void fling() {
+    g_LastTouchDown = 0;
+    g_PosVelocity = -state->flingVelocityX;
+    float av = fabsf(g_PosVelocity);
+    float minVel = 3.5f;
+
+    minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
+
+    if (av < minVel && av > 0.2f) {
+        if (g_PosVelocity > 0) {
+            g_PosVelocity = minVel;
+        } else {
+            g_PosVelocity = -minVel;
+        }
+    }
+
+    if (g_PosPage <= 0) {
+        g_PosVelocity = maxf(0, g_PosVelocity);
+    }
+    if (g_PosPage > (g_PageCount - 1)) {
+        g_PosVelocity = minf(0, g_PosVelocity);
+    }
+    //debugF("fling v", g_PosVelocity);
+}
+
+void touchUp() {
+    g_LastTouchDown = 0;
+}
+
+int
+count_pages(int iconCount)
+{
+    int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
+    int pages = iconCount / iconsPerPage;
+    if (pages*iconsPerPage != iconCount) {
+        pages++;
+    }
+    return pages;
+}
+
+float
+modf(float x, float y)
+{
+    return x-(y*floorf(x/y));
+}
+
+void updatePos() {
+    if (g_LastTouchDown) {
+        return;
+    }
+
+    float tablePosNorm = fracf(g_PosPage + 0.5f);
+    float tablePosF = tablePosNorm * g_PhysicsTableSize;
+    int tablePosI = tablePosF;
+    float tablePosFrac = tablePosF - tablePosI;
+    float accel = lerpf(g_AttractionTable[tablePosI],
+                        g_AttractionTable[tablePosI + 1],
+                        tablePosFrac) * g_DT;
+    float friction = lerpf(g_FrictionTable[tablePosI],
+                           g_FrictionTable[tablePosI + 1],
+                           tablePosFrac) * g_DT;
+    //debugF("  accel", accel);
+    //debugF("  friction", friction);
+
+    // If our velocity is low OR acceleration is opposing it, apply it.
+    if (fabsf(g_PosVelocity) < 1.0f || (g_PosVelocity * accel) < 0) {
+        g_PosVelocity += accel;
+    }
+
+    if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) {
+        // Special get back to center and overcome friction physics.
+        float t = tablePosNorm - 0.5f;
+        if (fabsf(t) < (friction * g_DT)) {
+            // really close, just snap
+            g_PosPage = roundf(g_PosPage);
+            g_PosVelocity = 0;
+        } else {
+            if (t > 0) {
+                g_PosVelocity = -friction;
+            } else {
+                g_PosVelocity = friction;
+            }
+        }
+    } else {
+        // Normal physics
+        if (g_PosVelocity > 0) {
+            g_PosVelocity -= friction;
+            g_PosVelocity = maxf(g_PosVelocity, 0);
+        } else {
+            g_PosVelocity += friction;
+            g_PosVelocity = minf(g_PosVelocity, 0);
+        }
+    }
+    g_PosPage += g_PosVelocity * g_DT;
+
+    // Check for out of boundry conditions.
+    if (g_PosPage < 0 && g_PosVelocity < 0) {
+        float damp = 1.0 + (g_PosPage * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+    if (g_PosPage > (g_PageCount-1) && g_PosVelocity > 0) {
+        float damp = 1.0 - ((g_PosPage - g_PageCount + 1) * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+}
+
+int positionStrip(float row, float column)
+{
+    float mat1[16];
+
+    float y =  1.2f - row * 0.6f;
+
+    float scale = 256.f / getWidth();
+    float xscale = scale * 4.55 / 1.8f / 2;
+
+    matrixLoadTranslate(mat1, 0.f, y, 0.f);
+    matrixScale(mat1, 1.f, scale, 1.f);
+    vpLoadModelMatrix(mat1);
+
+    float soff = -21.8f - (column * 1.25f);
+    matrixLoadScale(mat1, xscale, 1.f, 1.f);
+    matrixTranslate(mat1, soff, 0, 0);
+    vpLoadTextureMatrix(mat1);
+
+    return - soff * 10.f;
+}
+
+void drawIcon(float row, float column, int iconNum)
+{
+    int offset = positionStrip(row, column);
+    bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_ICON_IDS, iconNum));
+
+    if (offset < 0) {
+        offset = 0;
+    }
+    if (offset >= (450 - 20)) {
+        offset = (449 - 20);
+    }
+    drawSimpleMeshRange(NAMED_SMMesh, offset * 6, 20 * 6);
+}
+
+void
+draw_home_button()
+{
+    color(1.0f, 1.0f, 1.0f, 1.0f);
+    bindTexture(NAMED_PFTexLinear, 0, state->homeButtonId);
+
+    float scale = 2.0f / SCREEN_WIDTH_PX;
+
+    float x = 0.0f;
+
+    float y = -(SCREEN_HEIGHT_PX / (float)SCREEN_WIDTH_PX);
+    y += g_Zoom * (scale * params->homeButtonTextureHeight / 2);
+
+    float z = 0.0f;
+    drawSprite(x, y, z, params->homeButtonTextureWidth, params->homeButtonTextureHeight);
+}
+
+int
+main(int launchID)
+{
+    // Compute dt in seconds.
+    int newTime = uptimeMillis();
+    g_DT = (newTime - g_LastTime) / 1000.f;
+    g_LastTime = newTime;
+
+    if (!g_DrawLastFrame) {
+        // If we stopped rendering we cannot use DT.
+        // assume 30fps in this case.
+        g_DT = 0.033f;
+    }
+    if (g_DT > 0.2f) {
+        // physics may break if DT is large.
+        g_DT = 0.2f;
+    }
+
+    debugF("zoom", g_Zoom);
+    if (g_Zoom != state->zoomTarget) {
+        float dz = (state->zoomTarget - g_Zoom) * g_DT * 5;
+        if (dz && (fabsf(dz) < 0.03f)) {
+            if (dz > 0) {
+                dz = 0.03f;
+            } else {
+                dz = -0.03f;
+            }
+        }
+        if (fabsf(g_Zoom - state->zoomTarget) < fabsf(dz)) {
+            g_Zoom = state->zoomTarget;
+        } else {
+            g_Zoom += dz;
+        }
+        updateReadback();
+    }
+
+    // Set clear value to dim the background based on the zoom position.
+    if ((g_Zoom < 0.001f) && (state->zoomTarget < 0.001f)) {
+        pfClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+        // When we're zoomed out and not tracking motion events, reset the pos to 0.
+        if (!g_LastTouchDown) {
+            g_PosPage = 0;
+        }
+        return lastFrame(0);
+    } else if (g_Zoom < 0.85f) {
+        pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
+    } else {
+        pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
+    }
+
+    // icons & labels
+    int iconCount = state->iconCount;
+    g_PageCount = count_pages(iconCount);
+
+    updatePos(0.1f);
+    updateReadback();
+
+    debugF("    draw g_PosPage", g_PosPage);
+
+    // Draw the icons ========================================
+
+    // Bug makes 1.0f alpha fail.
+    //color(0.2f, 0.2f, 0.2f, 0.99f);
+    //bindProgramFragment(NAMED_PFColor);
+    //positionStrip(0, 0);
+    //drawSimpleMesh(NAMED_SMMesh);
+
+    bindProgramFragment(NAMED_PFTexLinear);
+
+
+    int lastIcon = iconCount-1;
+
+    int page = g_PosPage;
+    float currentPagePosition = g_PosPage - page;
+
+    int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
+    float scale = (1 / g_Zoom);
+
+    float pageAngle = VIEW_ANGLE * 1.2f;
+
+    float zoomOffset = 40 * (1 - g_Zoom);
+    int drawPage;
+    //lastIcon = 1;
+    for (drawPage = 0; drawPage < g_PageCount; drawPage++) {
+        int r, c;
+        for (r=0; r < 4; r++) {
+            for (c=0; c < 4; c++) {
+                int iconNum = drawPage * 16 + c + r * 4;
+                if (iconNum <= lastIcon) {
+                    float p = (((float)drawPage) - g_PosPage) * 5.f;
+                    p += c - 1.5f;
+                    p += zoomOffset;
+                    if (fabsf(p) > 2) {
+                        drawIcon(r, p, iconNum);
+                    }
+                }
+            }
+        }
+    }
+
+    for (drawPage = 0; drawPage < g_PageCount; drawPage++) {
+        int r, c;
+        for (r=0; r < 4; r++) {
+            for (c=0; c < 4; c++) {
+                int iconNum = drawPage * 16 + c + r * 4;
+                if (iconNum <= lastIcon) {
+                    float p = (((float)drawPage) - g_PosPage) * 5.f;
+                    p += c - 1.5f;
+                    p += zoomOffset;
+                    float x = (p * 1.13f + 1.88f) * getWidth() * 0.2f;
+                    float y = 570 - r * 147;
+
+                    if (fabsf(p) <= 2) {
+                        drawIcon(r, p, iconNum);
+                    }
+                    if (fabsf(p) <= 2.5) {
+                        float a = (1.2f - maxf(scale, 1.0f)) * 5;
+                        color(1.0f, 1.0f, 1.0f, a);
+                        bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_LABEL_IDS, iconNum));
+                        drawSpriteScreenspace(x, y, 0,
+                                   params->bubbleBitmapWidth, params->bubbleBitmapHeight);
+                    }
+                }
+            }
+        }
+
+    }
+
+    {
+        float mat1[16];
+        matrixLoadIdentity(mat1);
+        vpLoadModelMatrix(mat1);
+        vpLoadTextureMatrix(mat1);
+    }
+
+    // Draw the home button ========================================
+    //draw_home_button();
+
+    // Bug workaround where the last frame is not always displayed
+    // So we keep rendering until the bug is fixed.
+    return 1; //(g_PosVelocity != 0) || fracf(g_PosPage) || g_Zoom != g_ZoomTarget);
+}
+
diff --git a/res/raw/rollo3.c b/res/raw/rollo3.c
new file mode 100644
index 0000000..6f0046e
--- /dev/null
+++ b/res/raw/rollo3.c
@@ -0,0 +1,522 @@
+#pragma version(1)
+#pragma stateVertex(PV)
+#pragma stateFragment(PFTexNearest)
+#pragma stateStore(PSIcons)
+
+#define PI 3.14159f
+
+int g_SpecialHWWar;
+
+// Attraction to center values from page edge to page center.
+float g_AttractionTable[9];
+float g_FrictionTable[9];
+float g_PhysicsTableSize;
+
+float g_PosPage;
+float g_PosVelocity;
+float g_LastPositionX;
+int g_LastTouchDown;
+float g_DT;
+int g_LastTime;
+int g_PosMax;
+float g_Zoom;
+float g_OldPosPage;
+float g_OldPosVelocity;
+float g_OldZoom;
+float g_MoveToTotalTime;
+float g_MoveToTime;
+float g_MoveToOldPos;
+
+
+// Drawing constants, should be parameters ======
+#define VIEW_ANGLE 1.28700222f
+
+int g_DrawLastFrame;
+int lastFrame(int draw) {
+    // We draw one extra frame to work around the last frame post bug.
+    // We also need to track if we drew the last frame to deal with large DT
+    // in the physics.
+    int ret = g_DrawLastFrame | draw;
+    g_DrawLastFrame = draw;
+    return ret;  // should return draw instead.
+}
+
+void updateReadback() {
+    if ((g_OldPosPage != g_PosPage) ||
+        (g_OldPosVelocity != g_PosVelocity) ||
+        (g_OldZoom != g_Zoom)) {
+
+        g_OldPosPage = g_PosPage;
+        g_OldPosVelocity = g_PosVelocity;
+        g_OldZoom = g_Zoom;
+
+        int i[3];
+        i[0] = g_PosPage * (1 << 16);
+        i[1] = g_PosVelocity * (1 << 16);
+        i[2] = g_OldZoom * (1 << 16);
+        sendToClient(&i[0], 1, 12, 1);
+    }
+}
+
+void setColor(float r, float g, float b, float a) {
+    if (g_SpecialHWWar) {
+        color(0, 0, 0, 0.001f);
+    } else {
+        color(r, g, b, a);
+    }
+}
+
+void init() {
+    g_AttractionTable[0] = 20.0f;
+    g_AttractionTable[1] = 20.0f;
+    g_AttractionTable[2] = 20.0f;
+    g_AttractionTable[3] = 10.0f;
+    g_AttractionTable[4] = -10.0f;
+    g_AttractionTable[5] = -20.0f;
+    g_AttractionTable[6] = -20.0f;
+    g_AttractionTable[7] = -20.0f;
+    g_AttractionTable[8] = -20.0f;  // dup 7 to avoid a clamp later
+    g_FrictionTable[0] = 10.0f;
+    g_FrictionTable[1] = 10.0f;
+    g_FrictionTable[2] = 11.0f;
+    g_FrictionTable[3] = 15.0f;
+    g_FrictionTable[4] = 15.0f;
+    g_FrictionTable[5] = 11.0f;
+    g_FrictionTable[6] = 10.0f;
+    g_FrictionTable[7] = 10.0f;
+    g_FrictionTable[8] = 10.0f;  // dup 7 to avoid a clamp later
+    g_PhysicsTableSize = 7;
+
+    g_PosVelocity = 0;
+    g_PosPage = 0;
+    g_LastTouchDown = 0;
+    g_LastPositionX = 0;
+    g_Zoom = 0;
+    g_SpecialHWWar = 1;
+    g_MoveToTime = 0;
+    g_MoveToOldPos = 0;
+    g_MoveToTotalTime = 0.2f; // Duration of scrolling 1 line
+}
+
+void resetHWWar() {
+    g_SpecialHWWar = 1;
+}
+
+void move() {
+    if (g_LastTouchDown) {
+        float dx = -(state->newPositionX - g_LastPositionX);
+        g_PosVelocity = 0;
+        g_PosPage += dx * 4;
+
+        float pmin = -0.49f;
+        float pmax = g_PosMax + 0.49f;
+        g_PosPage = clampf(g_PosPage, pmin, pmax);
+    }
+    g_LastTouchDown = state->newTouchDown;
+    g_LastPositionX = state->newPositionX;
+    g_MoveToTime = 0;
+    //debugF("Move P", g_PosPage);
+}
+
+void moveTo() {
+    g_MoveToTime = g_MoveToTotalTime;
+    g_PosVelocity = 0;
+    g_MoveToOldPos = g_PosPage;
+
+	// debugF("======= moveTo", state->targetPos);
+}
+
+void setZoom() {
+    g_Zoom = state->zoomTarget;
+    g_DrawLastFrame = 1;
+    updateReadback();
+}
+
+void fling() {
+    g_LastTouchDown = 0;
+    g_PosVelocity = -state->flingVelocity * 4;
+    float av = fabsf(g_PosVelocity);
+    float minVel = 3.5f;
+
+    minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
+
+    if (av < minVel && av > 0.2f) {
+        if (g_PosVelocity > 0) {
+            g_PosVelocity = minVel;
+        } else {
+            g_PosVelocity = -minVel;
+        }
+    }
+
+    if (g_PosPage <= 0) {
+        g_PosVelocity = maxf(0, g_PosVelocity);
+    }
+    if (g_PosPage > g_PosMax) {
+        g_PosVelocity = minf(0, g_PosVelocity);
+    }
+}
+
+float
+modf(float x, float y)
+{
+    return x-(y*floorf(x/y));
+}
+
+
+/*
+ * Interpolates values in the range 0..1 to a curve that eases in
+ * and out.
+ */
+float
+getInterpolation(float input) {
+    return (cosf((input + 1) * PI) / 2.0f) + 0.5f;
+}
+
+
+void updatePos() {
+    if (g_LastTouchDown) {
+        return;
+    }
+
+    float tablePosNorm = fracf(g_PosPage + 0.5f);
+    float tablePosF = tablePosNorm * g_PhysicsTableSize;
+    int tablePosI = tablePosF;
+    float tablePosFrac = tablePosF - tablePosI;
+    float accel = lerpf(g_AttractionTable[tablePosI],
+                        g_AttractionTable[tablePosI + 1],
+                        tablePosFrac) * g_DT;
+    float friction = lerpf(g_FrictionTable[tablePosI],
+                        g_FrictionTable[tablePosI + 1],
+                        tablePosFrac) * g_DT;
+
+    if (g_MoveToTime) {
+        // New position is old posiition + (total distance) * (interpolated time)
+        g_PosPage = g_MoveToOldPos + (state->targetPos - g_MoveToOldPos) * getInterpolation((g_MoveToTotalTime - g_MoveToTime) / g_MoveToTotalTime);
+        g_MoveToTime -= g_DT;
+        if (g_MoveToTime <= 0) {
+            g_MoveToTime = 0;
+            g_PosPage = state->targetPos;
+        }
+        return;
+    }
+
+    // If our velocity is low OR acceleration is opposing it, apply it.
+    if (fabsf(g_PosVelocity) < 4.0f || (g_PosVelocity * accel) < 0) {
+        g_PosVelocity += accel;
+    }
+    //debugF("g_PosPage", g_PosPage);
+    //debugF("  g_PosVelocity", g_PosVelocity);
+    //debugF("  friction", friction);
+    //debugF("  accel", accel);
+
+    // Normal physics
+    if (g_PosVelocity > 0) {
+        g_PosVelocity -= friction;
+        g_PosVelocity = maxf(g_PosVelocity, 0);
+    } else {
+        g_PosVelocity += friction;
+        g_PosVelocity = minf(g_PosVelocity, 0);
+    }
+
+    if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) {
+        // Special get back to center and overcome friction physics.
+        float t = tablePosNorm - 0.5f;
+        if (fabsf(t) < (friction * g_DT)) {
+            // really close, just snap
+            g_PosPage = roundf(g_PosPage);
+            g_PosVelocity = 0;
+        } else {
+            if (t > 0) {
+                g_PosVelocity = -friction;
+            } else {
+                g_PosVelocity = friction;
+            }
+        }
+    }
+
+    // Check for out of boundry conditions.
+    if (g_PosPage < 0 && g_PosVelocity < 0) {
+        float damp = 1.0 + (g_PosPage * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+    if (g_PosPage > g_PosMax && g_PosVelocity > 0) {
+        float damp = 1.0 - ((g_PosPage - g_PosMax) * 4);
+        damp = clampf(damp, 0.f, 0.9f);
+        g_PosVelocity *= damp;
+    }
+
+    g_PosPage += g_PosVelocity * g_DT;
+    g_PosPage = clampf(g_PosPage, -0.49, g_PosMax + 0.49);
+}
+
+int positionStrip(float row, float column, int isTop, float p, int isText)
+{
+    float mat1[16];
+    float x = 0.5f * (column - 1.5f);
+    float scale = 72.f * 3 / getWidth();
+
+    if (isTop) {
+        matrixLoadTranslate(mat1, x, 0.8f, 0.f);
+        matrixScale(mat1, scale, scale, 1.f);
+    } else {
+        matrixLoadTranslate(mat1, x, -0.9f, 0.f);
+        matrixScale(mat1, scale, -scale, 1.f);
+    }
+    matrixTranslate(mat1, 0, p * 2, 0.f);
+    matrixRotate(mat1, -p * 50, 1, 0, 0);
+    vpLoadModelMatrix(mat1);
+
+    float soff = -(row * 1.4);
+    if (isTop) {
+        matrixLoadScale(mat1, 1.f, -0.85f, 1.f);
+        if (isText) {
+            matrixScale(mat1, 1.f, 2.f, 1.f);
+        }
+        matrixTranslate(mat1, 0, soff - 0.97f, 0);
+    } else {
+        matrixLoadScale(mat1, 1.f, 0.85f, 1.f);
+        if (isText) {
+            matrixScale(mat1, 1.f, 2.f, 1.f);
+        }
+        matrixTranslate(mat1, 0, soff - 0.45f, 0);
+    }
+    vpLoadTextureMatrix(mat1);
+    return -soff * 10.f;
+}
+
+void
+draw_home_button()
+{
+    setColor(1.0f, 1.0f, 1.0f, 1.0f);
+    bindTexture(NAMED_PFTexNearest, 0, state->homeButtonId);
+    float x = (SCREEN_WIDTH_PX - params->homeButtonTextureWidth) / 2;
+    float y = (g_Zoom - 1.f) * params->homeButtonTextureHeight;
+
+    y -= 30; // move the house to the edge of the screen as it doesn't fill the texture.
+    drawSpriteScreenspace(x, y, 0, params->homeButtonTextureWidth, params->homeButtonTextureHeight);
+}
+
+void drawFrontGrid(float rowOffset, float p)
+{
+    float h = getHeight();
+    float w = getWidth();
+
+    int intRowOffset = rowOffset;
+    float rowFrac = rowOffset - intRowOffset;
+    float colWidth = getWidth() / 4;
+    float rowHeight = colWidth + 25.f;
+    float yoff = h - ((h - (rowHeight * 4.f)) / 2);
+
+    yoff -= 110;
+
+    int row, col;
+    int iconNum = intRowOffset * 4;
+    float ymax = yoff;
+    float ymin = yoff - (3 * rowHeight) - 70;
+
+    for (row = 0; row < 5; row++) {
+        float y = yoff - ((-rowFrac + row) * rowHeight);
+
+        for (col=0; col < 4; col++) {
+            if (iconNum >= state->iconCount) {
+                return;
+            }
+
+            if (iconNum >= 0) {
+                float x = colWidth * col - ((128 - colWidth) / 2);
+
+                if ((y >= ymin) && (y <= ymax)) {
+                    setColor(1.f, 1.f, 1.f, 1.f);
+                    if (state->selectedIconIndex == iconNum && !p) {
+                        bindTexture(NAMED_PFTexNearest, 0, state->selectedIconTexture);
+                        drawSpriteScreenspace(x, y, 0, 128, 128);
+                    }
+
+                    bindTexture(NAMED_PFTexNearest, 0, loadI32(ALLOC_ICON_IDS, iconNum));
+                    if (!p) {
+                        drawSpriteScreenspace(x, y, 0, 128, 128);
+                    } else {
+                        float px = ((x + 64) - (getWidth() / 2)) / (getWidth() / 2);
+                        float py = ((y + 64) - (getHeight() / 2)) / (getWidth() / 2);
+                        float d = 64.f / (getWidth() / 2);
+                        px *= p + 1;
+                        py *= p + 1;
+                        drawQuadTexCoords(px - d, py - d, -p, 0, 1,
+                                          px - d, py + d, -p, 0, 0,
+                                          px + d, py + d, -p, 1, 0,
+                                          px + d, py - d, -p, 1, 1);
+                    }
+                }
+
+                float y2 = y - 44;
+                if ((y2 >= ymin) && (y2 <= ymax)) {
+                    float a = maxf(0, 1.f - p * 5.f);
+                    setColor(1.f, 1.f, 1.f, a);
+                    bindTexture(NAMED_PFTexNearest, 0, loadI32(ALLOC_LABEL_IDS, iconNum));
+                    drawSpriteScreenspace(x, y - 44, 0,
+                               params->bubbleBitmapWidth, params->bubbleBitmapHeight);
+                }
+            }
+            iconNum++;
+        }
+    }
+}
+
+void drawStrip(float row, float column, int isTop, int iconNum, float p)
+{
+    if (iconNum < 0) return;
+    int offset = positionStrip(row, column, isTop, p, 0);
+    bindTexture(NAMED_PFTexMip, 0, loadI32(ALLOC_ICON_IDS, iconNum));
+    if (offset < -20) return;
+    offset = clamp(offset, 0, 199 - 20);
+    drawSimpleMeshRange(NAMED_SMMesh, offset * 6, 20 * 6);
+
+    if (isTop) {
+        offset = positionStrip(row - 0.72f, column, isTop, p, 1);
+    } else {
+        offset = positionStrip(row + 0.73f, column, isTop, p, 1);
+    }
+    if (offset < -20) return;
+    if (offset > 200) return;
+    bindTexture(NAMED_PFTexMip, 0, loadI32(ALLOC_LABEL_IDS, iconNum));
+    offset = clamp(offset, 0, 199 - 20);
+    drawSimpleMeshRange(NAMED_SMMesh, offset * 6, 20 * 6);
+    //drawSimpleMesh(NAMED_SMMesh);
+}
+
+void drawTop(float rowOffset, float p)
+{
+    int row, col;
+    int iconNum = 0;
+    for (row = 0; row < rowOffset; row++) {
+        for (col=0; col < 4; col++) {
+            if (iconNum >= state->iconCount) {
+                return;
+            }
+            drawStrip(rowOffset - row, col, 1, iconNum, p);
+            iconNum++;
+        }
+    }
+}
+
+void drawBottom(float rowOffset, float p)
+{
+    float pos = -1.f;
+    int intRowOffset = rowOffset;
+    pos -= rowOffset - intRowOffset;
+
+    int row, col;
+    int iconNum = (intRowOffset + 3) * 4;
+    while (1) {
+        for (col=0; col < 4; col++) {
+            if (iconNum >= state->iconCount) {
+                return;
+            }
+            if (pos > -1) {
+                drawStrip(pos, col, 0, iconNum, p);
+            }
+            iconNum++;
+        }
+        pos += 1.f;
+    }
+}
+
+int
+main(int launchID)
+{
+    // Compute dt in seconds.
+    int newTime = uptimeMillis();
+    g_DT = (newTime - g_LastTime) / 1000.f;
+    g_LastTime = newTime;
+
+    if (!g_DrawLastFrame) {
+        // If we stopped rendering we cannot use DT.
+        // assume 30fps in this case.
+        g_DT = 0.033f;
+    }
+    // physics may break if DT is large.
+    g_DT = minf(g_DT, 0.2f);
+
+    if (g_Zoom != state->zoomTarget) {
+        float dz;
+        if (state->zoomTarget > 0.5f) {
+            dz = (1 - g_Zoom) * 0.2f;
+        } else {
+            dz = -g_DT - (1 - g_Zoom) * 0.2f;
+        }
+        if (dz && (fabsf(dz) < 0.02f)) {
+            if (dz > 0) {
+                dz = 0.02f;
+            } else {
+                dz = -0.02f;
+            }
+        }
+        if (fabsf(g_Zoom - state->zoomTarget) < fabsf(dz)) {
+            g_Zoom = state->zoomTarget;
+        } else {
+            g_Zoom += dz;
+        }
+        updateReadback();
+    }
+
+    // Set clear value to dim the background based on the zoom position.
+    if ((g_Zoom < 0.001f) && (state->zoomTarget < 0.001f) && !g_SpecialHWWar) {
+        pfClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+        // When we're zoomed out and not tracking motion events, reset the pos to 0.
+        if (!g_LastTouchDown) {
+            g_PosPage = 0;
+        }
+        return lastFrame(0);
+    } else {
+        pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
+    }
+
+    // icons & labels
+    int iconCount = state->iconCount;
+    g_PosMax = ((iconCount + 3) / 4) - 4;
+    if (g_PosMax < 0) g_PosMax = 0;
+
+    updatePos(0.1f);
+    updateReadback();
+
+    //debugF("    draw g_PosPage", g_PosPage);
+
+    // Draw the icons ========================================
+
+    //bindProgramFragment(NAMED_PFColor);
+    //positionStrip(1, 0, 0);
+    //drawSimpleMesh(NAMED_SMMesh);
+
+    bindProgramFragment(NAMED_PFTexMip);
+
+
+    drawTop(g_PosPage, 1-g_Zoom);
+    drawBottom(g_PosPage, 1-g_Zoom);
+
+    {
+        float mat1[16];
+        matrixLoadIdentity(mat1);
+        vpLoadModelMatrix(mat1);
+        vpLoadTextureMatrix(mat1);
+    }
+
+    bindProgramFragment(NAMED_PFTexNearest);
+    drawFrontGrid(g_PosPage, 1-g_Zoom);
+    draw_home_button();
+
+
+    // This is a WAR to do a rendering pass without drawing during init to
+    // force the driver to preload and compile its shaders.
+    // Without this the first animation does not appear due to the time it
+    // takes to init the driver state.
+    if (g_SpecialHWWar) {
+        g_SpecialHWWar = 0;
+        return 1;
+    }
+
+    // Bug workaround where the last frame is not always displayed
+    // So we keep rendering until the bug is fixed.
+    return lastFrame((g_PosVelocity != 0) || fracf(g_PosPage) || g_Zoom != state->zoomTarget || (g_MoveToTime != 0));
+}
+
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
new file mode 100644
index 0000000..815bd10
--- /dev/null
+++ b/res/values-cs/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Složka"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Vybrat tapetu ze složky"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Nastavit tapetu"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Tapety"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Aplikace není v telefonu nainstalována."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurace..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Název složky"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Přejmenovat složku"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Zrušit"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Přidat na plochu"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplikace"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Zástupce"</string>
+    <string name="group_search" msgid="5905328940867162196">"Hledat"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nová složka"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Složky"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgety"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Tapety"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Složka"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Hodiny"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Rámeček fotografie"</string>
+    <string name="add_search" msgid="7104834713685095105">"Vyhledávání"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Na této ploše již není místo."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Zástupce <xliff:g id="NAME">%s</xliff:g> byl vytvořen."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Zástupce <xliff:g id="NAME">%s</xliff:g> byl odebrán."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Zástupce <xliff:g id="NAME">%s</xliff:g> již existuje."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Vyberte zástupce"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Vybrat složku"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Všechny aplikace"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Plocha"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Přidat"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Tapeta"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Hledat"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Oznámení"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gesta"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Nastavení"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalovat zástupce"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Povoluje aplikaci přidat zástupce bez zásahu uživatele."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"odinstalovat zástupce"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Povoluje aplikaci odstranit zástupce bez zásahu uživatele."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"čtení nastavení a odkazů plochy"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Povoluje aplikaci číst nastavení a odkazy plochy."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"zápis nastavení a odkazů plochy"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Povoluje aplikaci změnit nastavení a odkazy plochy."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Vyhledávání Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problém s načtením widgetu"</string>
+</resources>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
new file mode 100644
index 0000000..391ec16
--- /dev/null
+++ b/res/values-da/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android-kerneprogrammer"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Mappe"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Vælg tapet fra"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Angiv tapet"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Tapeter"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Programmet er ikke installeret på din telefon."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurer ..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Mappenavn"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Omdøb mappe"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Annuller"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Føj til Startskærm"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Programmer"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Genveje"</string>
+    <string name="group_search" msgid="5905328940867162196">"Søg"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Ny mappe"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Mapper"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Tapeter"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Mappe"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Ur"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Billedramme"</string>
+    <string name="add_search" msgid="7104834713685095105">"Søg"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Der er ikke mere plads på Startskærmen."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" blev oprettet."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" blev fjernet."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" findes allerede."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Vælg genvej"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Vælg mappe"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Alle programmer"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Start"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Tilføj"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Tapet"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Søg"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Meddelelser"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestus"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Indstillinger"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"installer genveje"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Tillader, at et program tilføjer genveje uden brugerindgriben."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"afinstaller genveje"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Tillader, at et program fjerner genveje uden brugerindgriben."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"læs indstillinger og genveje for Start"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Tillader, at et program læser indstillingerne og genvejene i Start."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"skriv indstillinger og genveje for Start"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Tillader, at et program ændrer indstillingerne og genvejene i Start."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google-søgning"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Der er problemer med indlæsning af widget"</string>
+</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
new file mode 100644
index 0000000..522bd4d
--- /dev/null
+++ b/res/values-de/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Ordner"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Hintergrund auswählen"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Hintergrund festlegen"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Hintergrundbilder"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Anwendung ist nicht auf dem Telefon installiert."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurieren..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Ordnername"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Ordner umbenennen"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Abbrechen"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Zum Startbildschirm hinzufügen"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Anwendungen"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Verknüpfungen"</string>
+    <string name="group_search" msgid="5905328940867162196">"Suchen"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Neuer Ordner"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Ordner"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Hintergrundbilder"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Ordner"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Uhr"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Bildrahmen"</string>
+    <string name="add_search" msgid="7104834713685095105">"Suchen"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Auf dem Startbildschirm ist kein Platz mehr vorhanden."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung wurde erstellt."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung wurde entfernt."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung ist bereits vorhanden."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Tastenkürzel auswählen"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Ordner auswählen"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Alle Anwendungen"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Startseite"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Hinzufügen"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Hintergrund"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Suchen"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Benachrichtigungen"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Bewegungen"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Einstellungen"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"Verknüpfungen installieren"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Ermöglicht einer Anwendung das Hinzufügen von Verknüpfungen ohne Eingriff des Nutzers."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"Verknüpfungen deinstallieren"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Ermöglicht einer Anwendung das Entfernen von Verknüpfungen ohne Eingriff des Nutzers."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"Einstellungen und Shortcuts für Startseite lesen"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu lesen."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"Einstellungen und Shortcuts für Startseite schreiben"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu ändern."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google-Suche"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problem beim Laden des Widgets"</string>
+</resources>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
new file mode 100644
index 0000000..bb65bf3
--- /dev/null
+++ b/res/values-el/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Βασικές εφαρμογές Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Φάκελος"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Επιλογή ταπετσαρίας από"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Ορισμός ταπετσαρίας"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Ταπετσαρίες"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Η εφαρμογή δεν έχει εγκατασταθεί στο τηλέφωνό σας."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Διαμόρφωση..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Όνομα φακέλου"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Μετονομασία φακέλου"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Ακύρωση"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Προσθήκη στην αρχική οθόνη"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Εφαρμογές"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Συντομεύσεις"</string>
+    <string name="group_search" msgid="5905328940867162196">"Αναζήτηση"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Νέος φάκελος"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Φάκελοι"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Γραφικά στοιχεία"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Ταπετσαρίες"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Φάκελος"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Ρολόι"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Πλαίσιο εικόνας"</string>
+    <string name="add_search" msgid="7104834713685095105">"Αναζήτηση"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Δεν υπάρχει χώρος σε αυτήν την αρχική οθόνη."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Δημιουργήθηκε η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\" καταργήθηκε."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\" υπάρχει ήδη."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Επιλογή συντόμευσης"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Επιλογή φακέλου"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Όλες οι εφαρμογές"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Αρχική σελίδα"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Προσθήκη"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Ταπετσαρία"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Αναζήτηση"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Ειδοποιήσεις"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Χειρονομίες"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Ρυθμίσεις"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"εγκατάσταση συντομεύσεων"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Επιτρέπει σε μια εφαρμογή την προσθήκη συντομεύσεων χωρίς την παρέμβαση του χρήστη."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"κατάργηση εγκατάστασης συντομεύσεων"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Επιτρέπει σε μια εφαρμογή την κατάργηση συντομεύσεων χωρίς την παρέμβαση του χρήστη."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"ανάγνωση ρυθμίσεων και συντομεύσεων αρχικής οθόνης"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Επιτρέπει σε μια εφαρμογή την ανάγνωση των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"εγγραφή ρυθμίσεων και συντομεύσεων αρχικής οθόνης"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Επιτρέπει σε μια εφαρμογή την αλλαγή των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Αναζήτηση Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Παρουσιάστηκε πρόβλημα στη φόρτωση του γραφικού στοιχείου"</string>
+</resources>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..bee06e3
--- /dev/null
+++ b/res/values-es-rUS/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Aplicaciones del núcleo de Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Carpeta"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Seleccionar papel tapiz desde"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Definir papel tapiz"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Papeles tapiz"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"La aplicación no está instalada en tu computadora."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nombre de carpeta"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Cambiar nombre de carpeta"</string>
+    <string name="rename_action" msgid="6016003384693240896">"Aceptar"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Cancelar"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Agregar a la pantalla Página principal"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplicaciones"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Accesos directos"</string>
+    <string name="group_search" msgid="5905328940867162196">"Buscar"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Carpeta nueva"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Carpetas"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Controles"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Papeles tapiz"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Carpeta"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Reloj"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Marco de imagen"</string>
+    <string name="add_search" msgid="7104834713685095105">"Buscar"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"No hay más espacio en esta pantalla de la página principal"</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" creado."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ha sido eliminado."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ya existe."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Seleccionar acceso directo"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Seleccionar carpeta"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Todas las aplicaciones"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Página principal"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Agregar"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Papel tapiz"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Buscar"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notificaciones"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Configuración"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar accesos directos"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite a una aplicación agregar accesos directos sin intervención del usuario."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"desinstalar papel tapiz"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Permite a una aplicación suprimir accesos directos sin intervención del usuario."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"leer configuración y accesos directos de la página principal"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Permite a una aplicación leer la configuración y los accesos directos de la página principal."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"escribir configuración y accesos directos de la página principal"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Permite a una aplicación cambiar la configuración y los accesos directos de la página principal."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Búsqueda de Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problema al cargar el widget"</string>
+</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
new file mode 100644
index 0000000..7554c1b
--- /dev/null
+++ b/res/values-es/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Aplicaciones básicas de Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Carpeta"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Seleccionar fondo de pantalla de"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Establecer fondo de pantalla"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Fondos de pantalla"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"La aplicación no está instalada en el teléfono."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nombre de carpeta"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Cambiar nombre de carpeta"</string>
+    <string name="rename_action" msgid="6016003384693240896">"Aceptar"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Cancelar"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Añadir a pantalla de página principal"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplicaciones"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Accesos directos"</string>
+    <string name="group_search" msgid="5905328940867162196">"Búsqueda"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nueva carpeta"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Carpetas"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Fondos de pantalla"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Carpeta"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Reloj"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Picture frame"</string>
+    <string name="add_search" msgid="7104834713685095105">"Búsqueda de Google"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"No queda espacio en esta pantalla de página principal."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Se ha creado el acceso directo \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Se ha eliminado el acceso directo \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ya existe."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Seleccionar acceso directo"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Seleccionar carpeta"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Todas las aplicaciones"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Página principal"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Añadir"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Fondo de pantalla"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Buscar con Google"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notificaciones"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Ajustes"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar accesos directos"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite que una aplicación añada accesos directos sin intervención del usuario."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"desinstalar accesos directos"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Permite que una aplicación elimine accesos directos sin intervención del usuario."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"leer información de accesos directos y de configuración de la página principal"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Permite que una aplicación lea la información de configuración y accesos directos de la página principal."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"escribir información de accesos directos y de configuración de la página principal"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Permite que una aplicación modifique la configuración y los accesos directos de la página principal."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Búsqueda de Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problema al cargar el widget"</string>
+</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
new file mode 100644
index 0000000..0d66612
--- /dev/null
+++ b/res/values-fr/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Lanceur d\'applications"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Applications de base Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Dossier"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Sélectionner à partir de..."</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Sélectionner"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Fonds d\'écran"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"L\'application n\'est pas installée sur votre téléphone."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configurer..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nom du dossier"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Renommer le dossier"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Annuler"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Ajouter à l\'écran d\'accueil"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Applications"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Raccourcis"</string>
+    <string name="group_search" msgid="5905328940867162196">"Recherche"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nouveau dossier"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Dossiers"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Fonds d\'écran"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Dossier"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Horloge"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Cadre d\'image"</string>
+    <string name="add_search" msgid="7104834713685095105">"Recherche"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Plus d\'espace libre sur l\'écran d\'accueil."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" a été créé."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" a été supprimé."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" existe déjà."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Sélectionner un raccourci"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Sélectionner le dossier"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Toutes les applications"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Domicile"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Ajouter"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Fond d\'écran"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Rechercher"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notifications"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestes"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Paramètres"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"installer des raccourcis"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permet à une application d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"désinstaller les raccourcis"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Permet à une application de supprimer les raccourcis sans l\'intervention de l\'utilisateur."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"Lire les paramètres et les raccourcis de la page d\'accueil"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Permet à une application de lire les paramètres et raccourcis de la page d\'accueil."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"Enregistrer les paramètres de la page d\'accueil et des raccourcis"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Permet à une application de modifier les paramètres et les raccourcis de la page d\'accueil."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Recherche Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problème lors du chargement du widget"</string>
+</resources>
diff --git a/res/values-hdpi/wallpapers.xml b/res/values-hdpi/wallpapers.xml
new file mode 100644
index 0000000..26961b3
--- /dev/null
+++ b/res/values-hdpi/wallpapers.xml
@@ -0,0 +1,46 @@
+<?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_electric</item>
+        <item>wallpaper_grass</item>
+        <item>wallpaper_canyon</item>
+        <item>wallpaper_monumentvalley</item>
+        <item>wallpaper_tree</item>
+        <item>wallpaper_zanzibar</item>
+        <item>wallpaper_field</item>
+        <item>wallpaper_cloud</item>
+        <item>wallpaper_desert</item>
+        <item>wallpaper_goldengate</item>
+        <item>wallpaper_despair</item>
+        <item>wallpaper_grass_night</item>
+        <item>wallpaper_galaxy</item>
+        <item>wallpaper_x67</item>
+        <item>wallpaper_nexusrain</item>
+        <item>wallpaper_nexuspattern</item>
+        <item>wallpaper_nexuswallpaper1</item>
+        <item>wallpaper_brown</item>
+        <item>wallpaper_pcut</item>
+        <item>wallpaper_bluedotgrid</item>
+        <item>wallpaper_hazybluedots</item>
+        <item>wallpaper_ropelights</item>
+        <item>wallpaper_gray</item>
+        <item>wallpaper_greengray</item>
+        <item>wallpaper_lightgrad</item>
+    </string-array>
+</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
new file mode 100644
index 0000000..422f998
--- /dev/null
+++ b/res/values-it/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Cartella"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Seleziona sfondo da"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Imposta sfondo"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Sfondi"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Applicazione non installata sul telefono."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configura..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nome cartella"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Rinomina cartella"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Annulla"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Aggiungi a schermata Home"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Applicazioni"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Collegamenti"</string>
+    <string name="group_search" msgid="5905328940867162196">"Ricerca"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nuova cartella"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Cartelle"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widget"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Sfondi"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Cartella"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Orologio"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Cornice immagini"</string>
+    <string name="add_search" msgid="7104834713685095105">"Ricerca"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Spazio nella schermata Home esaurito."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Collegamento \"<xliff:g id="NAME">%s</xliff:g>\" creato."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Il collegamento \"<xliff:g id="NAME">%s</xliff:g>\" è stato rimosso."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Collegamento \"<xliff:g id="NAME">%s</xliff:g>\" già presente."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Seleziona collegamento"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Seleziona cartella"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Tutte le applicazioni"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Home"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Aggiungi"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Sfondo"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Cerca"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notifiche"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gesti"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Impostazioni"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"aggiungere scorciatorie"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Consente a un\'applicazione di aggiungere scorciatoie automaticamente."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"eliminare scorciatoie"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Consente a un\'applicazione di rimuovere scorciatoie automaticamente."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"leggere impostazioni e scorciatoie in Home"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Consente a un\'applicazione di leggere le impostazioni e le scorciatoie in Home."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"creare impostazioni e scorciatoie in Home"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Consente a un\'applicazione di modificare le impostazioni e le scorciatoie in Home."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Ricerca Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Errore durante il caricamento del widget"</string>
+</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
new file mode 100644
index 0000000..2d8cc6b
--- /dev/null
+++ b/res/values-ja/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"ランチャー"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"フォルダ"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"壁紙を選択"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"壁紙に設定"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"壁紙"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"アプリケーションがインストールされていません。"</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"設定..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"フォルダ名"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"フォルダ名を変更"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"キャンセル"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"ホーム画面に追加"</string>
+    <string name="group_applications" msgid="4118484163419674240">"アプリケーション"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"ショートカット"</string>
+    <string name="group_search" msgid="5905328940867162196">"検索"</string>
+    <string name="group_folder" msgid="5143593791798929193">"新しいフォルダ"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"フォルダ"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"ウィジェット"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"壁紙"</string>
+    <string name="add_folder" msgid="3521088587367839879">"フォルダ"</string>
+    <string name="add_clock" msgid="2337943840175865746">"時計"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"写真フレーム"</string>
+    <string name="add_search" msgid="7104834713685095105">"検索"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"ホーム画面に空きスペースがありません。"</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」を作成しました。"</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」を削除しました。"</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」は既に存在します。"</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"ショートカットを選択"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"フォルダの選択"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"すべてのアプリケーション"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"ホーム"</string>
+    <string name="menu_add" msgid="3065046628354640854">"追加"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"壁紙"</string>
+    <string name="menu_search" msgid="4826514464423239041">"検索"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"通知"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"ジェスチャー"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"設定"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"ショートカットのインストール"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"ユーザー操作なしでショートカットの追加をアプリケーションに許可します。"</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"ショートカットのアンインストール"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"ユーザー操作なしでショートカットの削除をアプリケーションに許可します。"</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"ホーム設定とショートカットの読み取り"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"ホームの設定とショートカットの読み取りをアプリケーションに許可します。"</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"ホームの設定とショートカットの書き込み"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"ホームの設定とショートカットの変更をアプリケーションに許可します。"</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google検索"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"ウィジェットを表示できません"</string>
+</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
new file mode 100644
index 0000000..91718b1
--- /dev/null
+++ b/res/values-ko/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core 애플리케이션"</string>
+    <string name="folder_name" msgid="4588446541914685904">"폴더"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"배경화면 선택"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"배경화면 설정"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"배경화면"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"휴대전화에 설치되어 있지 않은 응용프로그램입니다."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"구성..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"폴더 이름"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"폴더 이름 바꾸기"</string>
+    <string name="rename_action" msgid="6016003384693240896">"확인"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"취소"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"홈 화면에 추가"</string>
+    <string name="group_applications" msgid="4118484163419674240">"응용프로그램"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"바로가기"</string>
+    <string name="group_search" msgid="5905328940867162196">"검색"</string>
+    <string name="group_folder" msgid="5143593791798929193">"새 폴더"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"폴더"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"위젯"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"배경화면"</string>
+    <string name="add_folder" msgid="3521088587367839879">"폴더"</string>
+    <string name="add_clock" msgid="2337943840175865746">"시계"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"사진 프레임"</string>
+    <string name="add_search" msgid="7104834713685095105">"검색"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"홈 화면에 더 이상 공간이 없습니다."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 생성되었습니다."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 삭제되었습니다."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 이미 있습니다."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"바로가기 선택"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"폴더 선택"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"모든 응용프로그램"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"홈"</string>
+    <string name="menu_add" msgid="3065046628354640854">"추가"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"배경화면"</string>
+    <string name="menu_search" msgid="4826514464423239041">"검색"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"알림"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"동작"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"설정"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"바로가기 설치"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"응용프로그램이 사용자의 작업 없이 바로가기를 추가할 수 있도록 합니다."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"바로가기 제거"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"응용프로그램이 사용자의 작업 없이 바로가기를 삭제할 수 있도록 합니다."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"홈 설정 및 바로가기 읽기"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"응용프로그램이 홈에 있는 설정 및 바로가기를 읽을 수 있도록 합니다."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"홈 설정 및 바로가기 쓰기"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있도록 합니다."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google 검색"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"위젯을 로드하는 중 문제가 발생했습니다."</string>
+</resources>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
new file mode 100644
index 0000000..d2d31c2
--- /dev/null
+++ b/res/values-land/dimens.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<resources>
+    <dimen name="workspace_cell_width">106dip</dimen>
+    <dimen name="workspace_cell_height">74dip</dimen>
+    <dimen name="search_widget_inset">19dip</dimen>
+    <dimen name="gesture_thumbnail_inset">8dip</dimen>
+    <dimen name="gesture_thumbnail_size">64dip</dimen>
+</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
new file mode 100644
index 0000000..2208898
--- /dev/null
+++ b/res/values-nb/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Utskytingsrampe"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android-kjerneapplikasjoner"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Mappe"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Velg bakgrunnsbilde fra"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Velg bakgrunnsbilde"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Bakgrunner"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Applikasjonen er ikke installert."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurer"</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Mappenavn"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Gi nytt navn til mappe"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Avbryt"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Legg til skrivebord"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Applikasjoner"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Snarveier"</string>
+    <string name="group_search" msgid="5905328940867162196">"Søk"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Ny mappe"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Mapper"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Skrivebordselementer"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Bakgrunner"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Mappe"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Klokke"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Bilderamme"</string>
+    <string name="add_search" msgid="7104834713685095105">"Søk"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Ikke nok plass på skrivebordet."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Opprettet snarveien «<xliff:g id="NAME">%s</xliff:g>»."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Fjernet snarveien «<xliff:g id="NAME">%s</xliff:g>»."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Snarveien «<xliff:g id="NAME">%s</xliff:g>» fins allerede."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Velg snarvei"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Velg mappe"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Alle programmer"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Startsiden"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Legg til"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Bakgrunnsbilde"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Søk"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Varslinger"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Bevegelser"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Innstillinger"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"installere snarveier"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Lar applikasjonen legge til snarveier uten å involvere brukeren."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"avinstallere snarveier"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Lar applikasjonen fjerne snarveier uten å involvere brukeren."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"lese skrivebordsinnstillinger og -snarveier"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Lar applikasjonen lese innstillinger og snarveier fra skrivebordet."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"skrive skrivebordsinnstillinger og -snarveier"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Lar applikasjonen endre innstillinger og snarveier på skrivebordet."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google-søk"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problem under lasting av gadget"</string>
+</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
new file mode 100644
index 0000000..3a69066
--- /dev/null
+++ b/res/values-nl/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android-kerntoepassingen"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Map"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Achtergrond selecteren in"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Achtergrond instellen"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Achtergronden"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Deze toepassing is niet geïnstalleerd op uw telefoon."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configureren..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Mapnaam"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Naam van map wijzigen"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Annuleren"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Toevoegen aan startpagina"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Toepassingen"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Sneltoetsen"</string>
+    <string name="group_search" msgid="5905328940867162196">"Zoeken"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nieuwe map"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Mappen"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Achtergronden"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Map"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Klok"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Fotolijstje"</string>
+    <string name="add_search" msgid="7104834713685095105">"Zoeken"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Er is geen ruimte meer op dit startscherm."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' is gemaakt."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' is verwijderd."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' bestaat al."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Snelkoppeling selecteren"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Map selecteren"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Alle toepassingen"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Startpagina"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Toevoegen"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Achtergrond"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Zoeken"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Meldingen"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gebaren"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Instellingen"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"snelkoppelingen installeren"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Een toepassing toestaan om snelkoppelingen toe te voegen zonder tussenkomst van de gebruiker."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"snelkoppelingen verwijderen"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Een toepassing toestaan om snelkoppelingen te verwijderen zonder tussenkomst van de gebruiker."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"instellingen en snelkoppelingen voor de startpagina lezen"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina lezen."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"instellingen en snelkoppelingen voor de startpagina schrijven"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina wijzigen."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google Zoeken"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Probleem bij het laden van widget"</string>
+</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
new file mode 100644
index 0000000..cc9306b
--- /dev/null
+++ b/res/values-pl/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Program uruchamiający"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Aplikacje główne systemu Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Folder"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Wybierz tapetę"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Ustaw tapetę"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Tapety"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Aplikacja nie jest zainstalowana w telefonie."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfiguruj..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nazwa folderu"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Zmień nazwę folderu"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Anuluj"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Dodaj do strony głównej"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplikacje"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Skróty"</string>
+    <string name="group_search" msgid="5905328940867162196">"Wyszukiwarka"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nowy folder"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Foldery"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widżety"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Tapety"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Folder"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Zegar"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Ramka obrazu"</string>
+    <string name="add_search" msgid="7104834713685095105">"Wyszukiwarka"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Brak miejsca na tej stronie głównej"</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Skrót „<xliff:g id="NAME">%s</xliff:g>” został utworzony."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Skrót „<xliff:g id="NAME">%s</xliff:g>” został usunięty."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Skrót „<xliff:g id="NAME">%s</xliff:g>” już istnieje."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Wybierz skrót"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Wybierz folder"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Wszystkie aplikacje"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Ekran główny"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Dodaj"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Tapeta"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Szukaj"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Powiadomienia"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gesty"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Ustawienia"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"zainstaluj skróty"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Umożliwia aplikacji dodawanie skrótów bez interwencji użytkownika."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"odinstaluj skróty"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Umożliwia aplikacji usuwanie skrótów bez interwencji użytkownika."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"odczytywanie ustawień i skrótów strony głównej"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Umożliwia aplikacji odczytywanie ustawień i skrótów strony głównej."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"zapisywanie ustawień i skrótów strony głównej"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Umożliwia aplikacji zmianę ustawień i skrótów strony głównej."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Szukaj w Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problem podczas ładowania widżetu"</string>
+</resources>
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
new file mode 100644
index 0000000..65a3fd3
--- /dev/null
+++ b/res/values-port/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<resources>
+    <dimen name="workspace_cell_width">80dip</dimen>
+    <dimen name="workspace_cell_height">100dip</dimen>
+</resources>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000..895e945
--- /dev/null
+++ b/res/values-pt-rPT/strings.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Aplicações Principais do Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Pasta"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Seleccionar imagem de fundo a partir de"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Definir imagem de fundo"</string>
+    <!-- no translation found for pick_wallpaper (5630222540525626723) -->
+    <skip />
+    <string name="activity_not_found" msgid="3571057450431950427">"A aplicação não está instalada no telefone."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nome da pasta"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Mudar o nome da pasta"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Cancelar"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Adicionar ao ecrã principal"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplicações"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Atalhos"</string>
+    <string name="group_search" msgid="5905328940867162196">"Pesquisar"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nova pasta"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Pastas"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Imagens de fundo"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Pasta"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Relógio"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Moldura de imagem"</string>
+    <string name="add_search" msgid="7104834713685095105">"Pesquisar"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Não existe espaço suficiente neste ecrã principal."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi criado."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi removido."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" já existe."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Seleccione o atalho"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Seleccione a pasta"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Todas as aplicações"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Página inicial"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Adicionar"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Imagem de fundo"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Pesquisar"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notificações"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Definições"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar atalhos"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite que uma aplicação adicione atalhos sem a intervenção do utilizador."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"desinstalar atalhos"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Permite que uma aplicação remova atalhos sem a intervenção do utilizador."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"ler definições e atalhos do ecrã principal"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Permite que uma aplicação leia as definições e os atalhos do ecrã principal."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"escrever definições e atalhos do ecrã principal"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Permite que uma aplicação altere as definições e os atalhos do ecrã principal."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Pesquisa do Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Erro ao carregar o widget"</string>
+</resources>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
new file mode 100644
index 0000000..003927d
--- /dev/null
+++ b/res/values-pt/strings.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Principais aplicativos do Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Pasta"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Selecionar papel de parede de"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Definir papel de parede"</string>
+    <!-- no translation found for pick_wallpaper (5630222540525626723) -->
+    <skip />
+    <string name="activity_not_found" msgid="3571057450431950427">"O aplicativo não está instalado no seu telefone."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Nome da pasta"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Renomear pasta"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Cancelar"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Adicionar à tela da Página inicial"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Aplicativos"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Atalhos"</string>
+    <string name="group_search" msgid="5905328940867162196">"Pesquisar"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Nova pasta"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Pastas"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Papéis de parede"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Pasta"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Relógio"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Frame da imagem"</string>
+    <string name="add_search" msgid="7104834713685095105">"Pesquisar"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Não há mais espaço nesta tela da Página inicial."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Atalho \"<xliff:g id="NAME">%s</xliff:g>\" criado."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi removido."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" já existe."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Selecionar atalho"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Selecionar pasta"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Todos os aplicativos"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Página inicial"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Adicionar"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Papel de parede"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Pesquisar"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Notificações"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Configurações"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar atalhos"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite que um aplicativo adicione os atalhos sem a intervenção do usuário."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"desinstalar atalhos"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Permite que um aplicativo remova os atalhos sem a intervenção do usuário."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"ler configurações e atalhos da Página inicial"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Permite que um aplicativo leia as configurações e atalhos na Página inicial."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"gravar configurações e atalhos da Página inicial"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Permite que um aplicativo altere as configurações e atalhos na Página inicial."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Pesquisa do Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Problema ao carregar o widget"</string>
+</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
new file mode 100644
index 0000000..7542fdb
--- /dev/null
+++ b/res/values-ru/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Основные приложения Android"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Папка"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Выбрать обои из:"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Установить обои"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Обои"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Приложение не установлено на телефоне."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Настроить..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Название папки"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Переименовать папку"</string>
+    <string name="rename_action" msgid="6016003384693240896">"ОК"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Отмена"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Добавить на главный экран"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Приложения"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Ярлыки"</string>
+    <string name="group_search" msgid="5905328940867162196">"Поиск"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Новая папка"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Папки"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Виджеты"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Обои"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Папка"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Часы"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Рамка фотографии"</string>
+    <string name="add_search" msgid="7104834713685095105">"Поиск"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"На этом главном экране нет свободного места."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" создан"</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" удален."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" уже существует."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Выберите ярлык"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Выбор папки"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Все приложения"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Главная"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Добавить"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Обои"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Поиск"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Уведомления"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Жесты"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Настройки"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"устанавливать ярлыки"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Позволяет приложению добавлять ярлыки без вмешательства пользователя"</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"удалять ярлыки"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Позволяет приложению удалять ярлыки без участия пользователя"</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"считывать настройки и ярлыки главного экрана"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Позволяет приложению считывать настройки и ярлыки на главном экране."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"изменять настройки и ярлыки главного экрана"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Позволяет приложению изменять настройки и ярлыки на главном экране."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Поиск Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Не удалось загрузить виджет"</string>
+</resources>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
new file mode 100644
index 0000000..efc9227
--- /dev/null
+++ b/res/values-sv/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Startbild"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Mapp"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Välj bakgrund från"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Ange bakgrund"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Bakgrundsbilder"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Programmet är inte installerat på din telefon."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurera..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Mappnamn"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Byt namn på mapp"</string>
+    <string name="rename_action" msgid="6016003384693240896">"OK"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"Avbryt"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Lägg till på startsidan"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Program"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Genvägar"</string>
+    <string name="group_search" msgid="5905328940867162196">"Sök"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Ny mapp"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Mappar"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widgetar"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Bakgrundsbilder"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Mapp"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Klocka"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Bildram"</string>
+    <string name="add_search" msgid="7104834713685095105">"Sök"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Det finns inte plats för mer på den här startsidan."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" har skapats."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" har tagits bort."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" finns redan."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Välj genväg"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Välj mapp"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Alla program"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Startsida"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Lägg till"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Bakgrund"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Sök"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Aviseringar"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Gester"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Inställningar"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"installera genvägar"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Tillåter att ett program lägger till genvägar utan åtgärd från användaren."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"avinstallera genvägar"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Tillåter att ett program tar bort genvägar utan åtgärd från användaren."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"läsa inställningar och genvägar för startsidan"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Tillåter att ett program läser inställningar och genvägar på startsidan."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"skriva inställningar och genvägar för startsidan"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Tillåter att ett program ändrar inställningar och genvägar på startsidan."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Sök på Google"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Det gick inte att läsa in widgeten"</string>
+</resources>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
new file mode 100644
index 0000000..5e823ed
--- /dev/null
+++ b/res/values-tr/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
+    <string name="folder_name" msgid="4588446541914685904">"Klasör"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"Buradan duvar kağıdını seçin:"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Duvar kağıdını ayarla"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Duvar Kağıtları"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"Uygulama telefonunuza yüklenmemiş."</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"Yapılandır..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"Klasör adı"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"Klasörü yeniden adlandır"</string>
+    <string name="rename_action" msgid="6016003384693240896">"Tamam"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"İptal"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"Ana ekrana ekle"</string>
+    <string name="group_applications" msgid="4118484163419674240">"Uygulamalar"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"Kısayollar"</string>
+    <string name="group_search" msgid="5905328940867162196">"Arama"</string>
+    <string name="group_folder" msgid="5143593791798929193">"Yeni klasör"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"Klasörler"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"Widget\'lar"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Duvar Kağıtları"</string>
+    <string name="add_folder" msgid="3521088587367839879">"Klasör"</string>
+    <string name="add_clock" msgid="2337943840175865746">"Saat"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"Resim çerçevesi"</string>
+    <string name="add_search" msgid="7104834713685095105">"Arama"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"Bu Ana ekranda başka yer yok."</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu oluşturuldu."</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu kaldırıldı."</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu zaten var."</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"Kısayolu seçin"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"Klasörü seçin"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"Tüm uygulamalar"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"Ana Sayfa"</string>
+    <string name="menu_add" msgid="3065046628354640854">"Ekle"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"Duvar Kağıdı"</string>
+    <string name="menu_search" msgid="4826514464423239041">"Ara"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"Bildirimler"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"Hareketler"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"Ayarlar"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"kısayolları yükle"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"Bir uygulamaya, kısayolları kullanıcı müdahale etmeden ekleme izni verir."</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"kısayolları kaldır"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"Bir uygulamaya, kısayolları kullanıcı müdahale etmeden kaldırma izni verir."</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"Ana Sayfa ayarlarını ve kısayollarını oku"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"Bir uygulamaya Ana Sayfadaki ayarları ve kısayolları okuma izni verir."</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"Ana Sayfa ayarlarını ve kısayollarını yaz"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"Bir uygulamaya Ana Sayfadaki ayarları ve kısayolları değiştirme izni verir."</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google Arama"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"Widget yüklenirken sorun oluştu"</string>
+</resources>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..98eb170
--- /dev/null
+++ b/res/values-zh-rCN/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"启动程序"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android 核心应用程序"</string>
+    <string name="folder_name" msgid="4588446541914685904">"文件夹"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"选择壁纸来源"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"设置壁纸"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"壁纸"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"您的手机上未安装应用程序。"</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"配置..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"文件夹名称"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"重命名文件夹"</string>
+    <string name="rename_action" msgid="6016003384693240896">"确定"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"取消"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"添加到主屏幕"</string>
+    <string name="group_applications" msgid="4118484163419674240">"应用程序"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"快捷方式"</string>
+    <string name="group_search" msgid="5905328940867162196">"搜索"</string>
+    <string name="group_folder" msgid="5143593791798929193">"新建文件夹"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"文件夹"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"窗口小部件"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"壁纸"</string>
+    <string name="add_folder" msgid="3521088587367839879">"文件夹"</string>
+    <string name="add_clock" msgid="2337943840175865746">"时钟"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"相框"</string>
+    <string name="add_search" msgid="7104834713685095105">"搜索"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"此主屏幕上已没有空间。"</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"已创建“<xliff:g id="NAME">%s</xliff:g>”快捷方式。"</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"已删除“<xliff:g id="NAME">%s</xliff:g>”快捷方式。"</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"“<xliff:g id="NAME">%s</xliff:g>”快捷方式已存在。"</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"选择快捷方式"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"选择文件夹"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"所有应用程序"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"主屏幕"</string>
+    <string name="menu_add" msgid="3065046628354640854">"添加"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"壁纸"</string>
+    <string name="menu_search" msgid="4826514464423239041">"搜索"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"通知"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"手势"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"设置"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"安装快捷方式"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"允许应用程序在没有用户介入的情况下添加快捷方式。"</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"卸载快捷方式"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"允许应用程序在没有用户介入的情况下删除快捷方式。"</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"读取主屏幕的设置和快捷方式"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"允许应用程序读取主屏幕的设置和快捷方式。"</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"写入主屏幕的设置和快捷方式"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"允许应用程序更改主屏幕的设置和快捷方式。"</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google 搜索"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"载入窗口小部件时出现问题"</string>
+</resources>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..8d3d8a0
--- /dev/null
+++ b/res/values-zh-rTW/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="application_name" msgid="8424725141379931883">"發射器"</string>
+    <string name="uid_name" msgid="3371120195364560632">"Android 核心應用程式"</string>
+    <string name="folder_name" msgid="4588446541914685904">"資料夾"</string>
+    <string name="chooser_wallpaper" msgid="5988031014201479733">"從…選取桌布"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"設定桌布"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"桌布"</string>
+    <string name="activity_not_found" msgid="3571057450431950427">"應用程式未安裝到手機。"</string>
+    <string name="configure_wallpaper" msgid="2820186271419674623">"設定..."</string>
+    <string name="rename_folder_label" msgid="5646236631298452787">"資料夾名稱"</string>
+    <string name="rename_folder_title" msgid="4544573104191526550">"重新命名資料夾"</string>
+    <string name="rename_action" msgid="6016003384693240896">"確定"</string>
+    <string name="cancel_action" msgid="3811860427489435048">"取消"</string>
+    <string name="menu_item_add_item" msgid="6233177331075781114">"新增至首頁畫面"</string>
+    <string name="group_applications" msgid="4118484163419674240">"應用程式"</string>
+    <string name="group_shortcuts" msgid="9133529424900391877">"捷徑"</string>
+    <string name="group_search" msgid="5905328940867162196">"搜尋"</string>
+    <string name="group_folder" msgid="5143593791798929193">"新資料夾"</string>
+    <string name="group_live_folders" msgid="2664945399140647217">"資料夾"</string>
+    <string name="group_widgets" msgid="6704978494073105844">"小工具"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"桌布"</string>
+    <string name="add_folder" msgid="3521088587367839879">"資料夾"</string>
+    <string name="add_clock" msgid="2337943840175865746">"時鐘"</string>
+    <string name="add_photo_frame" msgid="3154058437359487954">"相框"</string>
+    <string name="add_search" msgid="7104834713685095105">"搜尋"</string>
+    <string name="out_of_space" msgid="8365249326091984698">"首頁已無空間"</string>
+    <string name="shortcut_installed" msgid="7071557296331322355">"已建立「<xliff:g id="NAME">%s</xliff:g>」捷徑。"</string>
+    <string name="shortcut_uninstalled" msgid="2129499669449749995">"已移除「<xliff:g id="NAME">%s</xliff:g>」捷徑。"</string>
+    <string name="shortcut_duplicate" msgid="4757756326465060694">"「<xliff:g id="NAME">%s</xliff:g>」捷徑已經存在。"</string>
+    <string name="title_select_shortcut" msgid="2858897527672831763">"選取捷徑"</string>
+    <string name="title_select_live_folder" msgid="3753447798805166749">"選取資料夾"</string>
+    <string name="all_apps_button_label" msgid="3953036962111614813">"所有應用程式"</string>
+    <string name="all_apps_home_button_label" msgid="1022222300329398558">"主螢幕"</string>
+    <string name="menu_add" msgid="3065046628354640854">"新增"</string>
+    <string name="menu_wallpaper" msgid="5837429080911269832">"桌布"</string>
+    <string name="menu_search" msgid="4826514464423239041">"搜尋"</string>
+    <string name="menu_notifications" msgid="6424587053194766192">"通知"</string>
+    <string name="menu_gestures" msgid="514678675575912237">"觸控動作"</string>
+    <string name="menu_settings" msgid="6233960148378443661">"設定"</string>
+    <string name="permlab_install_shortcut" msgid="1201690825493376489">"安裝捷徑"</string>
+    <string name="permdesc_install_shortcut" msgid="7429365847558984148">"允許應用程式自動新增快速鍵。"</string>
+    <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"解除安裝捷徑"</string>
+    <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"允許應用程式自動移除捷徑。"</string>
+    <string name="permlab_read_settings" msgid="3452408290738106747">"讀取首頁設定和捷徑"</string>
+    <string name="permdesc_read_settings" msgid="8377434937176025492">"允許應用程式讀取首頁中的設定和捷徑。"</string>
+    <string name="permlab_write_settings" msgid="1360567537236705628">"寫入首頁設定和捷徑"</string>
+    <string name="permdesc_write_settings" msgid="1098648778383349818">"允許應用程式變更首頁中的設定和捷徑。"</string>
+    <string name="search_hint" msgid="6974176141372467453">"Google 搜尋"</string>
+    <string name="gadget_error_text" msgid="8359351016167075858">"載入小工具時發生問題"</string>
+</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
new file mode 100644
index 0000000..a0085bc
--- /dev/null
+++ b/res/values/attrs.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <!-- Orientation of a widget. -->
+    <attr name="direction">
+        <!-- Vertical widget. -->
+        <enum name="vertical" value="0" />
+        <!-- Horizontal widget. -->
+        <enum name="horizontal" value="1" />
+    </attr>
+
+    <skip />
+
+    <!-- Workspace specific attributes. These attributes are used to customize
+         the workspace in XML files. -->
+    <declare-styleable name="Workspace">
+        <!-- The first screen the workspace should display. -->
+        <attr name="defaultScreen" format="integer"  />
+    </declare-styleable>
+    
+    <!-- CellLayout specific attributes. These attributes are used to customize
+         a CellLayout view in XML files. -->
+    <declare-styleable name="CellLayout">
+        <!-- The width of a single cell -->
+        <attr name="cellWidth" format="dimension"  />
+        <!-- The height of a single cell -->
+        <attr name="cellHeight" format="dimension"  />
+        <!-- Padding to apply at the start of the long axis -->
+        <attr name="longAxisStartPadding" format="dimension"  />
+        <!-- Padding to apply at the end of the long axis -->
+        <attr name="longAxisEndPadding" format="dimension"  />
+        <!-- Padding to apply at the start of the short axis -->
+        <attr name="shortAxisStartPadding" format="dimension"  />
+        <!-- Padding to apply at the end of the short axis -->
+        <attr name="shortAxisEndPadding" format="dimension"  />
+        <!-- Number of cells on the short axis of the CellLayout -->
+        <attr name="shortAxisCells" format="integer" />
+        <!-- Number of cells on the long axis of the CellLayout -->
+        <attr name="longAxisCells" format="integer" />
+    </declare-styleable>
+
+    <!-- DeleteZone specific attributes. These attributes are used to customize
+         a DeleteZone view in XML files. -->
+    <declare-styleable name="DeleteZone">
+        <!-- Orientation of the delete zone. -->
+        <attr name="direction" />
+    </declare-styleable>
+
+    <!-- HandleView specific attributes. These attributes are used to customize
+         a HandleView view in XML files. -->
+    <declare-styleable name="HandleView">
+        <!-- Orientation of the handle. -->
+        <attr name="direction" />
+    </declare-styleable>
+
+    <!-- XML attributes used by default_workspace.xml -->
+    <declare-styleable name="Favorite">
+        <attr name="className" format="string" />
+        <attr name="packageName" format="string" />
+        <attr name="screen" format="string" />
+        <attr name="x" format="string" />
+        <attr name="y" format="string" />
+        <attr name="spanX" format="string" />
+        <attr name="spanY" format="string" />
+        <attr name="icon" format="reference" />  
+        <attr name="title" format="reference" />
+        <attr name="uri" format="string" />
+    </declare-styleable>
+</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
new file mode 100644
index 0000000..9b9700f
--- /dev/null
+++ b/res/values/colors.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+    <color name="window_background">#FF191919</color>
+    <color name="grid_dark_background">#EB191919</color>     
+    <color name="bubble_dark_background">#B2191919</color>
+    <color name="delete_color_filter">#A5FF0000</color>
+
+    <color name="appwidget_error_color">#FCCC</color>
+    <color name="snag_callout_color">#F444</color>
+
+    <color name="gesture_color">#ff0563c1</color>
+    <color name="uncertain_gesture_color">#ff848484</color>
+</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
new file mode 100644
index 0000000..e0ca384
--- /dev/null
+++ b/res/values/dimens.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<resources>
+    <dimen name="search_widget_inset">19dip</dimen>
+    <dimen name="gesture_thumbnail_inset">8dip</dimen>
+    <dimen name="gesture_thumbnail_size">64dip</dimen>
+    <dimen name="button_bar_height">56dip</dimen>
+</resources>
diff --git a/res/values/extra_wallpapers.xml b/res/values/extra_wallpapers.xml
new file mode 100644
index 0000000..9e0951c
--- /dev/null
+++ b/res/values/extra_wallpapers.xml
@@ -0,0 +1,21 @@
+<?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="extra_wallpapers">
+    </string-array>
+</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
new file mode 100644
index 0000000..38f27c7
--- /dev/null
+++ b/res/values/strings.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- General -->
+    <skip />
+    <!-- Application name -->
+    <string name="application_name">Launcher</string>
+    <!-- Name for all applications running as this uid. -->
+    <string name="uid_name">Android Core Apps</string>
+    <!-- Default folder name -->
+    <string name="folder_name">Folder</string>
+    <!-- Title of dialog that appears after user selects Wallpaper from menu -->
+    <string name="chooser_wallpaper">Select wallpaper from</string>
+    <!-- Button label on Wallpaper Gallery screen; user selects this button to set a specific wallpaper -->
+    <string name="wallpaper_instructions">Set wallpaper</string>
+    <!-- Option in "Select wallpaper from" dialog box -->
+    <string name="pick_wallpaper">Wallpapers</string>
+    <!-- Displayed when user selects a shortcut for an app that was uninstalled -->
+    <string name="activity_not_found">Application is not installed on your phone.</string>
+    <!-- List item for configuring the current wallpaper -->
+    <string name="configure_wallpaper">Configure...</string>
+
+    <!-- Folders -->
+    <skip />
+    <!-- Label of Folder name field in Rename folder dialog box -->
+    <string name="rename_folder_label">Folder name</string>
+    <!-- Title of dialog box -->
+    <string name="rename_folder_title">Rename folder</string>
+    <!-- Buttons in Rename folder dialog box -->
+    <string name="rename_action">OK</string>
+    <!-- Buttons in Rename folder dialog box -->
+    <string name="cancel_action">Cancel</string>
+
+    <!-- Shortcuts -->
+    <skip />
+    <!-- Title of dialog box -->
+    <string name="menu_item_add_item">Add to Home screen</string>
+    <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all apps -->
+    <string name="group_applications">Applications</string>
+    <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all shortcuts -->
+    <string name="group_shortcuts">Shortcuts</string>
+    <!-- Options in "Add to Home" dialog box; Title of the search gadget -->
+    <string name="group_search">Search</string>
+    <!-- Options in "Add to Home" dialog box; Title of the folder gadget -->
+    <string name="group_folder">New folder</string>
+    <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all live folders -->
+    <string name="group_live_folders">Folders</string>
+    <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all widgets/gadgets -->
+    <string name="group_widgets">Widgets</string>
+    <!-- Options in "Add to Home" dialog box; Title of the group containing the list of apps that can set the wallpaper-->
+    <string name="group_wallpapers">Wallpapers</string>
+    <!-- Options in "Add to Home" dialog box; Name of the Folder widget-->
+    <string name="add_folder">Folder</string>
+    <!-- Options in "Add to Home" dialog box; Name of the Clock widget-->
+    <string name="add_clock">Clock</string>
+    <!-- Options in "Add to Home" dialog box; Name of the Picture frame widget-->
+    <string name="add_photo_frame">Picture frame</string>
+    <!-- Options in "Add to Home" dialog box; Name of the global search widget-->
+    <string name="add_search">Search</string>
+    <!-- Error message when user has filled a home screen, possibly not used -->
+    <string name="out_of_space">No more room on this Home screen.</string>
+    <!-- Message displayed when a shortcut is created by an external application -->
+    <string name="shortcut_installed">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" created.</string>
+    <!-- Message displayed when a shortcut is uninstalled by an external application -->
+    <string name="shortcut_uninstalled">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" was removed.</string>
+    <!-- Message displayed when an external application attemps to create a shortcut that already exists -->
+    <string name="shortcut_duplicate">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" already exists.</string>
+
+    <!-- Title of dialog when user is selecting shortcut to add to homescreen -->
+    <string name="title_select_shortcut">Select shortcut</string>
+    <!-- Title of dialog when user is selecting live folder to add to homescreen -->
+    <string name="title_select_live_folder">Select folder</string>
+
+    <!-- All applications label for accessibilty (spoken when the button gets focus). -->
+    <string name="all_apps_button_label">All applications</string>
+    <!-- Label for button in all applications label to go back home (to the workspace / desktop)
+         for accessibilty (spoken when the button gets focus). -->
+    <string name="all_apps_home_button_label">Home</string>
+
+    <!-- Menus items: -->
+    <skip />
+    <!-- Verb, menu item used to add an item on the desktop -->
+    <string name="menu_add">Add</string>
+    <!-- Noun, menu item used to set the desktop's wallpaper -->
+    <string name="menu_wallpaper">Wallpaper</string>
+    <!-- Verb, menu item used to initiate global search -->
+    <string name="menu_search">Search</string>
+    <!-- Noun, menu item used to bring down the notifications shade -->
+    <string name="menu_notifications">Notifications</string>
+    <!-- Noun, menu item used to show the gestures settings -->
+    <string name="menu_gestures">Gestures</string>
+    <!-- Noun, menu item used to show the system settings -->
+    <string name="menu_settings">Settings</string>
+
+    <!-- Permissions: -->
+    <string name="permlab_install_shortcut">install shortcuts</string>
+    <string name="permdesc_install_shortcut">Allows an application to add
+        shortcuts without user intervention.</string>
+    <string name="permlab_uninstall_shortcut">uninstall shortcuts</string>
+    <string name="permdesc_uninstall_shortcut">Allows an application to remove
+        shortcuts without user intervention.</string>
+    <string name="permlab_read_settings">read Home settings and shortcuts</string>
+    <string name="permdesc_read_settings">Allows an application to read the settings and
+        shortcuts in Home.</string>
+    <string name="permlab_write_settings">write Home settings and shortcuts</string>
+    <string name="permdesc_write_settings">Allows an application to change the settings and
+        shortcuts in Home.</string>
+
+    <!-- Widgets: -->
+    <skip />    
+
+    <!-- TODO: Determine if this can be removed.
+         This is the hint text shown in the search widget, before text is entered.
+         This translation SHOULD MATCH the string "search_hint" which is found in 
+         GoogleSearch/res/values/strings.xml -->
+    <string name="search_hint">Google Search</string>
+
+    <!-- Text to show user in place of a gadget when we can't display it properly -->
+    <string name="gadget_error_text">Problem loading widget</string>
+
+</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644
index 0000000..125a1be
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources>
+    <style name="Theme" parent="android:Theme.Wallpaper">
+        <item name="android:windowNoTitle">true</item>
+    </style>
+
+    <style name="AnimationPreview">
+        <item name="android:windowEnterAnimation">@anim/fade_in_fast</item>
+        <item name="android:windowExitAnimation">@anim/fade_out_fast</item>
+    </style>
+    
+    <style name="WorkspaceIcon">
+        <item name="android:textSize">13dip</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">marquee</item>
+        <item name="android:shadowColor">#FF000000</item>
+        <item name="android:shadowRadius">2.0</item>
+        <item name="android:textColor">#FFF</item>
+        <item name="android:gravity">center_horizontal</item>
+        <item name="android:layout_width">fill_parent</item>
+        <item name="android:layout_height">fill_parent</item>
+        <item name="android:background">@drawable/shortcut_selector</item>
+        <item name="android:paddingLeft">5dip</item>
+        <item name="android:paddingRight">5dip</item>
+    </style>
+
+    <style name="WorkspaceIcon.Portrait">
+        <item name="android:drawablePadding">5dip</item>
+        <item name="android:paddingTop">4dip</item>
+        <item name="android:layout_marginLeft">3dip</item>
+        <item name="android:layout_marginRight">3dip</item>
+        <item name="android:layout_marginTop">13dip</item>
+        <item name="android:layout_marginBottom">8dip</item>
+    </style>
+
+    <style name="WorkspaceIcon.Landscape">
+        <item name="android:drawablePadding">3dip</item>
+        <item name="android:paddingTop">2dip</item>
+        <item name="android:layout_marginLeft">10dip</item>
+        <item name="android:layout_marginRight">10dip</item>
+    </style>
+
+    <style name="SearchButton" parent="@android:style/Widget.Button.Small">
+        <item name="android:paddingTop">7dip</item>
+        <item name="android:paddingBottom">9dip</item>
+        <item name="android:paddingLeft">10dip</item>
+        <item name="android:paddingRight">10dip</item>
+    </style>
+
+</resources>
diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml
new file mode 100644
index 0000000..4213d36
--- /dev/null
+++ b/res/xml/default_workspace.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2">
+
+    <!--  Left screen [1] -->
+    <favorite
+        launcher:packageName="com.android.camera"
+        launcher:className="com.android.camera.Camera"
+        launcher:screen="1"
+        launcher:x="1"
+        launcher:y="3" />
+
+     <favorite
+        launcher:packageName="com.cooliris.media"
+        launcher:className="com.cooliris.media.Gallery"
+        launcher:screen="1"
+        launcher:x="2"
+        launcher:y="3" />
+        
+    <!--  Middle screen [2] -->
+    <search
+        launcher:screen="2"
+        launcher:x="0"
+        launcher:y="0" />
+
+   <favorite
+        launcher:packageName="com.android.contacts"
+        launcher:className="com.android.contacts.DialtactsActivity"
+        launcher:screen="2"
+        launcher:x="0"
+        launcher:y="3" />
+
+    <favorite
+        launcher:packageName="com.android.contacts"
+        launcher:className="com.android.contacts.DialtactsContactsEntryActivity"
+        launcher:screen="2"
+        launcher:x="1"
+        launcher:y="3" />
+
+    <favorite
+        launcher:packageName="com.android.browser"
+        launcher:className="com.android.browser.BrowserActivity"
+        launcher:screen="2"
+        launcher:x="2"
+        launcher:y="3" />
+
+    <favorite
+        launcher:packageName="com.google.android.apps.maps"
+        launcher:className="com.google.android.maps.MapsActivity"
+        launcher:screen="2"
+        launcher:x="3"
+        launcher:y="3" />
+
+    <favorite
+        launcher:packageName="com.android.mms"
+        launcher:className="com.android.mms.ui.ConversationList"
+        launcher:screen="2"
+        launcher:x="0"
+        launcher:y="2" />
+
+    <favorite
+        launcher:packageName="com.android.vending"
+        launcher:className="com.android.vending.AssetBrowserActivity"
+        launcher:screen="2"
+        launcher:x="3"
+        launcher:y="2" />
+
+    <!--  Right screen [3] -->
+
+    <appwidget
+        launcher:packageName="com.android.settings"
+        launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
+        launcher:screen="3"
+        launcher:x="0"
+        launcher:y="0"
+        launcher:spanX="4"
+        launcher:spanY="1" />
+ 
+    <favorite
+        launcher:packageName="com.google.android.gm"
+        launcher:className="com.google.android.gm.ConversationListActivityGmail"
+        launcher:screen="3"
+        launcher:x="1"
+        launcher:y="3" />
+
+    <favorite
+        launcher:packageName="com.google.android.talk"
+        launcher:className="com.google.android.talk.SigningInActivity"
+        launcher:screen="3"
+        launcher:x="2"
+        launcher:y="3" />
+</favorites>
diff --git a/src/com/android/launcher2/ActivityPicker.java b/src/com/android/launcher2/ActivityPicker.java
new file mode 100644
index 0000000..b6da08e
--- /dev/null
+++ b/src/com/android/launcher2/ActivityPicker.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import com.android.internal.app.AlertActivity;
+import com.android.internal.app.AlertController;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.Intent.ShortcutIconResource;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.PaintFlagsDrawFilter;
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.PaintDrawable;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Displays a list of all activities matching the incoming
+ * {@link android.content.Intent#EXTRA_INTENT} query, along with any injected items.
+ */
+public class ActivityPicker extends AlertActivity implements
+        DialogInterface.OnClickListener, DialogInterface.OnCancelListener {
+
+    /**
+     * Adapter of items that are displayed in this dialog.
+     */
+    private PickAdapter mAdapter;
+
+    /**
+     * Base {@link android.content.Intent} used when building list.
+     */
+    private Intent mBaseIntent;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        final Intent intent = getIntent();
+
+        // Read base intent from extras, otherwise assume default
+        Parcelable parcel = intent.getParcelableExtra(Intent.EXTRA_INTENT);
+        if (parcel instanceof Intent) {
+            mBaseIntent = (Intent) parcel;
+        } else {
+            mBaseIntent = new Intent(Intent.ACTION_MAIN, null);
+            mBaseIntent.addCategory(Intent.CATEGORY_DEFAULT);
+        }
+
+        // Create dialog parameters
+        AlertController.AlertParams params = mAlertParams;
+        params.mOnClickListener = this;
+        params.mOnCancelListener = this;
+
+        // Use custom title if provided, otherwise default window title
+        if (intent.hasExtra(Intent.EXTRA_TITLE)) {
+            params.mTitle = intent.getStringExtra(Intent.EXTRA_TITLE);
+        } else {
+            params.mTitle = getTitle();
+        }
+
+        // Build list adapter of pickable items
+        List<PickAdapter.Item> items = getItems();
+        mAdapter = new PickAdapter(this, items);
+        params.mAdapter = mAdapter;
+
+        setupAlert();
+    }
+
+    /**
+     * Handle clicking of dialog item by passing back
+     * {@link #getIntentForPosition(int)} in {@link #setResult(int, android.content.Intent)}.
+     */
+    public void onClick(DialogInterface dialog, int which) {
+        Intent intent = getIntentForPosition(which);
+        setResult(Activity.RESULT_OK, intent);
+        finish();
+    }
+
+    /**
+     * Handle canceled dialog by passing back {@link android.app.Activity#RESULT_CANCELED}.
+     */
+    public void onCancel(DialogInterface dialog) {
+        setResult(Activity.RESULT_CANCELED);
+        finish();
+    }
+
+    /**
+     * Build the specific {@link android.content.Intent} for a given list position. Convenience
+     * method that calls through to {@link PickAdapter.Item#getIntent(android.content.Intent)}.
+     */
+    protected Intent getIntentForPosition(int position) {
+        PickAdapter.Item item = (PickAdapter.Item) mAdapter.getItem(position);
+        return item.getIntent(mBaseIntent);
+    }
+
+    /**
+     * Build and return list of items to be shown in dialog. Default
+     * implementation mixes activities matching {@link #mBaseIntent} from
+     * {@link #putIntentItems(android.content.Intent, java.util.List)} with any injected items from
+     * {@link android.content.Intent#EXTRA_SHORTCUT_NAME}. Override this method in subclasses to
+     * change the items shown.
+     */
+    protected List<PickAdapter.Item> getItems() {
+        PackageManager packageManager = getPackageManager();
+        List<PickAdapter.Item> items = new ArrayList<PickAdapter.Item>();
+
+        // Add any injected pick items
+        final Intent intent = getIntent();
+        ArrayList<String> labels =
+            intent.getStringArrayListExtra(Intent.EXTRA_SHORTCUT_NAME);
+        ArrayList<ShortcutIconResource> icons =
+            intent.getParcelableArrayListExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE);
+
+        if (labels != null && icons != null && labels.size() == icons.size()) {
+            for (int i = 0; i < labels.size(); i++) {
+                String label = labels.get(i);
+                Drawable icon = null;
+
+                try {
+                    // Try loading icon from requested package
+                    ShortcutIconResource iconResource = icons.get(i);
+                    Resources res = packageManager.getResourcesForApplication(
+                            iconResource.packageName);
+                    icon = res.getDrawable(res.getIdentifier(
+                            iconResource.resourceName, null, null));
+                } catch (NameNotFoundException e) {
+                    // Ignore
+                }
+
+                items.add(new PickAdapter.Item(this, label, icon));
+            }
+        }
+
+        // Add any intent items if base was given
+        if (mBaseIntent != null) {
+            putIntentItems(mBaseIntent, items);
+        }
+
+        return items;
+    }
+
+    /**
+     * Fill the given list with any activities matching the base {@link android.content.Intent}.
+     */
+    protected void putIntentItems(Intent baseIntent, List<PickAdapter.Item> items) {
+        PackageManager packageManager = getPackageManager();
+        List<ResolveInfo> list = packageManager.queryIntentActivities(baseIntent,
+                0 /* no flags */);
+        Collections.sort(list, new ResolveInfo.DisplayNameComparator(packageManager));
+
+        final int listSize = list.size();
+        for (int i = 0; i < listSize; i++) {
+            ResolveInfo resolveInfo = list.get(i);
+            items.add(new PickAdapter.Item(this, packageManager, resolveInfo));
+        }
+    }
+
+    /**
+     * Adapter which shows the set of activities that can be performed for a
+     * given {@link android.content.Intent}.
+     */
+    protected static class PickAdapter extends BaseAdapter {
+
+        /**
+         * Item that appears in a {@link PickAdapter} list.
+         */
+        public static class Item {
+            protected static IconResizer sResizer;
+
+            protected IconResizer getResizer(Context context) {
+                if (sResizer == null) {
+                    sResizer = new IconResizer(context);
+                }
+                return sResizer;
+            }
+
+            CharSequence label;
+            Drawable icon;
+            String packageName;
+            String className;
+            Bundle extras;
+
+            /**
+             * Create a list item from given label and icon.
+             */
+            Item(Context context, CharSequence label, Drawable icon) {
+                this.label = label;
+                this.icon = getResizer(context).createIconThumbnail(icon);
+            }
+
+            /**
+             * Create a list item and fill it with details from the given
+             * {@link android.content.pm.ResolveInfo} object.
+             */
+            Item(Context context, PackageManager pm, ResolveInfo resolveInfo) {
+                label = resolveInfo.loadLabel(pm);
+                if (label == null && resolveInfo.activityInfo != null) {
+                    label = resolveInfo.activityInfo.name;
+                }
+
+                icon = getResizer(context).createIconThumbnail(resolveInfo.loadIcon(pm));
+                packageName = resolveInfo.activityInfo.applicationInfo.packageName;
+                className = resolveInfo.activityInfo.name;
+            }
+
+            Intent getIntent(Intent baseIntent) {
+                Intent intent = new Intent(baseIntent);
+                if (packageName != null && className != null) {
+                    // Valid package and class, so fill details as normal intent
+                    intent.setClassName(packageName, className);
+                    if (extras != null) {
+                        intent.putExtras(extras);
+                    }
+                } else {
+                    // No valid package or class, so treat as shortcut with label
+                    intent.setAction(Intent.ACTION_CREATE_SHORTCUT);
+                    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label);
+                }
+                return intent;
+            }
+        }
+
+        private final LayoutInflater mInflater;
+
+        private List<Item> mItems;
+        private int mLayoutRes = R.layout.pick_item;
+
+        /**
+         * Create an adapter for the given items.
+         */
+        public PickAdapter(Context context, List<Item> items) {
+            mInflater = (LayoutInflater)
+                    context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            mItems = items;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public int getCount() {
+            return mItems.size();
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public Object getItem(int position) {
+            return mItems.get(position);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public long getItemId(int position) {
+            return position;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public View getView(int position, View convertView, ViewGroup parent) {
+            if (convertView == null) {
+                convertView = mInflater.inflate(mLayoutRes, parent, false);
+            }
+
+            Item item = (Item) getItem(position);
+            TextView textView = (TextView) convertView;
+            textView.setText(item.label);
+            textView.setCompoundDrawablesWithIntrinsicBounds(item.icon, null, null, null);
+
+            return convertView;
+        }
+    }
+
+    /**
+     * Utility class to resize icons to match default icon size. Code is mostly
+     * borrowed from Launcher.
+     */
+    private static class IconResizer {
+        private int mIconWidth = -1;
+        private int mIconHeight = -1;
+
+        private final Rect mOldBounds = new Rect();
+        private Canvas mCanvas = new Canvas();
+        private Resources mResources;
+
+        public IconResizer(Context context) {
+            mCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
+                    Paint.FILTER_BITMAP_FLAG));
+
+            mResources = context.getResources();
+            mIconWidth = mIconHeight = (int) mResources.getDimension(
+                    android.R.dimen.app_icon_size);
+        }
+
+        /**
+         * Returns a Drawable representing the thumbnail of the specified Drawable.
+         * The size of the thumbnail is defined by the dimension
+         * android.R.dimen.launcher_application_icon_size.
+         *
+         * This method is not thread-safe and should be invoked on the UI thread only.
+         *
+         * @param icon The icon to get a thumbnail of.
+         *
+         * @return A thumbnail for the specified icon or the icon itself if the
+         *         thumbnail could not be created.
+         */
+        public Drawable createIconThumbnail(Drawable icon) {
+            int width = mIconWidth;
+            int height = mIconHeight;
+
+            if (icon == null) {
+                return null;
+            }
+
+            final int iconWidth = icon.getIntrinsicWidth();
+            final int iconHeight = icon.getIntrinsicHeight();
+
+            if (icon instanceof PaintDrawable) {
+                PaintDrawable painter = (PaintDrawable) icon;
+                painter.setIntrinsicWidth(width);
+                painter.setIntrinsicHeight(height);
+            }
+
+            if (width > 0 && height > 0) {
+                if (width < iconWidth || height < iconHeight) {
+                    final float ratio = (float) iconWidth / iconHeight;
+
+                    if (iconWidth > iconHeight) {
+                        height = (int) (width / ratio);
+                    } else if (iconHeight > iconWidth) {
+                        width = (int) (height * ratio);
+                    }
+
+                    final Bitmap.Config c = icon.getOpacity() != PixelFormat.OPAQUE ?
+                                Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565;
+                    final Bitmap thumb = Bitmap.createBitmap(mIconWidth, mIconHeight, c);
+                    final Canvas canvas = mCanvas;
+                    canvas.setBitmap(thumb);
+                    // Copy the old bounds to restore them later
+                    // If we were to do oldBounds = icon.getBounds(),
+                    // the call to setBounds() that follows would
+                    // change the same instance and we would lose the
+                    // old bounds
+                    mOldBounds.set(icon.getBounds());
+                    final int x = (mIconWidth - width) / 2;
+                    final int y = (mIconHeight - height) / 2;
+                    icon.setBounds(x, y, x + width, y + height);
+                    icon.draw(canvas);
+                    icon.setBounds(mOldBounds);
+                    icon = new BitmapDrawable(mResources, thumb);
+                } else if (iconWidth < width && iconHeight < height) {
+                    final Bitmap.Config c = Bitmap.Config.ARGB_8888;
+                    final Bitmap thumb = Bitmap.createBitmap(mIconWidth, mIconHeight, c);
+                    final Canvas canvas = mCanvas;
+                    canvas.setBitmap(thumb);
+                    mOldBounds.set(icon.getBounds());
+                    final int x = (width - iconWidth) / 2;
+                    final int y = (height - iconHeight) / 2;
+                    icon.setBounds(x, y, x + iconWidth, y + iconHeight);
+                    icon.draw(canvas);
+                    icon.setBounds(mOldBounds);
+                    icon = new BitmapDrawable(mResources, thumb);
+                }
+            }
+
+            return icon;
+        }
+    }
+}
diff --git a/src/com/android/launcher2/AddAdapter.java b/src/com/android/launcher2/AddAdapter.java
new file mode 100644
index 0000000..77f1f55
--- /dev/null
+++ b/src/com/android/launcher2/AddAdapter.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+/**
+ * Adapter showing the types of items that can be added to a {@link Workspace}.
+ */
+public class AddAdapter extends BaseAdapter {
+
+    private final LayoutInflater mInflater;
+    
+    private final ArrayList<ListItem> mItems = new ArrayList<ListItem>();
+    
+    public static final int ITEM_SHORTCUT = 0;
+    public static final int ITEM_APPWIDGET = 1;
+    public static final int ITEM_LIVE_FOLDER = 2;
+    public static final int ITEM_WALLPAPER = 3;
+    
+    /**
+     * Specific item in our list.
+     */
+    public class ListItem {
+        public final CharSequence text;
+        public final Drawable image;
+        public final int actionTag;
+        
+        public ListItem(Resources res, int textResourceId, int imageResourceId, int actionTag) {
+            text = res.getString(textResourceId);
+            if (imageResourceId != -1) {
+                image = res.getDrawable(imageResourceId);
+            } else {
+                image = null;
+            }
+            this.actionTag = actionTag;
+        }
+    }
+    
+    public AddAdapter(Launcher launcher) {
+        super();
+
+        mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        
+        // Create default actions
+        Resources res = launcher.getResources();
+        
+        mItems.add(new ListItem(res, R.string.group_shortcuts,
+                R.drawable.ic_launcher_shortcut, ITEM_SHORTCUT));
+
+        mItems.add(new ListItem(res, R.string.group_widgets,
+                R.drawable.ic_launcher_appwidget, ITEM_APPWIDGET));
+        
+        mItems.add(new ListItem(res, R.string.group_live_folders,
+                R.drawable.ic_launcher_folder, ITEM_LIVE_FOLDER));
+        
+        mItems.add(new ListItem(res, R.string.group_wallpapers,
+                R.drawable.ic_launcher_wallpaper, ITEM_WALLPAPER));
+
+    }
+
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ListItem item = (ListItem) getItem(position);
+        
+        if (convertView == null) {
+            convertView = mInflater.inflate(R.layout.add_list_item, parent, false);
+        }
+        
+        TextView textView = (TextView) convertView;
+        textView.setTag(item);
+        textView.setText(item.text);
+        textView.setCompoundDrawablesWithIntrinsicBounds(item.image, null, null, null);
+        
+        return convertView;
+    }
+
+    public int getCount() {
+        return mItems.size();
+    }
+
+    public Object getItem(int position) {
+        return mItems.get(position);
+    }
+
+    public long getItemId(int position) {
+        return position;
+    }
+    
+}
diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/android/launcher2/AllAppsList.java
new file mode 100644
index 0000000..561b345
--- /dev/null
+++ b/src/com/android/launcher2/AllAppsList.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.util.Log;
+import android.os.Process;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+
+/**
+ * Stores the list of all applications for the all apps view.
+ */
+class AllAppsList {
+    public static final int DEFAULT_APPLICATIONS_NUMBER = 42;
+    
+    /** The list off all apps. */
+    public ArrayList<ApplicationInfo> data = new ArrayList(DEFAULT_APPLICATIONS_NUMBER);
+    /** The list of apps that have been added since the last notify() call. */
+    public ArrayList<ApplicationInfo> added = new ArrayList(DEFAULT_APPLICATIONS_NUMBER);
+    /** The list of apps that have been removed since the last notify() call. */
+    public ArrayList<ApplicationInfo> removed = new ArrayList();
+    /** The list of apps that have been modified since the last notify() call. */
+    public ArrayList<ApplicationInfo> modified = new ArrayList();
+
+    /**
+     * Boring constructor.
+     */
+    public AllAppsList() {
+    }
+
+    /**
+     * Add the supplied ApplicationInfo objects to the list, and enqueue it into the
+     * list to broadcast when notify() is called.
+     */
+    public void add(ApplicationInfo info) {
+        data.add(info);
+        added.add(info);
+    }
+    
+    public void clear() {
+        data.clear();
+        // TODO: do we clear these too?
+        added.clear();
+        removed.clear();
+        modified.clear();
+    }
+
+    public int size() {
+        return data.size();
+    }
+
+    public ApplicationInfo get(int index) {
+        return data.get(index);
+    }
+
+    /**
+     * Add the icons for the supplied apk called packageName.
+     */
+    public void addPackage(Context context, String packageName) {
+        final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName);
+
+        if (matches.size() > 0) {
+            Utilities.BubbleText bubble = new Utilities.BubbleText(context);
+            for (ResolveInfo info : matches) {
+                ApplicationInfo item = AppInfoCache.cache(info, context, bubble);
+                data.add(item);
+                added.add(item);
+            }
+        }
+    }
+
+    /**
+     * Remove the apps for the given apk identified by packageName.
+     */
+    public void removePackage(String packageName) {
+        final List<ApplicationInfo> data = this.data;
+        for (int i=data.size()-1; i>=0; i--) {
+            ApplicationInfo info = data.get(i);
+            final ComponentName component = info.intent.getComponent();
+            if (packageName.equals(component.getPackageName())) {
+                removed.add(info);
+                data.remove(i);
+            }
+        }
+        // This is more aggressive than it needs to be.
+        AppInfoCache.flush();
+    }
+    
+    /**
+     * Add and remove icons for this package which has been updated.
+     */
+    public void updatePackage(Context context, String packageName) {
+        final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName);
+        if (matches.size() > 0) {
+            // Find disabled/removed activities and remove them from data and add them
+            // to the removed list.
+            for (int i=data.size()-1; i>=0; i--) {
+                final ApplicationInfo applicationInfo = data.get(i);
+                final ComponentName component = applicationInfo.intent.getComponent();
+                if (packageName.equals(component.getPackageName())) {
+                    if (!findActivity(matches, component)) {
+                        removed.add(applicationInfo);
+                        AppInfoCache.remove(component);
+                        data.remove(i);
+                    }
+                }
+            }
+
+            // Find enabled activities and add them to the adapter
+            // Also updates existing activities with new labels/icons
+            Utilities.BubbleText bubble = new Utilities.BubbleText(context);
+            int count = matches.size();
+            for (int i=0; i<count; i++) {
+                final ResolveInfo info = matches.get(i);
+                ApplicationInfo applicationInfo = findApplicationInfoLocked(
+                        info.activityInfo.applicationInfo.packageName,
+                        info.activityInfo.name);
+                if (applicationInfo == null) {
+                    applicationInfo = AppInfoCache.cache(info, context, bubble);
+                    data.add(applicationInfo);
+                    added.add(applicationInfo);
+                } else {
+                    AppInfoCache.update(info, applicationInfo, context, bubble);
+                    modified.add(applicationInfo);
+                }
+            }
+        }
+    }
+
+    /**
+     * Query the package manager for MAIN/LAUNCHER activities in the supplied package.
+     */
+    private static List<ResolveInfo> findActivitiesForPackage(Context context, String packageName) {
+        final PackageManager packageManager = context.getPackageManager();
+
+        final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
+        mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+
+        final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0);
+        final List<ResolveInfo> matches = new ArrayList<ResolveInfo>();
+
+        if (apps != null) {
+            // Find all activities that match the packageName
+            int count = apps.size();
+            for (int i = 0; i < count; i++) {
+                final ResolveInfo info = apps.get(i);
+                final ActivityInfo activityInfo = info.activityInfo;
+                if (packageName.equals(activityInfo.packageName)) {
+                    matches.add(info);
+                }
+            }
+        }
+
+        return matches;
+    }
+
+    /**
+     * Returns whether <em>apps</em> contains <em>component</em>.
+     */
+    private static boolean findActivity(List<ResolveInfo> apps, ComponentName component) {
+        final String className = component.getClassName();
+        for (ResolveInfo info : apps) {
+            final ActivityInfo activityInfo = info.activityInfo;
+            if (activityInfo.name.equals(className)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Find an ApplicationInfo object for the given packageName and className.
+     */
+    private ApplicationInfo findApplicationInfoLocked(String packageName, String className) {
+        for (ApplicationInfo info: data) {
+            final ComponentName component = info.intent.getComponent();
+            if (packageName.equals(component.getPackageName())
+                    && className.equals(component.getClassName())) {
+                return info;
+            }
+        }
+        return null;
+    }
+}
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
new file mode 100644
index 0000000..dc0b771
--- /dev/null
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -0,0 +1,1458 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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.os.SystemClock;
+import android.renderscript.Allocation;
+import android.renderscript.Dimension;
+import android.renderscript.Element;
+import android.renderscript.ProgramFragment;
+import android.renderscript.ProgramStore;
+import android.renderscript.ProgramVertex;
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+import android.renderscript.Sampler;
+import android.renderscript.Script;
+import android.renderscript.ScriptC;
+import android.renderscript.SimpleMesh;
+import android.renderscript.Type;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.SoundEffectConstants;
+import android.view.SurfaceHolder;
+import android.view.VelocityTracker;
+import android.view.View;
+import android.view.ViewConfiguration;
+import android.view.accessibility.AccessibilityEvent;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+
+
+public class AllAppsView extends RSSurfaceView
+        implements View.OnClickListener, View.OnLongClickListener, DragSource {
+    private static final String TAG = "Launcher.AllAppsView";
+
+    /** Bit for mLocks for when there are icons being loaded. */
+    private static final int LOCK_ICONS_PENDING = 1;
+
+    private static final int TRACKING_NONE = 0;
+    private static final int TRACKING_FLING = 1;
+    private static final int TRACKING_HOME = 2;
+
+    private static final int SELECTED_NONE = 0;
+    private static final int SELECTED_FOCUSED = 1;
+    private static final int SELECTED_PRESSED = 2;
+
+    private static final int SELECTION_NONE = 0;
+    private static final int SELECTION_ICONS = 1;
+    private static final int SELECTION_HOME = 2;
+
+    private Launcher mLauncher;
+    private DragController mDragController;
+
+    /** When this is 0, modifications are allowed, when it's not, they're not.
+     * TODO: What about scrolling? */
+    private int mLocks = LOCK_ICONS_PENDING;
+
+    private int mSlop;
+    private int mMaxFlingVelocity;
+
+    private Defines mDefines = new Defines();
+    private RenderScript mRS;
+    private RolloRS mRollo;
+    private ArrayList<ApplicationInfo> mAllAppsList;
+
+    /**
+     * True when we are using arrow keys or trackball to drive navigation
+     */
+    private boolean mArrowNavigation = false;
+    private boolean mStartedScrolling;
+
+    /**
+     * Used to keep track of the selection when AllAppsView loses window focus.
+     * 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 mZoomDirty = false;
+    private boolean mAnimateNextZoom;
+    private float mZoom;
+    private float mPosX;
+    private float mVelocity;
+    private AAMessage mMessageProc;
+
+    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 COLUMNS_PER_PAGE = 4;
+        public static final int ROWS_PER_PAGE = 4;
+
+        public static final int ICON_WIDTH_PX = 64;
+        public static final int ICON_TEXTURE_WIDTH_PX = 128;
+
+        public static final int ICON_HEIGHT_PX = 64;
+        public static final int ICON_TEXTURE_HEIGHT_PX = 128;
+
+        public int SCREEN_WIDTH_PX;
+        public int SCREEN_HEIGHT_PX;
+
+        public void recompute(int w, int h) {
+            SCREEN_WIDTH_PX = 480;
+            SCREEN_HEIGHT_PX = 800;
+        }
+    }
+
+    public AllAppsView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        setFocusable(true);
+        setSoundEffectsEnabled(false);
+        getHolder().setFormat(PixelFormat.TRANSLUCENT);
+        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);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        destroyRenderScript();
+    }
+
+    /**
+     * If you have an attached click listener, View always plays the click sound!?!?
+     * Deal with sound effects by hand.
+     */
+    public void reallyPlaySoundEffect(int sound) {
+        boolean old = isSoundEffectsEnabled();
+        setSoundEffectsEnabled(true);
+        playSoundEffect(sound);
+        setSoundEffectsEnabled(old);
+    }
+
+    public AllAppsView(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);
+        mRollo.mHasSurface = false;
+        // Without this, we leak mMessageCallback which leaks the context.
+        mRS.mMessageCallback = null;
+    }
+
+    @Override
+    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+        //long startTime = SystemClock.uptimeMillis();
+
+        super.surfaceChanged(holder, format, w, h);
+
+        if (mRollo == null) {
+            mRollo = new RolloRS();
+            mRollo.mHasSurface = true;
+            mRollo.init(getResources(), w, h);
+            if (mAllAppsList != null) {
+                mRollo.setApps(mAllAppsList);
+            }
+            if (mShouldGainFocus) {
+                gainFocus();
+                mShouldGainFocus = false;
+            }
+        } else {
+            mRollo.mHasSurface = true;
+        }
+        mRollo.dirtyCheck();
+        mRollo.resize(w, h);
+
+        mRS.mMessageCallback = mMessageProc = new AAMessage();
+
+        mRS.mMessageCallback = mMessageProc = new AAMessage();
+
+        Resources res = getContext().getResources();
+        int barHeight = (int)res.getDimension(R.dimen.button_bar_height);
+
+        //long endTime = SystemClock.uptimeMillis();
+        //Log.d(TAG, "surfaceChanged took " + (endTime-startTime) + "ms");
+    }
+
+    @Override
+    public void onWindowFocusChanged(boolean hasWindowFocus) {
+        super.onWindowFocusChanged(hasWindowFocus);
+        if (mArrowNavigation) {
+            if (!hasWindowFocus) {
+                // Clear selection when we lose window focus
+                mLastSelectedIcon = mRollo.mState.selectedIconIndex;
+                mRollo.setHomeSelected(SELECTED_NONE);
+                mRollo.clearSelectedIcon();
+                mRollo.mState.save();
+            } else if (hasWindowFocus) {
+                if (mRollo.mState.iconCount > 0) {
+                    if (mLastSelection == SELECTION_ICONS) {
+                        int selection = mLastSelectedIcon;
+                        final int firstIcon = Math.round(mPosX) *
+                            Defines.COLUMNS_PER_PAGE;
+                        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)) {
+                            selection = firstIcon;
+                        }
+
+                        // Select the first icon when we gain window focus
+                        mRollo.selectIcon(selection, SELECTED_FOCUSED);
+                        mRollo.mState.save();
+                    } else if (mLastSelection == SELECTION_HOME) {
+                        mRollo.setHomeSelected(SELECTED_FOCUSED);
+                        mRollo.mState.save();
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
+        super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
+
+        if (!isVisible()) {
+            return;
+        }
+
+        if (gainFocus) {
+            if (mRollo != null && mRollo.mHasSurface) {
+                gainFocus();
+            } else {
+                mShouldGainFocus = true;
+            }
+        } else {
+            if (mRollo != null) {
+                if (mArrowNavigation) {
+                    // Clear selection when we lose focus
+                    mRollo.clearSelectedIcon();
+                    mRollo.setHomeSelected(SELECTED_NONE);
+                    mRollo.mState.save();
+                    mArrowNavigation = false;
+                }
+            } else {
+                mShouldGainFocus = false;
+            }
+        }
+    }
+
+    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,
+                    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) {
+                    reallyPlaySoundEffect(SoundEffectConstants.CLICK);
+                    mLauncher.closeAllApps(true);
+                } else {
+                    int whichApp = mRollo.mState.selectedIconIndex;
+                    if (whichApp >= 0) {
+                        ApplicationInfo app = mAllAppsList.get(whichApp);
+                        mLauncher.startActivitySafely(app.intent);
+                        handled = true;
+                    }
+                }
+            }
+        }
+
+        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;
+
+            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;
+                    if (lastRowCount == 0) {
+                        lastRowCount = Defines.COLUMNS_PER_PAGE;
+                    }
+                    newSelection = iconCount - lastRowCount + (Defines.COLUMNS_PER_PAGE / 2);
+                    if (newSelection >= iconCount) {
+                        newSelection = iconCount-1;
+                    }
+                    int target = (newSelection / Defines.COLUMNS_PER_PAGE)
+                            - (Defines.ROWS_PER_PAGE - 1);
+                    if (target < 0) {
+                        target = 0;
+                    }
+                    if (currentTopRow != target) {
+                        mRollo.moveTo(target);
+                    }
+                } else {
+                    if (currentPageRow > 0) {
+                        newSelection = currentSelection - Defines.COLUMNS_PER_PAGE;
+                    } else if (currentTopRow > 0) {
+                        newSelection = currentSelection - Defines.COLUMNS_PER_PAGE;
+                        mRollo.moveTo(newSelection / Defines.COLUMNS_PER_PAGE);
+                    } else if (currentPageRow != 0) {
+                        newSelection = currentTopRow * Defines.ROWS_PER_PAGE;
+                    }
+                }
+                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;
+                if (mLastSelection != SELECTION_HOME) {
+                    if (currentRow < rowCount-1) {
+                        mRollo.setHomeSelected(SELECTED_NONE);
+                        if (currentSelection < 0) {
+                            newSelection = 0;
+                        } else {
+                            newSelection = currentSelection + Defines.COLUMNS_PER_PAGE;
+                        }
+                        if (newSelection >= iconCount) {
+                            // Go from D to G in this arrangement:
+                            //     A B C D
+                            //     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);
+                        }
+                    } else {
+                        newSelection = -1;
+                        mRollo.setHomeSelected(SELECTED_FOCUSED);
+                    }
+                }
+                handled = true;
+                break;
+            }
+            case KeyEvent.KEYCODE_DPAD_LEFT:
+                if (currentPageCol > 0) {
+                    newSelection = currentSelection - 1;
+                }
+                handled = true;
+                break;
+            case KeyEvent.KEYCODE_DPAD_RIGHT:
+                if ((currentPageCol < Defines.COLUMNS_PER_PAGE - 1) &&
+                        (currentSelection < iconCount - 1)) {
+                    newSelection = currentSelection + 1;
+                }
+                handled = true;
+                break;
+            }
+            if (newSelection != currentSelection) {
+                mRollo.selectIcon(newSelection, SELECTED_FOCUSED);
+                mRollo.mState.save();
+            }
+        }
+        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();
+
+        int action = ev.getAction();
+        switch (action) {
+        case MotionEvent.ACTION_DOWN:
+            if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.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 {
+                    mDownIconIndex = mCurrentIconIndex
+                            = mRollo.selectIcon(x, y, mPosX, SELECTED_PRESSED);
+                    if (mDownIconIndex < 0) {
+                        // if nothing was selected, no long press.
+                        cancelLongPress();
+                    }
+                }
+                mRollo.mState.save();
+                mRollo.move();
+                mVelocityTracker = VelocityTracker.obtain();
+                mVelocityTracker.addMovement(ev);
+                mStartedScrolling = false;
+            }
+            break;
+        case MotionEvent.ACTION_MOVE:
+        case MotionEvent.ACTION_OUTSIDE:
+            if (mTouchTracking == TRACKING_HOME) {
+                mRollo.setHomeSelected(y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.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.
+                    mCurrentIconIndex = mRollo.chooseTappedIcon(x, y, mPosX);
+                    if (mDownIconIndex != mCurrentIconIndex) {
+                        // If a different icon is selected, don't allow it to be picked up.
+                        // This handles off-axis dragging.
+                        cancelLongPress();
+                        mCurrentIconIndex = -1;
+                    }
+                } else {
+                    if (!mStartedScrolling) {
+                        cancelLongPress();
+                        mCurrentIconIndex = -1;
+                    }
+                    mRollo.mState.newPositionX = ev.getRawY() / getHeight();
+                    mRollo.mState.newTouchDown = 1;
+                    mRollo.move();
+
+                    mStartedScrolling = true;
+                    mRollo.clearSelectedIcon();
+                    mVelocityTracker.addMovement(ev);
+                    mRollo.mState.save();
+                }
+            }
+            break;
+        case MotionEvent.ACTION_UP:
+        case MotionEvent.ACTION_CANCEL:
+            if (mTouchTracking == TRACKING_HOME) {
+                if (action == MotionEvent.ACTION_UP) {
+                    if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) {
+                        reallyPlaySoundEffect(SoundEffectConstants.CLICK);
+                        mLauncher.closeAllApps(true);
+                    }
+                    mRollo.setHomeSelected(SELECTED_NONE);
+                    mRollo.mState.save();
+                }
+                mCurrentIconIndex = -1;
+            } 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;
+                }
+            }
+            mTouchTracking = TRACKING_NONE;
+            break;
+        }
+
+        return true;
+    }
+
+    public void onClick(View v) {
+        if (mLocks != 0 || !isVisible()) {
+            return;
+        }
+        if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex
+                && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
+            reallyPlaySoundEffect(SoundEffectConstants.CLICK);
+            ApplicationInfo app = mAllAppsList.get(mCurrentIconIndex);
+            mLauncher.startActivitySafely(app.intent);
+        }
+    }
+
+    public boolean onLongClick(View v) {
+        if (mLocks != 0 || !isVisible()) {
+            return true;
+        }
+        if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex
+                && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
+            ApplicationInfo app = mAllAppsList.get(mCurrentIconIndex);
+
+            // We don't really have an accurate location to use.  This will do.
+            int screenX = mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
+            int screenY = mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
+
+            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(app.iconBitmap, screenX, screenY,
+                    left, top, mDefines.ICON_WIDTH_PX, mDefines.ICON_HEIGHT_PX,
+                    this, app, DragController.DRAG_ACTION_COPY);
+
+            mLauncher.closeAllApps(true);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SELECTED) {
+            if (!isVisible()) {
+                return false;
+            }
+            String text = null;
+            int index;
+            int count = mAllAppsList.size() + 1; // +1 is home
+            int pos = -1;
+            switch (mLastSelection) {
+            case SELECTION_ICONS:
+                index = mRollo.mState.selectedIconIndex;
+                if (index >= 0) {
+                    ApplicationInfo info = mAllAppsList.get(index);
+                    if (info.title != null) {
+                        text = info.title.toString();
+                        pos = index;
+                    }
+                }
+                break;
+            case SELECTION_HOME:
+                text = getContext().getString(R.string.all_apps_home_button_label);
+                pos = count;
+                break;
+            }
+            if (text != null) {
+                event.setEnabled(true);
+                event.getText().add(text);
+                //event.setContentDescription(text);
+                event.setItemCount(count);
+                event.setCurrentItemIndex(pos);
+            }
+        }
+        return false;
+    }
+
+    public void setDragController(DragController dragger) {
+        mDragController = dragger;
+    }
+
+    public void onDropCompleted(View target, boolean success) {
+    }
+
+    /**
+     * Zoom to the specifed level.
+     *
+     * @param zoom [0..1] 0 is hidden, 1 is open
+     */
+    public void zoom(float zoom, boolean animate) {
+        cancelLongPress();
+        if (mRollo == null || !mRollo.mHasSurface) {
+            mZoomDirty = true;
+            mZoom = zoom;
+            mAnimateNextZoom = animate;
+            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) {
+        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.
+            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,
+                    LauncherModel.APP_NAME_COMPARATOR);
+            if (index < 0) {
+                index = -(index+1);
+            }
+            mAllAppsList.add(index, item);
+            if (mRollo != null) {
+                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);
+                }
+            } else {
+                Log.w(TAG, "couldn't find a match for item \"" + item + "\"");
+                // 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();
+        for (int i=0; i<N; i++) {
+            ApplicationInfo x = list.get(i);
+            if (x.intent.getComponent().equals(component)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    private static int countPages(int iconCount) {
+        int iconsPerPage = Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE;
+        int pages = iconCount / iconsPerPage;
+        if (pages*iconsPerPage != iconCount) {
+            pages++;
+        }
+        return pages;
+    }
+
+    class AAMessage extends RenderScript.RSMessage {
+        public void run() {
+            mPosX = ((float)mData[0]) / (1 << 16);
+            mVelocity = ((float)mData[1]) / (1 << 16);
+            mZoom = ((float)mData[2]) / (1 << 16);
+            mZoomDirty = false;
+        }
+    }
+
+    public class RolloRS {
+
+        // Allocations ======
+        private int mWidth;
+        private int mHeight;
+
+        private Resources mRes;
+        private Script mScript;
+        private Script.Invokable mInvokeMove;
+        private Script.Invokable mInvokeMoveTo;
+        private Script.Invokable mInvokeFling;
+        private Script.Invokable mInvokeResetWAR;
+        private Script.Invokable mInvokeSetZoom;
+
+        private ProgramStore mPSIcons;
+        private ProgramStore mPSText;
+        private ProgramFragment mPFColor;
+        private ProgramFragment mPFTexMip;
+        private ProgramFragment mPFTexNearest;
+        private ProgramVertex mPV;
+        private ProgramVertex mPVOrtho;
+        private SimpleMesh mMesh;
+        private SimpleMesh mMesh2;
+        private ProgramVertex.MatrixAllocation mPVA;
+
+        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;
+
+        boolean mHasSurface = false;
+        private boolean mAppsDirty = true;
+
+        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");
+                mAlloc = Allocation.createTyped(mRS, mType);
+                save();
+            }
+            public int bubbleWidth;
+            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;
+            public float flingVelocity;
+            public int iconCount;
+            public int selectedIconIndex = -1;
+            public int selectedIconTexture;
+            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;
+            mHeight = height;
+            mDefines.recompute(width, height);
+            initProgramVertex();
+            initProgramFragment();
+            initProgramStore();
+            initMesh();
+            initGl();
+            initData();
+            initTouchState();
+            initRs();
+        }
+
+        public void initMesh() {
+            SimpleMesh.TriangleMeshBuilder tm = new SimpleMesh.TriangleMeshBuilder(mRS, 3,
+                SimpleMesh.TriangleMeshBuilder.TEXTURE_0 | SimpleMesh.TriangleMeshBuilder.COLOR);
+
+            float y = 0;
+            float z = 0;
+            for (int ct=0; ct < 200; ct++) {
+                float angle = 0;
+                float maxAngle = 3.14f * 0.16f;
+                float l = 1.f;
+
+                l = 1 - ((ct-5) * 0.10f);
+                if (ct > 7) {
+                    angle = maxAngle * (ct - 7) * 0.2f;
+                    angle = Math.min(angle, maxAngle);
+                }
+                l = Math.max(0.4f, l);
+                l = Math.min(1.0f, l);
+
+                y += 0.1f * Math.cos(angle);
+                z += 0.1f * Math.sin(angle);
+
+                float t = 0.1f * ct;
+                float ds = 0.08f;
+                tm.setColor(l, l, l, 0.99f);
+                tm.setTexture(ds, t);
+                tm.addVertex(-0.5f, y, z);
+                tm.setTexture(1 - ds, t);
+                tm.addVertex(0.5f, y, z);
+            }
+            for (int ct=0; ct < (200 * 2 - 2); ct+= 2) {
+                tm.addTriangle(ct, ct+1, ct+2);
+                tm.addTriangle(ct+1, ct+3, ct+2);
+            }
+            mMesh2 = tm.create();
+            mMesh2.setName("SMMesh");
+        }
+
+        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);
+
+            //pva = new ProgramVertex.MatrixAllocation(mRS);
+            //pva.setupOrthoWindow(mWidth, mHeight);
+            //pvb.setTextureMatrixEnable(true);
+            //mPVOrtho = pvb.create();
+            //mPVOrtho.setName("PVOrtho");
+            //mPVOrtho.bindAllocation(pva);
+
+            mRS.contextBindProgramVertex(mPV);
+        }
+
+        private void initProgramFragment() {
+            Sampler.Builder sb = new Sampler.Builder(mRS);
+            sb.setMin(Sampler.Value.LINEAR_MIP_LINEAR);
+            sb.setMag(Sampler.Value.LINEAR);
+            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, null, null);
+            //mPFColor = bf.create();
+            //mPFColor.setName("PFColor");
+
+            bf.setTexEnable(true, 0);
+            bf.setTexEnvMode(ProgramFragment.EnvMode.MODULATE, 0);
+            mPFTexMip = bf.create();
+            mPFTexMip.setName("PFTexMip");
+            mPFTexMip.bindSampler(linear, 0);
+
+            mPFTexNearest = bf.create();
+            mPFTexNearest.setName("PFTexNearest");
+            mPFTexNearest.bindSampler(nearest, 0);
+        }
+
+        private void initProgramStore() {
+            ProgramStore.Builder bs = new ProgramStore.Builder(mRS, null, null);
+            bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
+            bs.setColorMask(true,true,true,false);
+            bs.setDitherEnable(true);
+            bs.setBlendFunc(ProgramStore.BlendSrcFunc.SRC_ALPHA,
+                            ProgramStore.BlendDstFunc.ONE_MINUS_SRC_ALPHA);
+            mPSIcons = bs.create();
+            mPSIcons.setName("PSIcons");
+
+            //bs.setDitherEnable(false);
+            //mPSText = bs.create();
+            //mPSText.setName("PSText");
+        }
+
+        private void initGl() {
+            mTouchXBorders = new int[Defines.COLUMNS_PER_PAGE+1];
+            mTouchYBorders = new int[Defines.ROWS_PER_PAGE+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);
+            mHomeButtonFocused = Allocation.createFromBitmapResource(mRS, mRes,
+                    R.drawable.home_button_focused, Element.RGBA_8888(mRS), false);
+            mHomeButtonFocused.uploadToTexture(0);
+            mHomeButtonPressed = Allocation.createFromBitmapResource(mRS, mRes,
+                    R.drawable.home_button_pressed, Element.RGBA_8888(mRS), false);
+            mHomeButtonPressed.uploadToTexture(0);
+            mParams.homeButtonWidth = 76;
+            mParams.homeButtonHeight = 68;
+            mParams.homeButtonTextureWidth = 128;
+            mParams.homeButtonTextureHeight = 128;
+
+            mState.homeButtonId = mHomeButtonNormal.getID();
+
+            mParams.save();
+            mState.save();
+
+            mSelectionBitmap = Bitmap.createBitmap(Defines.ICON_TEXTURE_WIDTH_PX,
+                    Defines.ICON_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.rollo3);
+            sb.setRoot(true);
+            sb.addDefines(mDefines);
+            sb.setType(mParams.mType, "params", Defines.ALLOC_PARAMS);
+            sb.setType(mState.mType, "state", Defines.ALLOC_STATE);
+            mInvokeMove = sb.addInvokable("move");
+            mInvokeFling = sb.addInvokable("fling");
+            mInvokeMoveTo = sb.addInvokable("moveTo");
+            mInvokeResetWAR = sb.addInvokable("resetHWWar");
+            mInvokeSetZoom = sb.addInvokable("setZoom");
+            mScript = sb.create();
+            mScript.setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+            mScript.bindAllocation(mParams.mAlloc, Defines.ALLOC_PARAMS);
+            mScript.bindAllocation(mState.mAlloc, Defines.ALLOC_STATE);
+            mScript.bindAllocation(mAllocIconIds, Defines.ALLOC_ICON_IDS);
+            mScript.bindAllocation(mAllocLabelIds, Defines.ALLOC_LABEL_IDS);
+
+            mRS.contextBindRootScript(mScript);
+        }
+
+        void dirtyCheck() {
+            if (mHasSurface) {
+                if (mAppsDirty && mAllAppsList != null) {
+                    for (int i=0; i < mState.iconCount; i++) {
+                        uploadAppIcon(i, mAllAppsList.get(i));
+                    }
+                    saveAppsList();
+                    mAppsDirty = false;
+                }
+                if (mZoomDirty) {
+                    setZoom(mZoom, mAnimateNextZoom);
+                }
+            }
+        }
+
+        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));
+            }
+            if (mHasSurface) {
+                for (int i=0; i < mState.iconCount; i++) {
+                    uploadAppIcon(i, list.get(i));
+                }
+            } else {
+                mRollo.mAppsDirty = true;
+            }
+            saveAppsList();
+        }
+
+        private void setZoom(float zoom, boolean animate) {
+            mRollo.clearSelectedIcon();
+            mRollo.setHomeSelected(SELECTED_NONE);
+            if (zoom > 0.001f) {
+                mRollo.mState.zoomTarget = zoom;
+            } else {
+                mRollo.mState.zoomTarget = 0;
+            }
+            mRollo.mState.save();
+            if (!animate) {
+                mRollo.mInvokeSetZoom.execute();
+            }
+        }
+
+        private void frameBitmapAllocMips(Allocation alloc, int w, int h) {
+            int black[] = new int[w > h ? w : h];
+            Allocation.Adapter2D a = alloc.createAdapter2D();
+            int mip = 0;
+            while (w > 1 || h > 1) {
+                a.subData(0, 0, 1, h, black);
+                a.subData(w-1, 0, 1, h, black);
+                a.subData(0, 0, w, 1, black);
+                a.subData(0, h-1, w, 1, black);
+                mip++;
+                w = (w + 1) >> 1;
+                h = (h + 1) >> 1;
+                a.setConstraint(Dimension.LOD, mip);
+            }
+            a.subData(0, 0, 1, 1, black);
+        }
+
+        private void createAppIconAllocations(int index, ApplicationInfo item) {
+            mIcons[index] = Allocation.createFromBitmap(mRS, item.iconBitmap,
+                    Element.RGBA_8888(mRS), true);
+            frameBitmapAllocMips(mIcons[index], item.iconBitmap.getWidth(),
+                    item.iconBitmap.getHeight());
+
+            mLabels[index] = Allocation.createFromBitmap(mRS, item.titleBitmap,
+                    Element.RGBA_8888(mRS), true);
+            frameBitmapAllocMips(mLabels[index], item.titleBitmap.getWidth(),
+                    item.titleBitmap.getHeight());
+
+            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
+                    + " mIcons[index].getID=" + mIcons[index].getID()
+                    + " mIconsIds[index]=" + mIconIds[index]
+                    + " item=" + item);
+            }
+            mIcons[index].uploadToTexture(0);
+            mLabels[index].uploadToTexture(0);
+        }
+
+        /**
+         * Puts the empty spaces at the end.  Updates mState.iconCount.  You must
+         * fill in the values and call saveAppsList().
+         */
+        private void reallocAppsList(int count) {
+            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);
+
+            if (mHasSurface) {
+                uploadAppIcon(index, item);
+            } else {
+                mAppsDirty = true;
+            }
+
+            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.
+         */
+        private void saveAppsList() {
+            mRS.contextBindRootScript(null);
+
+            mAllocIconIds.data(mIconIds);
+            mAllocLabelIds.data(mLabelIds);
+
+            if (mScript != null) { // this happens when we init it
+                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;
+        }
+
+        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++) {
+                if (x >= mTouchXBorders[i] && x < mTouchXBorders[i+1]) {
+                    col = i;
+                    break;
+                }
+            }
+            for (int i=0; i<Defines.ROWS_PER_PAGE; 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;
+
+            if (index >= mState.iconCount) {
+                return -1;
+            } else {
+                return index;
+            }
+        }
+
+        /**
+         * You need to call save() on mState on your own after calling this.
+         *
+         * @return the index of the icon that was selected.
+         */
+        int selectIcon(int x, int y, float pos, int pressed) {
+            final int index = chooseTappedIcon(x, y, pos);
+            selectIcon(index, pressed);
+            return index;
+        }
+
+        /**
+         * Select the icon at the given index.
+         *
+         * @param index The index.
+         * @param pressed one of SELECTED_PRESSED or SELECTED_FOCUSED
+         */
+        void selectIcon(int index, int pressed) {
+            if (mAllAppsList == null || index < 0 || index >= mAllAppsList.size()) {
+                mState.selectedIconIndex = -1;
+                if (mLastSelection == SELECTION_ICONS) {
+                    mLastSelection = SELECTION_NONE;
+                }
+            } else {
+                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);
+                        sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+                    }
+                }
+            }
+        }
+
+        /**
+         * 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) {
+            case SELECTED_NONE:
+                mState.homeButtonId = mHomeButtonNormal.getID();
+                break;
+            case SELECTED_FOCUSED:
+                mLastSelection = SELECTION_HOME;
+                mState.homeButtonId = mHomeButtonFocused.getID();
+                if (prev != SELECTION_HOME) {
+                    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+                }
+                break;
+            case SELECTED_PRESSED:
+                mState.homeButtonId = mHomeButtonPressed.getID();
+                break;
+            }
+        }
+
+        public void dumpState() {
+            Log.d(TAG, "mRollo.mWidth=" + mWidth);
+            Log.d(TAG, "mRollo.mHeight=" + mHeight);
+            Log.d(TAG, "mRollo.mIcons=" + mIcons);
+            if (mIcons != null) {
+                Log.d(TAG, "mRollo.mIcons.length=" + mIcons.length);
+            }
+            if (mIconIds != null) {
+                Log.d(TAG, "mRollo.mIconIds.length=" + mIconIds.length);
+            }
+            Log.d(TAG, "mRollo.mIconIds=" +  Arrays.toString(mIconIds));
+            if (mLabelIds != null) {
+                Log.d(TAG, "mRollo.mLabelIds.length=" + mLabelIds.length);
+            }
+            Log.d(TAG, "mRollo.mLabelIds=" +  Arrays.toString(mLabelIds));
+            Log.d(TAG, "mRollo.mTouchXBorders=" +  Arrays.toString(mTouchXBorders));
+            Log.d(TAG, "mRollo.mTouchYBorders=" +  Arrays.toString(mTouchYBorders));
+            Log.d(TAG, "mRollo.mHasSurface=" + mHasSurface);
+            Log.d(TAG, "mRollo.mAppsDirty=" + mAppsDirty);
+            Log.d(TAG, "mRollo.mState.newPositionX=" + mState.newPositionX);
+            Log.d(TAG, "mRollo.mState.newTouchDown=" + mState.newTouchDown);
+            Log.d(TAG, "mRollo.mState.flingVelocity=" + mState.flingVelocity);
+            Log.d(TAG, "mRollo.mState.iconCount=" + mState.iconCount);
+            Log.d(TAG, "mRollo.mState.selectedIconIndex=" + mState.selectedIconIndex);
+            Log.d(TAG, "mRollo.mState.selectedIconTexture=" + mState.selectedIconTexture);
+            Log.d(TAG, "mRollo.mState.zoomTarget=" + mState.zoomTarget);
+            Log.d(TAG, "mRollo.mState.homeButtonId=" + mState.homeButtonId);
+            Log.d(TAG, "mRollo.mState.targetPos=" + mState.targetPos);
+            Log.d(TAG, "mRollo.mParams.bubbleWidth=" + mParams.bubbleWidth);
+            Log.d(TAG, "mRollo.mParams.bubbleHeight=" + mParams.bubbleHeight);
+            Log.d(TAG, "mRollo.mParams.bubbleBitmapWidth=" + mParams.bubbleBitmapWidth);
+            Log.d(TAG, "mRollo.mParams.bubbleBitmapHeight=" + mParams.bubbleBitmapHeight);
+            Log.d(TAG, "mRollo.mParams.homeButtonWidth=" + mParams.homeButtonWidth);
+            Log.d(TAG, "mRollo.mParams.homeButtonHeight=" + mParams.homeButtonHeight);
+            Log.d(TAG, "mRollo.mParams.homeButtonTextureWidth=" + mParams.homeButtonTextureWidth);
+            Log.d(TAG, "mRollo.mParams.homeButtonTextureHeight=" + mParams.homeButtonTextureHeight);
+        }
+    }
+
+    public void dumpState() {
+        Log.d(TAG, "mRS=" + mRS);
+        Log.d(TAG, "mRollo=" + mRollo);
+        ApplicationInfo.dumpApplicationInfoList(TAG, "mAllAppsList", mAllAppsList);
+        Log.d(TAG, "mArrowNavigation=" + mArrowNavigation);
+        Log.d(TAG, "mStartedScrolling=" + mStartedScrolling);
+        Log.d(TAG, "mLastSelection=" + mLastSelection);
+        Log.d(TAG, "mLastSelectedIcon=" + mLastSelectedIcon);
+        Log.d(TAG, "mVelocityTracker=" + mVelocityTracker);
+        Log.d(TAG, "mTouchTracking=" + mTouchTracking);
+        Log.d(TAG, "mShouldGainFocus=" + mShouldGainFocus);
+        Log.d(TAG, "mZoomDirty=" + mZoomDirty);
+        Log.d(TAG, "mAnimateNextZoom=" + mAnimateNextZoom);
+        Log.d(TAG, "mZoom=" + mZoom);
+        Log.d(TAG, "mPosX=" + mPosX);
+        Log.d(TAG, "mVelocity=" + mVelocity);
+        Log.d(TAG, "mMessageProc=" + mMessageProc);
+        if (mRollo != null) {
+            mRollo.dumpState();
+        }
+        if (mRS != null) {
+            mRS.contextDump(0);
+        }
+    }
+}
+
+
diff --git a/src/com/android/launcher2/AppInfoCache.java b/src/com/android/launcher2/AppInfoCache.java
new file mode 100644
index 0000000..a2d9830
--- /dev/null
+++ b/src/com/android/launcher2/AppInfoCache.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.BitmapDrawable;
+import android.net.Uri;
+import android.util.Log;
+import android.os.Process;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Cache of application icons.  Icons can be made from any thread.
+ */
+public class AppInfoCache {
+    private static final String TAG = "Launcher.AppInfoCache";
+
+    private static final int INITIAL_ICON_CACHE_CAPACITY = 50;
+
+    private static final HashMap<ComponentName, ApplicationInfo> sCache =
+            new HashMap<ComponentName, ApplicationInfo>(INITIAL_ICON_CACHE_CAPACITY);
+
+    /**
+     * no public constructor.
+     */
+    private AppInfoCache() {
+    }
+
+    /**
+     * For the given ResolveInfo, return an ApplicationInfo and cache the result for later.
+     */
+    public static ApplicationInfo cache(ResolveInfo info, Context context,
+            Utilities.BubbleText bubble) {
+        synchronized (sCache) {
+            ComponentName componentName = new ComponentName(
+                    info.activityInfo.applicationInfo.packageName,
+                    info.activityInfo.name);
+            ApplicationInfo application = sCache.get(componentName);
+
+            if (application == null) {
+                application = new ApplicationInfo();
+                application.container = ItemInfo.NO_ID;
+
+                updateTitleAndIcon(info, application, context, bubble);
+
+                application.setActivity(componentName,
+                        Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+
+                sCache.put(componentName, application);
+            }
+
+            return application;
+        }
+    }
+
+    /**
+     * Update the entry in the in the cache with its new metadata.
+     */
+    public static void update(ResolveInfo info, ApplicationInfo applicationInfo, Context context,
+            Utilities.BubbleText bubble) {
+        synchronized (sCache) {
+            updateTitleAndIcon(info, applicationInfo, context, bubble);
+
+            ComponentName componentName = new ComponentName(
+                    info.activityInfo.applicationInfo.packageName, info.activityInfo.name);
+            sCache.put(componentName, applicationInfo);
+        }
+    }
+
+    /**
+     * Remove any records for the supplied ComponentName.
+     */
+    public static void remove(ComponentName componentName) {
+        synchronized (sCache) {
+            sCache.remove(componentName);
+        }
+    }
+
+    /**
+     * Empty out the cache.
+     */
+    public static void flush() {
+        synchronized (sCache) {
+            sCache.clear();
+        }
+    }
+
+    /**
+     * Get the icon for the supplied ApplicationInfo.  If that activity already
+     * exists in the cache, use that.
+     */
+    public static Drawable getIconDrawable(PackageManager packageManager, ApplicationInfo info) {
+        final ResolveInfo resolveInfo = packageManager.resolveActivity(info.intent, 0);
+        if (resolveInfo == null) {
+            return null;
+        }
+
+        ComponentName componentName = new ComponentName(
+                resolveInfo.activityInfo.applicationInfo.packageName,
+                resolveInfo.activityInfo.name);
+        ApplicationInfo cached;
+        synchronized (sCache) {
+            cached = sCache.get(componentName);
+            if (cached != null) {
+                if (cached.icon == null) {
+                    cached.icon = resolveInfo.activityInfo.loadIcon(packageManager);
+                }
+                return cached.icon;
+            } else {
+                return resolveInfo.activityInfo.loadIcon(packageManager);
+            }
+        }
+    }
+
+    /**
+     * Go through the cache and disconnect any of the callbacks in the drawables or we
+     * leak the previous Home screen on orientation change.
+     */
+    public static void unbindDrawables() {
+        synchronized (sCache) {
+            for (ApplicationInfo appInfo: sCache.values()) {
+                if (appInfo.icon != null) {
+                    appInfo.icon.setCallback(null);
+                }
+            }
+        }
+    }
+
+    /**
+     * Update the title and icon.  Don't keep a reference to the context!
+     */
+    private static void updateTitleAndIcon(ResolveInfo info, ApplicationInfo application,
+            Context context, Utilities.BubbleText bubble) {
+        final PackageManager packageManager = context.getPackageManager();
+
+        application.title = info.loadLabel(packageManager);
+        if (application.title == null) {
+            application.title = info.activityInfo.name;
+        }
+
+        application.iconBitmap = Utilities.createAllAppsBitmap(
+                info.activityInfo.loadIcon(packageManager), context);
+
+        application.titleBitmap = bubble.createTextBitmap(application.title.toString());
+    }
+}
+
diff --git a/src/com/android/launcher2/ApplicationInfo.java b/src/com/android/launcher2/ApplicationInfo.java
new file mode 100644
index 0000000..0fe84e7
--- /dev/null
+++ b/src/com/android/launcher2/ApplicationInfo.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ComponentName;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.util.Log;
+
+import java.util.ArrayList;
+
+/**
+ * Represents a launchable application. An application is made of a name (or title),
+ * an intent and an icon.
+ */
+class ApplicationInfo extends ItemInfo {
+
+    /**
+     * The application name.
+     */
+    CharSequence title;
+
+    /**
+     * A bitmap of the application's text in the bubble.
+     */
+    Bitmap titleBitmap;
+
+    /**
+     * The intent used to start the application.
+     */
+    Intent intent;
+
+    /**
+     * The application icon.
+     */
+    Drawable icon;
+
+    /**
+     * A bitmap version of the application icon.
+     */
+    Bitmap iconBitmap;
+
+    /**
+     * When set to true, indicates that the icon has been resized.
+     */
+    boolean filtered;
+
+    /**
+     * Indicates whether the icon comes from an application's resource (if false)
+     * or from a custom Bitmap (if true.)
+     */
+    boolean customIcon;
+
+    /**
+     * If isShortcut=true and customIcon=false, this contains a reference to the
+     * shortcut icon as an application's resource.
+     */
+    Intent.ShortcutIconResource iconResource;
+
+    ApplicationInfo() {
+        itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT;
+    }
+    
+    public ApplicationInfo(ApplicationInfo info) {
+        super(info);
+        title = info.title.toString();
+        intent = new Intent(info.intent);
+        if (info.iconResource != null) {
+            iconResource = new Intent.ShortcutIconResource();
+            iconResource.packageName = info.iconResource.packageName;
+            iconResource.resourceName = info.iconResource.resourceName;
+        }
+        icon = info.icon;
+        filtered = info.filtered;
+        customIcon = info.customIcon;
+    }
+
+    /**
+     * Creates the application intent based on a component name and various launch flags.
+     * Sets {@link #itemType} to {@link LauncherSettings.BaseLauncherColumns#ITEM_TYPE_APPLICATION}.
+     *
+     * @param className the class name of the component representing the intent
+     * @param launchFlags the launch flags
+     */
+    final void setActivity(ComponentName className, int launchFlags) {
+        intent = new Intent(Intent.ACTION_MAIN);
+        intent.addCategory(Intent.CATEGORY_LAUNCHER);
+        intent.setComponent(className);
+        intent.setFlags(launchFlags);
+        itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_APPLICATION;
+    }
+
+    @Override
+    void onAddToDatabase(ContentValues values) {
+        super.onAddToDatabase(values);
+
+        String titleStr = title != null ? title.toString() : null;
+        values.put(LauncherSettings.BaseLauncherColumns.TITLE, titleStr);
+
+        String uri = intent != null ? intent.toUri(0) : null;
+        values.put(LauncherSettings.BaseLauncherColumns.INTENT, uri);
+
+        if (customIcon) {
+            values.put(LauncherSettings.BaseLauncherColumns.ICON_TYPE,
+                    LauncherSettings.BaseLauncherColumns.ICON_TYPE_BITMAP);
+            Bitmap bitmap = ((FastBitmapDrawable) icon).getBitmap();
+            writeBitmap(values, bitmap);
+        } else {
+            values.put(LauncherSettings.BaseLauncherColumns.ICON_TYPE,
+                    LauncherSettings.BaseLauncherColumns.ICON_TYPE_RESOURCE);
+            if (iconResource != null) {
+                values.put(LauncherSettings.BaseLauncherColumns.ICON_PACKAGE,
+                        iconResource.packageName);
+                values.put(LauncherSettings.BaseLauncherColumns.ICON_RESOURCE,
+                        iconResource.resourceName);
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        return title.toString();
+    }
+
+    @Override
+    void unbind() {
+        super.unbind();
+        icon.setCallback(null);
+    }
+
+
+    public static void dumpApplicationInfoList(String tag, String label,
+            ArrayList<ApplicationInfo> list) {
+        Log.d(tag, label + " size=" + list.size());
+        for (ApplicationInfo info: list) {
+            Log.d(tag, "   title=\"" + info.title + "\" titleBitmap=" + info.titleBitmap
+                    + " icon=" + info.icon + " iconBitmap=" + info.iconBitmap
+                    + " filtered=" + info.filtered + " customIcon=" + info.customIcon);
+        }
+    }
+}
diff --git a/src/com/android/launcher2/ApplicationsAdapter.java b/src/com/android/launcher2/ApplicationsAdapter.java
new file mode 100644
index 0000000..129103a
--- /dev/null
+++ b/src/com/android/launcher2/ApplicationsAdapter.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+/**
+ * GridView adapter to show the list of applications and shortcuts
+ */
+public class ApplicationsAdapter  extends ArrayAdapter<ApplicationInfo> {
+    private final LayoutInflater mInflater;
+    private final PackageManager mPackageManager;
+
+    public ApplicationsAdapter(Context context, ArrayList<ApplicationInfo> apps) {
+        super(context, 0, apps);
+        mPackageManager = context.getPackageManager();
+        mInflater = LayoutInflater.from(context);
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        final ApplicationInfo info = getItem(position);
+
+        if (convertView == null) {
+            convertView = mInflater.inflate(R.layout.application_boxed, parent, false);
+        }
+
+        if (info.icon == null) {
+            info.icon = AppInfoCache.getIconDrawable(mPackageManager, info);
+        }
+        if (!info.filtered) {
+            info.icon = Utilities.createIconThumbnail(info.icon, getContext());
+            info.filtered = true;
+        }
+
+        final TextView textView = (TextView) convertView;
+        textView.setCompoundDrawablesWithIntrinsicBounds(null, info.icon, null, null);
+        textView.setText(info.title);
+
+        return convertView;
+    }
+}
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
new file mode 100644
index 0000000..eaaff1c
--- /dev/null
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.widget.TextView;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.graphics.drawable.Drawable;
+import android.text.Layout;
+
+/**
+ * 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
+ * too aggressive.
+ */
+public class BubbleTextView extends TextView {
+    static final float CORNER_RADIUS = 8.0f;
+    static final float PADDING_H = 5.0f;
+    static final float PADDING_V = 1.0f;
+
+    private final RectF mRect = new RectF();
+    private Paint mPaint;
+
+    private boolean mBackgroundSizeChanged;
+    private Drawable mBackground;
+    private float mCornerRadius;
+    private float mPaddingH;
+    private float mPaddingV;
+
+    public BubbleTextView(Context context) {
+        super(context);
+        init();
+    }
+
+    public BubbleTextView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init();
+    }
+
+    public BubbleTextView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        init();
+    }
+
+    private void init() {
+        setFocusable(true);
+        mBackground = getBackground();
+        setBackgroundDrawable(null);
+
+        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+        mPaint.setColor(getContext().getResources().getColor(R.color.bubble_dark_background));
+
+        final float scale = getContext().getResources().getDisplayMetrics().density;
+        mCornerRadius = CORNER_RADIUS * scale;
+        mPaddingH = PADDING_H * scale;
+        //noinspection PointlessArithmeticExpression
+        mPaddingV = PADDING_V * scale;
+    }
+
+    @Override
+    protected boolean setFrame(int left, int top, int right, int bottom) {
+        if (mLeft != left || mRight != right || mTop != top || mBottom != bottom) {
+            mBackgroundSizeChanged = true;
+        }
+        return super.setFrame(left, top, right, bottom);
+    }
+
+    @Override
+    protected boolean verifyDrawable(Drawable who) {
+        return who == mBackground || super.verifyDrawable(who);
+    }
+
+    @Override
+    protected void drawableStateChanged() {
+        Drawable d = mBackground;
+        if (d != null && d.isStateful()) {
+            d.setState(getDrawableState());
+        }
+        super.drawableStateChanged();
+    }
+
+    @Override
+    public void draw(Canvas canvas) {
+        final Drawable background = mBackground;
+        if (background != null) {
+            final int scrollX = mScrollX;
+            final int scrollY = mScrollY;
+
+            if (mBackgroundSizeChanged) {
+                background.setBounds(0, 0,  mRight - mLeft, mBottom - mTop);
+                mBackgroundSizeChanged = false;
+            }
+
+            if ((scrollX | scrollY) == 0) {
+                background.draw(canvas);
+            } else {
+                canvas.translate(scrollX, scrollY);
+                background.draw(canvas);
+                canvas.translate(-scrollX, -scrollY);
+            }
+        }
+
+        final Layout layout = getLayout();
+        final RectF rect = mRect;
+        final int left = getCompoundPaddingLeft();
+        final int top = getExtendedPaddingTop();
+
+        rect.set(left + layout.getLineLeft(0) - mPaddingH,
+                top + layout.getLineTop(0) -  mPaddingV,
+                Math.min(left + layout.getLineRight(0) + mPaddingH, mScrollX + mRight - mLeft),
+                top + layout.getLineBottom(0) + mPaddingV);
+        canvas.drawRoundRect(rect, mCornerRadius, mCornerRadius, mPaint);
+
+        super.draw(canvas);
+    }
+
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        mBackground.setCallback(this);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        mBackground.setCallback(null);
+    }
+}
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
new file mode 100644
index 0000000..6970875
--- /dev/null
+++ b/src/com/android/launcher2/CellLayout.java
@@ -0,0 +1,1095 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.content.res.Resources;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.Canvas;
+import android.util.AttributeSet;
+import android.view.ContextMenu;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewDebug;
+import android.view.ViewGroup;
+import android.app.WallpaperManager;
+
+import java.util.ArrayList;
+
+public class CellLayout extends ViewGroup {
+    private boolean mPortrait;
+
+    private int mCellWidth;
+    private int mCellHeight;
+    
+    private int mLongAxisStartPadding;
+    private int mLongAxisEndPadding;
+
+    private int mShortAxisStartPadding;
+    private int mShortAxisEndPadding;
+
+    private int mShortAxisCells;
+    private int mLongAxisCells;
+
+    private int mWidthGap;
+    private int mHeightGap;
+
+    private final Rect mRect = new Rect();
+    private final CellInfo mCellInfo = new CellInfo();
+    
+    int[] mCellXY = new int[2];
+    boolean[][] mOccupied;
+
+    private RectF mDragRect = new RectF();
+
+    private boolean mDirtyTag;
+    private boolean mLastDownOnOccupiedCell = false;
+    
+    private final WallpaperManager mWallpaperManager;     
+
+    public CellLayout(Context context) {
+        this(context, null);
+    }
+
+    public CellLayout(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public CellLayout(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);
+
+        mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
+        mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
+        
+        mLongAxisStartPadding = 
+            a.getDimensionPixelSize(R.styleable.CellLayout_longAxisStartPadding, 10);
+        mLongAxisEndPadding = 
+            a.getDimensionPixelSize(R.styleable.CellLayout_longAxisEndPadding, 10);
+        mShortAxisStartPadding =
+            a.getDimensionPixelSize(R.styleable.CellLayout_shortAxisStartPadding, 10);
+        mShortAxisEndPadding = 
+            a.getDimensionPixelSize(R.styleable.CellLayout_shortAxisEndPadding, 10);
+        
+        mShortAxisCells = a.getInt(R.styleable.CellLayout_shortAxisCells, 4);
+        mLongAxisCells = a.getInt(R.styleable.CellLayout_longAxisCells, 4);
+
+        a.recycle();
+
+        setAlwaysDrawnWithCacheEnabled(false);
+
+        if (mOccupied == null) {
+            if (mPortrait) {
+                mOccupied = new boolean[mShortAxisCells][mLongAxisCells];
+            } else {
+                mOccupied = new boolean[mLongAxisCells][mShortAxisCells];
+            }
+        }
+        
+        mWallpaperManager = WallpaperManager.getInstance(getContext());
+    }
+
+    @Override
+    public void dispatchDraw(Canvas canvas) {
+        super.dispatchDraw(canvas);
+    }
+
+    @Override
+    public void cancelLongPress() {
+        super.cancelLongPress();
+
+        // Cancel long press for all children
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            final View child = getChildAt(i);
+            child.cancelLongPress();
+        }
+    }
+
+    int getCountX() {
+        return mPortrait ? mShortAxisCells : mLongAxisCells;
+    }
+
+    int getCountY() {
+        return mPortrait ? mLongAxisCells : mShortAxisCells;
+    }
+
+    @Override
+    public void addView(View child, int index, ViewGroup.LayoutParams params) {
+        // Generate an id for each view, this assumes we have at most 256x256 cells
+        // per workspace screen
+        final LayoutParams cellParams = (LayoutParams) params;
+        cellParams.regenerateId = true;
+
+        super.addView(child, index, params);
+    }
+
+    @Override
+    public void requestChildFocus(View child, View focused) {
+        super.requestChildFocus(child, focused);
+        if (child != null) {
+            Rect r = new Rect();
+            child.getDrawingRect(r);
+            requestRectangleOnScreen(r);
+        }
+    }
+
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        mCellInfo.screen = ((ViewGroup) getParent()).indexOfChild(this);
+    }
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        final int action = ev.getAction();
+        final CellInfo cellInfo = mCellInfo;
+
+        if (action == MotionEvent.ACTION_DOWN) {
+            final Rect frame = mRect;
+            final int x = (int) ev.getX() + mScrollX;
+            final int y = (int) ev.getY() + mScrollY;
+            final int count = getChildCount();
+
+            boolean found = false;
+            for (int i = count - 1; i >= 0; i--) {
+                final View child = getChildAt(i);
+
+                if ((child.getVisibility()) == VISIBLE || child.getAnimation() != null) {
+                    child.getHitRect(frame);
+                    if (frame.contains(x, y)) {
+                        final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+                        cellInfo.cell = child;
+                        cellInfo.cellX = lp.cellX;
+                        cellInfo.cellY = lp.cellY;
+                        cellInfo.spanX = lp.cellHSpan;
+                        cellInfo.spanY = lp.cellVSpan;
+                        cellInfo.valid = true;
+                        found = true;
+                        mDirtyTag = false;
+                        break;
+                    }
+                }
+            }
+            
+            mLastDownOnOccupiedCell = found;
+
+            if (!found) {
+                int cellXY[] = mCellXY;
+                pointToCellExact(x, y, cellXY);
+
+                final boolean portrait = mPortrait;
+                final int xCount = portrait ? mShortAxisCells : mLongAxisCells;
+                final int yCount = portrait ? mLongAxisCells : mShortAxisCells;
+
+                final boolean[][] occupied = mOccupied;
+                findOccupiedCells(xCount, yCount, occupied, null);
+
+                cellInfo.cell = null;
+                cellInfo.cellX = cellXY[0];
+                cellInfo.cellY = cellXY[1];
+                cellInfo.spanX = 1;
+                cellInfo.spanY = 1;
+                cellInfo.valid = cellXY[0] >= 0 && cellXY[1] >= 0 && cellXY[0] < xCount &&
+                        cellXY[1] < yCount && !occupied[cellXY[0]][cellXY[1]];
+
+                // Instead of finding the interesting vacant cells here, wait until a
+                // caller invokes getTag() to retrieve the result. Finding the vacant
+                // cells is a bit expensive and can generate many new objects, it's
+                // therefore better to defer it until we know we actually need it.
+
+                mDirtyTag = true;
+            }
+            setTag(cellInfo);
+        } else if (action == MotionEvent.ACTION_UP) {
+            cellInfo.cell = null;
+            cellInfo.cellX = -1;
+            cellInfo.cellY = -1;
+            cellInfo.spanX = 0;
+            cellInfo.spanY = 0;
+            cellInfo.valid = false;
+            mDirtyTag = false;
+            setTag(cellInfo);
+        }
+
+        return false;
+    }
+
+    @Override
+    public CellInfo getTag() {
+        final CellInfo info = (CellInfo) super.getTag();
+        if (mDirtyTag && info.valid) {
+            final boolean portrait = mPortrait;
+            final int xCount = portrait ? mShortAxisCells : mLongAxisCells;
+            final int yCount = portrait ? mLongAxisCells : mShortAxisCells;
+
+            final boolean[][] occupied = mOccupied;
+            findOccupiedCells(xCount, yCount, occupied, null);
+
+            findIntersectingVacantCells(info, info.cellX, info.cellY, xCount, yCount, occupied);
+
+            mDirtyTag = false;
+        }
+        return info;
+    }
+
+    private static void findIntersectingVacantCells(CellInfo cellInfo, int x, int y,
+            int xCount, int yCount, boolean[][] occupied) {
+
+        cellInfo.maxVacantSpanX = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanXSpanY = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanY = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanYSpanX = Integer.MIN_VALUE;
+        cellInfo.clearVacantCells();
+
+        if (occupied[x][y]) {
+            return;
+        }
+
+        cellInfo.current.set(x, y, x, y);
+
+        findVacantCell(cellInfo.current, xCount, yCount, occupied, cellInfo);
+    }
+
+    private static void findVacantCell(Rect current, int xCount, int yCount, boolean[][] occupied,
+            CellInfo cellInfo) {
+
+        addVacantCell(current, cellInfo);
+
+        if (current.left > 0) {
+            if (isColumnEmpty(current.left - 1, current.top, current.bottom, occupied)) {
+                current.left--;
+                findVacantCell(current, xCount, yCount, occupied, cellInfo);
+                current.left++;
+            }
+        }
+
+        if (current.right < xCount - 1) {
+            if (isColumnEmpty(current.right + 1, current.top, current.bottom, occupied)) {
+                current.right++;
+                findVacantCell(current, xCount, yCount, occupied, cellInfo);
+                current.right--;
+            }
+        }
+
+        if (current.top > 0) {
+            if (isRowEmpty(current.top - 1, current.left, current.right, occupied)) {
+                current.top--;
+                findVacantCell(current, xCount, yCount, occupied, cellInfo);
+                current.top++;
+            }
+        }
+
+        if (current.bottom < yCount - 1) {
+            if (isRowEmpty(current.bottom + 1, current.left, current.right, occupied)) {
+                current.bottom++;
+                findVacantCell(current, xCount, yCount, occupied, cellInfo);
+                current.bottom--;
+            }
+        }
+    }
+
+    private static void addVacantCell(Rect current, CellInfo cellInfo) {
+        CellInfo.VacantCell cell = CellInfo.VacantCell.acquire();
+        cell.cellX = current.left;
+        cell.cellY = current.top;
+        cell.spanX = current.right - current.left + 1;
+        cell.spanY = current.bottom - current.top + 1;
+        if (cell.spanX > cellInfo.maxVacantSpanX) {
+            cellInfo.maxVacantSpanX = cell.spanX;
+            cellInfo.maxVacantSpanXSpanY = cell.spanY;
+        }
+        if (cell.spanY > cellInfo.maxVacantSpanY) {
+            cellInfo.maxVacantSpanY = cell.spanY;
+            cellInfo.maxVacantSpanYSpanX = cell.spanX;
+        }
+        cellInfo.vacantCells.add(cell);
+    }
+
+    private static boolean isColumnEmpty(int x, int top, int bottom, boolean[][] occupied) {
+        for (int y = top; y <= bottom; y++) {
+            if (occupied[x][y]) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private static boolean isRowEmpty(int y, int left, int right, boolean[][] occupied) {
+        for (int x = left; x <= right; x++) {
+            if (occupied[x][y]) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    CellInfo findAllVacantCells(boolean[] occupiedCells, View ignoreView) {
+        final boolean portrait = mPortrait;
+        final int xCount = portrait ? mShortAxisCells : mLongAxisCells;
+        final int yCount = portrait ? mLongAxisCells : mShortAxisCells;
+
+        boolean[][] occupied = mOccupied;
+
+        if (occupiedCells != null) {
+            for (int y = 0; y < yCount; y++) {
+                for (int x = 0; x < xCount; x++) {
+                    occupied[x][y] = occupiedCells[y * xCount + x];
+                }
+            }
+        } else {
+            findOccupiedCells(xCount, yCount, occupied, ignoreView);
+        }
+
+        CellInfo cellInfo = new CellInfo();
+
+        cellInfo.cellX = -1;
+        cellInfo.cellY = -1;
+        cellInfo.spanY = 0;
+        cellInfo.spanX = 0;
+        cellInfo.maxVacantSpanX = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanXSpanY = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanY = Integer.MIN_VALUE;
+        cellInfo.maxVacantSpanYSpanX = Integer.MIN_VALUE;
+        cellInfo.screen = mCellInfo.screen;
+
+        Rect current = cellInfo.current;
+
+        for (int x = 0; x < xCount; x++) {
+            for (int y = 0; y < yCount; y++) {
+                if (!occupied[x][y]) {
+                    current.set(x, y, x, y);
+                    findVacantCell(current, xCount, yCount, occupied, cellInfo);
+                    occupied[x][y] = true;
+                }
+            }
+        }
+
+        cellInfo.valid = cellInfo.vacantCells.size() > 0;
+
+        // Assume the caller will perform their own cell searching, otherwise we
+        // risk causing an unnecessary rebuild after findCellForSpan()
+        
+        return cellInfo;
+    }
+
+    /**
+     * Given a point, return the cell that strictly encloses that point 
+     * @param x X coordinate of the point
+     * @param y Y coordinate of the point
+     * @param result Array of 2 ints to hold the x and y coordinate of the cell
+     */
+    void pointToCellExact(int x, int y, int[] result) {
+        final boolean portrait = mPortrait;
+        
+        final int hStartPadding = portrait ? mShortAxisStartPadding : mLongAxisStartPadding;
+        final int vStartPadding = portrait ? mLongAxisStartPadding : mShortAxisStartPadding;
+
+        result[0] = (x - hStartPadding) / (mCellWidth + mWidthGap);
+        result[1] = (y - vStartPadding) / (mCellHeight + mHeightGap);
+
+        final int xAxis = portrait ? mShortAxisCells : mLongAxisCells;
+        final int yAxis = portrait ? mLongAxisCells : mShortAxisCells;
+
+        if (result[0] < 0) result[0] = 0;
+        if (result[0] >= xAxis) result[0] = xAxis - 1;
+        if (result[1] < 0) result[1] = 0;
+        if (result[1] >= yAxis) result[1] = yAxis - 1;
+    }
+    
+    /**
+     * Given a point, return the cell that most closely encloses that point
+     * @param x X coordinate of the point
+     * @param y Y coordinate of the point
+     * @param result Array of 2 ints to hold the x and y coordinate of the cell
+     */
+    void pointToCellRounded(int x, int y, int[] result) {
+        pointToCellExact(x + (mCellWidth / 2), y + (mCellHeight / 2), result);
+    }
+
+    /**
+     * Given a cell coordinate, return the point that represents the upper left corner of that cell
+     * 
+     * @param cellX X coordinate of the cell 
+     * @param cellY Y coordinate of the cell
+     * 
+     * @param result Array of 2 ints to hold the x and y coordinate of the point
+     */
+    void cellToPoint(int cellX, int cellY, int[] result) {
+        final boolean portrait = mPortrait;
+        
+        final int hStartPadding = portrait ? mShortAxisStartPadding : mLongAxisStartPadding;
+        final int vStartPadding = portrait ? mLongAxisStartPadding : mShortAxisStartPadding;
+
+
+        result[0] = hStartPadding + cellX * (mCellWidth + mWidthGap);
+        result[1] = vStartPadding + cellY * (mCellHeight + mHeightGap);
+    }
+
+    int getCellWidth() {
+        return mCellWidth;
+    }
+
+    int getCellHeight() {
+        return mCellHeight;
+    }
+
+    int getLeftPadding() {
+        return mPortrait ? mShortAxisStartPadding : mLongAxisStartPadding;
+    }
+
+    int getTopPadding() {
+        return mPortrait ? mLongAxisStartPadding : mShortAxisStartPadding;        
+    }
+
+    int getRightPadding() {
+        return mPortrait ? mShortAxisEndPadding : mLongAxisEndPadding;
+    }
+
+    int getBottomPadding() {
+        return mPortrait ? mLongAxisEndPadding : mShortAxisEndPadding;        
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        // TODO: currently ignoring padding
+        
+        int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
+        int widthSpecSize =  MeasureSpec.getSize(widthMeasureSpec);
+        
+        int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
+        int heightSpecSize =  MeasureSpec.getSize(heightMeasureSpec);
+        
+        if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) {
+            throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions");
+        }
+
+        final int shortAxisCells = mShortAxisCells;
+        final int longAxisCells = mLongAxisCells;
+        final int longAxisStartPadding = mLongAxisStartPadding;
+        final int longAxisEndPadding = mLongAxisEndPadding;
+        final int shortAxisStartPadding = mShortAxisStartPadding;
+        final int shortAxisEndPadding = mShortAxisEndPadding;
+        final int cellWidth = mCellWidth;
+        final int cellHeight = mCellHeight;
+
+        mPortrait = heightSpecSize > widthSpecSize;
+
+        int numShortGaps = shortAxisCells - 1;
+        int numLongGaps = longAxisCells - 1;
+
+        if (mPortrait) {
+            int vSpaceLeft = heightSpecSize - longAxisStartPadding - longAxisEndPadding
+                    - (cellHeight * longAxisCells);
+            mHeightGap = vSpaceLeft / numLongGaps;
+
+            int hSpaceLeft = widthSpecSize - shortAxisStartPadding - shortAxisEndPadding
+                    - (cellWidth * shortAxisCells);
+            if (numShortGaps > 0) {
+                mWidthGap = hSpaceLeft / numShortGaps;
+            } else {
+                mWidthGap = 0;
+            }
+        } else {
+            int hSpaceLeft = widthSpecSize - longAxisStartPadding - longAxisEndPadding
+                    - (cellWidth * longAxisCells);
+            mWidthGap = hSpaceLeft / numLongGaps;
+
+            int vSpaceLeft = heightSpecSize - shortAxisStartPadding - shortAxisEndPadding
+                    - (cellHeight * shortAxisCells);
+            if (numShortGaps > 0) {
+                mHeightGap = vSpaceLeft / numShortGaps;
+            } else {
+                mHeightGap = 0;
+            }
+        }
+        
+        int count = getChildCount();
+
+        for (int i = 0; i < count; i++) {
+            View child = getChildAt(i);
+            LayoutParams lp = (LayoutParams) child.getLayoutParams();
+
+            if (mPortrait) {
+                lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, shortAxisStartPadding,
+                        longAxisStartPadding);
+            } else {
+                lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, longAxisStartPadding,
+                        shortAxisStartPadding);
+            }
+            
+            if (lp.regenerateId) {
+                child.setId(((getId() & 0xFF) << 16) | (lp.cellX & 0xFF) << 8 | (lp.cellY & 0xFF));
+                lp.regenerateId = false;
+            }
+
+            int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
+            int childheightMeasureSpec =
+                    MeasureSpec.makeMeasureSpec(lp.height, MeasureSpec.EXACTLY);
+            child.measure(childWidthMeasureSpec, childheightMeasureSpec);
+        }
+
+        setMeasuredDimension(widthSpecSize, heightSpecSize);
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        int count = getChildCount();
+
+        for (int i = 0; i < count; i++) {
+            View child = getChildAt(i);
+            if (child.getVisibility() != GONE) {
+
+                CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
+
+                int childLeft = lp.x;
+                int childTop = lp.y;
+                child.layout(childLeft, childTop, childLeft + lp.width, childTop + lp.height);
+
+                if (lp.dropped) {
+                    lp.dropped = false;
+
+                    mWallpaperManager.sendWallpaperCommand(getWindowToken(), "android.home.drop",
+                            childLeft + lp.width / 2, childTop + lp.height / 2, 0, null);
+                }
+            }
+        }
+    }
+
+    @Override
+    protected void setChildrenDrawingCacheEnabled(boolean enabled) {
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            final View view = getChildAt(i);
+            view.setDrawingCacheEnabled(enabled);
+            // Update the drawing caches
+            view.buildDrawingCache(true);
+        }
+    }
+
+    @Override
+    protected void setChildrenDrawnWithCacheEnabled(boolean enabled) {
+        super.setChildrenDrawnWithCacheEnabled(enabled);
+    }
+
+    /**
+     * Find a vacant area that will fit the given bounds nearest the requested
+     * cell location. Uses Euclidean distance to score multiple vacant areas.
+     * 
+     * @param pixelX The X location at which you want to search for a vacant area.
+     * @param pixelY The Y location at which you want to search for a vacant area.
+     * @param spanX Horizontal span of the object.
+     * @param spanY Vertical span of the object.
+     * @param vacantCells Pre-computed set of vacant cells to search.
+     * @param recycle Previously returned value to possibly recycle.
+     * @return The X, Y cell of a vacant area that can contain this object,
+     *         nearest the requested location.
+     */
+    int[] findNearestVacantArea(int pixelX, int pixelY, int spanX, int spanY,
+            CellInfo vacantCells, int[] recycle) {
+        
+        // Keep track of best-scoring drop area
+        final int[] bestXY = recycle != null ? recycle : new int[2];
+        final int[] cellXY = mCellXY;
+        double bestDistance = Double.MAX_VALUE;
+        
+        // Bail early if vacant cells aren't valid
+        if (!vacantCells.valid) {
+            return null;
+        }
+
+        // Look across all vacant cells for best fit
+        final int size = vacantCells.vacantCells.size();
+        for (int i = 0; i < size; i++) {
+            final CellInfo.VacantCell cell = vacantCells.vacantCells.get(i);
+            
+            // Reject if vacant cell isn't our exact size
+            if (cell.spanX != spanX || cell.spanY != spanY) {
+                continue;
+            }
+            
+            // Score is center distance from requested pixel
+            cellToPoint(cell.cellX, cell.cellY, cellXY);
+            
+            double distance = Math.sqrt(Math.pow(cellXY[0] - pixelX, 2) +
+                    Math.pow(cellXY[1] - pixelY, 2));
+            if (distance <= bestDistance) {
+                bestDistance = distance;
+                bestXY[0] = cell.cellX;
+                bestXY[1] = cell.cellY;
+            }
+        }
+
+        // Return null if no suitable location found 
+        if (bestDistance < Double.MAX_VALUE) {
+            return bestXY;
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * Drop a child at the specified position
+     *
+     * @param child The child that is being dropped
+     * @param targetXY Destination area to move to
+     */
+    void onDropChild(View child, int[] targetXY) {
+        if (child != null) {
+            LayoutParams lp = (LayoutParams) child.getLayoutParams();
+            lp.cellX = targetXY[0];
+            lp.cellY = targetXY[1];
+            lp.isDragging = false;
+            lp.dropped = true;
+            mDragRect.setEmpty();
+            child.requestLayout();
+            invalidate();
+        }
+    }
+
+    void onDropAborted(View child) {
+        if (child != null) {
+            ((LayoutParams) child.getLayoutParams()).isDragging = false;
+            invalidate();
+        }
+        mDragRect.setEmpty();
+    }
+
+    /**
+     * Start dragging the specified child
+     * 
+     * @param child The child that is being dragged
+     */
+    void onDragChild(View child) {
+        LayoutParams lp = (LayoutParams) child.getLayoutParams();
+        lp.isDragging = true;
+        mDragRect.setEmpty();
+    }
+    
+    /**
+     * Drag a child over the specified position
+     * 
+     * @param child The child that is being dropped
+     * @param cellX The child's new x cell location
+     * @param cellY The child's new y cell location 
+     */
+    void onDragOverChild(View child, int cellX, int cellY) {
+        int[] cellXY = mCellXY;
+        pointToCellRounded(cellX, cellY, cellXY);
+        LayoutParams lp = (LayoutParams) child.getLayoutParams();
+        cellToRect(cellXY[0], cellXY[1], lp.cellHSpan, lp.cellVSpan, mDragRect);
+        invalidate();
+    }
+    
+    /**
+     * Computes a bounding rectangle for a range of cells
+     *  
+     * @param cellX X coordinate of upper left corner expressed as a cell position
+     * @param cellY Y coordinate of upper left corner expressed as a cell position
+     * @param cellHSpan Width in cells 
+     * @param cellVSpan Height in cells
+     * @param dragRect Rectnagle into which to put the results
+     */
+    public void cellToRect(int cellX, int cellY, int cellHSpan, int cellVSpan, RectF dragRect) {
+        final boolean portrait = mPortrait;
+        final int cellWidth = mCellWidth;
+        final int cellHeight = mCellHeight;
+        final int widthGap = mWidthGap;
+        final int heightGap = mHeightGap;
+        
+        final int hStartPadding = portrait ? mShortAxisStartPadding : mLongAxisStartPadding;
+        final int vStartPadding = portrait ? mLongAxisStartPadding : mShortAxisStartPadding;
+        
+        int width = cellHSpan * cellWidth + ((cellHSpan - 1) * widthGap);
+        int height = cellVSpan * cellHeight + ((cellVSpan - 1) * heightGap);
+
+        int x = hStartPadding + cellX * (cellWidth + widthGap);
+        int y = vStartPadding + cellY * (cellHeight + heightGap);
+        
+        dragRect.set(x, y, x + width, y + height);
+    }
+    
+    /**
+     * Computes the required horizontal and vertical cell spans to always 
+     * fit the given rectangle.
+     *  
+     * @param width Width in pixels
+     * @param height Height in pixels
+     */
+    public int[] rectToCell(int width, int height) {
+        // Always assume we're working with the smallest span to make sure we
+        // reserve enough space in both orientations.
+        final Resources resources = getResources();
+        int actualWidth = resources.getDimensionPixelSize(R.dimen.workspace_cell_width);
+        int actualHeight = resources.getDimensionPixelSize(R.dimen.workspace_cell_height);
+        int smallerSize = Math.min(actualWidth, actualHeight);
+
+        // Always round up to next largest cell
+        int spanX = (width + smallerSize) / smallerSize;
+        int spanY = (height + smallerSize) / smallerSize;
+
+        return new int[] { spanX, spanY };
+    }
+
+    /**
+     * Find the first vacant cell, if there is one.
+     *
+     * @param vacant Holds the x and y coordinate of the vacant cell
+     * @param spanX Horizontal cell span.
+     * @param spanY Vertical cell span.
+     * 
+     * @return True if a vacant cell was found
+     */
+    public boolean getVacantCell(int[] vacant, int spanX, int spanY) {
+        final boolean portrait = mPortrait;
+        final int xCount = portrait ? mShortAxisCells : mLongAxisCells;
+        final int yCount = portrait ? mLongAxisCells : mShortAxisCells;
+        final boolean[][] occupied = mOccupied;
+
+        findOccupiedCells(xCount, yCount, occupied, null);
+
+        return findVacantCell(vacant, spanX, spanY, xCount, yCount, occupied);
+    }
+
+    static boolean findVacantCell(int[] vacant, int spanX, int spanY,
+            int xCount, int yCount, boolean[][] occupied) {
+
+        for (int x = 0; x < xCount; x++) {
+            for (int y = 0; y < yCount; y++) {
+                boolean available = !occupied[x][y];
+out:            for (int i = x; i < x + spanX - 1 && x < xCount; i++) {
+                    for (int j = y; j < y + spanY - 1 && y < yCount; j++) {
+                        available = available && !occupied[i][j];
+                        if (!available) break out;
+                    }
+                }
+
+                if (available) {
+                    vacant[0] = x;
+                    vacant[1] = y;
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    boolean[] getOccupiedCells() {
+        final boolean portrait = mPortrait;
+        final int xCount = portrait ? mShortAxisCells : mLongAxisCells;
+        final int yCount = portrait ? mLongAxisCells : mShortAxisCells;
+        final boolean[][] occupied = mOccupied;
+
+        findOccupiedCells(xCount, yCount, occupied, null);
+
+        final boolean[] flat = new boolean[xCount * yCount];
+        for (int y = 0; y < yCount; y++) {
+            for (int x = 0; x < xCount; x++) {
+                flat[y * xCount + x] = occupied[x][y];
+            }
+        }
+
+        return flat;
+    }
+
+    private void findOccupiedCells(int xCount, int yCount, boolean[][] occupied, View ignoreView) {
+        for (int x = 0; x < xCount; x++) {
+            for (int y = 0; y < yCount; y++) {
+                occupied[x][y] = false;
+            }
+        }
+
+        int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            View child = getChildAt(i);
+            if (child instanceof Folder || child.equals(ignoreView)) {
+                continue;
+            }
+            LayoutParams lp = (LayoutParams) child.getLayoutParams();
+
+            for (int x = lp.cellX; x < lp.cellX + lp.cellHSpan && x < xCount; x++) {
+                for (int y = lp.cellY; y < lp.cellY + lp.cellVSpan && y < yCount; y++) {
+                    occupied[x][y] = true;
+                }
+            }
+        }
+    }
+
+    @Override
+    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
+        return new CellLayout.LayoutParams(getContext(), attrs);
+    }
+
+    @Override
+    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
+        return p instanceof CellLayout.LayoutParams;
+    }
+
+    @Override
+    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
+        return new CellLayout.LayoutParams(p);
+    }
+
+    public static class LayoutParams extends ViewGroup.MarginLayoutParams {
+        /**
+         * Horizontal location of the item in the grid.
+         */
+        @ViewDebug.ExportedProperty
+        public int cellX;
+
+        /**
+         * Vertical location of the item in the grid.
+         */
+        @ViewDebug.ExportedProperty
+        public int cellY;
+
+        /**
+         * Number of cells spanned horizontally by the item.
+         */
+        @ViewDebug.ExportedProperty
+        public int cellHSpan;
+
+        /**
+         * Number of cells spanned vertically by the item.
+         */
+        @ViewDebug.ExportedProperty
+        public int cellVSpan;
+        
+        /**
+         * Is this item currently being dragged
+         */
+        public boolean isDragging;
+
+        // X coordinate of the view in the layout.
+        @ViewDebug.ExportedProperty
+        int x;
+        // Y coordinate of the view in the layout.
+        @ViewDebug.ExportedProperty
+        int y;
+
+        boolean regenerateId;
+        
+        boolean dropped;
+
+        public LayoutParams(Context c, AttributeSet attrs) {
+            super(c, attrs);
+            cellHSpan = 1;
+            cellVSpan = 1;
+        }
+
+        public LayoutParams(ViewGroup.LayoutParams source) {
+            super(source);
+            cellHSpan = 1;
+            cellVSpan = 1;
+        }
+        
+        public LayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan) {
+            super(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+            this.cellX = cellX;
+            this.cellY = cellY;
+            this.cellHSpan = cellHSpan;
+            this.cellVSpan = cellVSpan;
+        }
+
+        public void setup(int cellWidth, int cellHeight, int widthGap, int heightGap,
+                int hStartPadding, int vStartPadding) {
+            
+            final int myCellHSpan = cellHSpan;
+            final int myCellVSpan = cellVSpan;
+            final int myCellX = cellX;
+            final int myCellY = cellY;
+            
+            width = myCellHSpan * cellWidth + ((myCellHSpan - 1) * widthGap) -
+                    leftMargin - rightMargin;
+            height = myCellVSpan * cellHeight + ((myCellVSpan - 1) * heightGap) -
+                    topMargin - bottomMargin;
+
+            x = hStartPadding + myCellX * (cellWidth + widthGap) + leftMargin;
+            y = vStartPadding + myCellY * (cellHeight + heightGap) + topMargin;
+        }
+    }
+
+    static final class CellInfo implements ContextMenu.ContextMenuInfo {
+        /**
+         * See View.AttachInfo.InvalidateInfo for futher explanations about
+         * the recycling mechanism. In this case, we recycle the vacant cells
+         * instances because up to several hundreds can be instanciated when
+         * the user long presses an empty cell.
+         */
+        static final class VacantCell {
+            int cellX;
+            int cellY;
+            int spanX;
+            int spanY;
+
+            // We can create up to 523 vacant cells on a 4x4 grid, 100 seems
+            // like a reasonable compromise given the size of a VacantCell and
+            // the fact that the user is not likely to touch an empty 4x4 grid
+            // very often 
+            private static final int POOL_LIMIT = 100;
+            private static final Object sLock = new Object();
+
+            private static int sAcquiredCount = 0;
+            private static VacantCell sRoot;
+
+            private VacantCell next;
+
+            static VacantCell acquire() {
+                synchronized (sLock) {
+                    if (sRoot == null) {
+                        return new VacantCell();
+                    }
+
+                    VacantCell info = sRoot;
+                    sRoot = info.next;
+                    sAcquiredCount--;
+
+                    return info;
+                }
+            }
+
+            void release() {
+                synchronized (sLock) {
+                    if (sAcquiredCount < POOL_LIMIT) {
+                        sAcquiredCount++;
+                        next = sRoot;
+                        sRoot = this;
+                    }
+                }
+            }
+
+            @Override
+            public String toString() {
+                return "VacantCell[x=" + cellX + ", y=" + cellY + ", spanX=" + spanX +
+                        ", spanY=" + spanY + "]";
+            }
+        }
+
+        View cell;
+        int cellX;
+        int cellY;
+        int spanX;
+        int spanY;
+        int screen;
+        boolean valid;
+
+        final ArrayList<VacantCell> vacantCells = new ArrayList<VacantCell>(VacantCell.POOL_LIMIT);
+        int maxVacantSpanX;
+        int maxVacantSpanXSpanY;
+        int maxVacantSpanY;
+        int maxVacantSpanYSpanX;
+        final Rect current = new Rect();
+
+        void clearVacantCells() {
+            final ArrayList<VacantCell> list = vacantCells;
+            final int count = list.size();
+
+            for (int i = 0; i < count; i++) list.get(i).release();
+
+            list.clear();
+        }
+
+        void findVacantCellsFromOccupied(boolean[] occupied, int xCount, int yCount) {
+            if (cellX < 0 || cellY < 0) {
+                maxVacantSpanX = maxVacantSpanXSpanY = Integer.MIN_VALUE;
+                maxVacantSpanY = maxVacantSpanYSpanX = Integer.MIN_VALUE;
+                clearVacantCells();
+                return;
+            }
+
+            final boolean[][] unflattened = new boolean[xCount][yCount];
+            for (int y = 0; y < yCount; y++) {
+                for (int x = 0; x < xCount; x++) {
+                    unflattened[x][y] = occupied[y * xCount + x];
+                }
+            }
+            CellLayout.findIntersectingVacantCells(this, cellX, cellY, xCount, yCount, unflattened);
+        }
+
+        /**
+         * This method can be called only once! Calling #findVacantCellsFromOccupied will
+         * restore the ability to call this method.
+         *
+         * Finds the upper-left coordinate of the first rectangle in the grid that can
+         * hold a cell of the specified dimensions.
+         *
+         * @param cellXY The array that will contain the position of a vacant cell if such a cell
+         *               can be found.
+         * @param spanX The horizontal span of the cell we want to find.
+         * @param spanY The vertical span of the cell we want to find.
+         *
+         * @return True if a vacant cell of the specified dimension was found, false otherwise.
+         */
+        boolean findCellForSpan(int[] cellXY, int spanX, int spanY) {
+            return findCellForSpan(cellXY, spanX, spanY, true);
+        }
+
+        boolean findCellForSpan(int[] cellXY, int spanX, int spanY, boolean clear) {
+            final ArrayList<VacantCell> list = vacantCells;
+            final int count = list.size();
+
+            boolean found = false;
+
+            if (this.spanX >= spanX && this.spanY >= spanY) {
+                cellXY[0] = cellX;
+                cellXY[1] = cellY;
+                found = true;
+            }
+
+            // Look for an exact match first
+            for (int i = 0; i < count; i++) {
+                VacantCell cell = list.get(i);
+                if (cell.spanX == spanX && cell.spanY == spanY) {
+                    cellXY[0] = cell.cellX;
+                    cellXY[1] = cell.cellY;
+                    found = true;
+                    break;
+                }
+            }
+
+            // Look for the first cell large enough
+            for (int i = 0; i < count; i++) {
+                VacantCell cell = list.get(i);
+                if (cell.spanX >= spanX && cell.spanY >= spanY) {
+                    cellXY[0] = cell.cellX;
+                    cellXY[1] = cell.cellY;
+                    found = true;
+                    break;
+                }
+            }
+
+            if (clear) clearVacantCells();
+
+            return found;
+        }
+
+        @Override
+        public String toString() {
+            return "Cell[view=" + (cell == null ? "null" : cell.getClass()) + ", x=" + cellX +
+                    ", y=" + cellY + "]";
+        }
+    }
+
+    public boolean lastDownOnOccupiedCell() {
+        return mLastDownOnOccupiedCell;
+    }
+}
+
+
diff --git a/src/com/android/launcher2/DeferredHandler.java b/src/com/android/launcher2/DeferredHandler.java
new file mode 100644
index 0000000..ce60352
--- /dev/null
+++ b/src/com/android/launcher2/DeferredHandler.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.MessageQueue;
+import android.util.Log;
+
+import java.util.LinkedList;
+
+/**
+ * Queue of things to run on a looper thread.  Items posted with {@link #post} will not
+ * be actually enqued on the handler until after the last one has run, to keep from
+ * starving the thread.
+ *
+ * This class is fifo.
+ */
+public class DeferredHandler {
+    private LinkedList<Runnable> mQueue = new LinkedList();
+    private MessageQueue mMessageQueue = Looper.myQueue();
+    private Impl mHandler = new Impl();
+
+    private class Impl extends Handler implements MessageQueue.IdleHandler {
+        public void handleMessage(Message msg) {
+            Runnable r;
+            synchronized (mQueue) {
+                if (mQueue.size() == 0) {
+                    return;
+                }
+                r = mQueue.removeFirst();
+            }
+            r.run();
+            synchronized (mQueue) {
+                scheduleNextLocked();
+            }
+        }
+
+        public boolean queueIdle() {
+            handleMessage(null);
+            return false;
+        }
+    }
+
+    private class IdleRunnable implements Runnable {
+        Runnable mRunnable;
+
+        IdleRunnable(Runnable r) {
+            mRunnable = r;
+        }
+
+        public void run() {
+            mRunnable.run();
+        }
+    }
+
+    public DeferredHandler() {
+    }
+
+    /** Schedule runnable to run after everything that's on the queue right now. */
+    public void post(Runnable runnable) {
+        synchronized (mQueue) {
+            mQueue.add(runnable);
+            if (mQueue.size() == 1) {
+                scheduleNextLocked();
+            }
+        }
+    }
+
+    /** Schedule runnable to run when the queue goes idle. */
+    public void postIdle(final Runnable runnable) {
+        post(new IdleRunnable(runnable));
+    }
+
+    public void cancel() {
+        synchronized (mQueue) {
+            mQueue.clear();
+        }
+    }
+
+    void scheduleNextLocked() {
+        if (mQueue.size() > 0) {
+            Runnable peek = mQueue.getFirst();
+            if (peek instanceof IdleRunnable) {
+                mMessageQueue.addIdleHandler(mHandler);
+            } else {
+                mHandler.sendEmptyMessage(1);
+            }
+        }
+    }
+}
+
diff --git a/src/com/android/launcher2/DeleteZone.java b/src/com/android/launcher2/DeleteZone.java
new file mode 100644
index 0000000..ec4bc53
--- /dev/null
+++ b/src/com/android/launcher2/DeleteZone.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.widget.ImageView;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.TranslateAnimation;
+import android.view.animation.Animation;
+import android.view.animation.AnimationSet;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.AlphaAnimation;
+import android.graphics.RectF;
+import android.graphics.drawable.TransitionDrawable;
+
+public class DeleteZone extends ImageView implements DropTarget, DragController.DragListener {
+    private static final int ORIENTATION_HORIZONTAL = 1;
+    private static final int TRANSITION_DURATION = 250;
+    private static final int ANIMATION_DURATION = 200;
+
+    private final int[] mLocation = new int[2];
+    
+    private Launcher mLauncher;
+    private boolean mTrashMode;
+
+    private AnimationSet mInAnimation;
+    private AnimationSet mOutAnimation;
+    private Animation mHandleInAnimation;
+    private Animation mHandleOutAnimation;
+
+    private int mOrientation;
+    private DragController mDragController;
+
+    private final RectF mRegion = new RectF();
+    private TransitionDrawable mTransition;
+    private View mHandle;
+    private final Paint mTrashPaint = new Paint();
+
+    public DeleteZone(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public DeleteZone(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        final int srcColor = context.getResources().getColor(R.color.delete_color_filter);
+        mTrashPaint.setColorFilter(new PorterDuffColorFilter(srcColor, PorterDuff.Mode.SRC_ATOP));
+
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DeleteZone, defStyle, 0);
+        mOrientation = a.getInt(R.styleable.DeleteZone_direction, ORIENTATION_HORIZONTAL);
+        a.recycle();
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        mTransition = (TransitionDrawable) getDrawable();
+    }
+
+    public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        return true;
+    }
+    
+    public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo, Rect recycle) {
+        return null;
+    }
+
+    public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        final ItemInfo item = (ItemInfo) dragInfo;
+
+        if (item.container == -1) return;
+
+        if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+            if (item instanceof LauncherAppWidgetInfo) {
+                mLauncher.removeAppWidget((LauncherAppWidgetInfo) item);
+            }
+        } else {
+            if (source instanceof UserFolder) {
+                final UserFolder userFolder = (UserFolder) source;
+                final UserFolderInfo userFolderInfo = (UserFolderInfo) userFolder.getInfo();
+                // item must be an ApplicationInfo otherwise it couldn't have been in the folder
+                // in the first place.
+                userFolderInfo.remove((ApplicationInfo)item);
+            }
+        }
+        if (item instanceof UserFolderInfo) {
+            final UserFolderInfo userFolderInfo = (UserFolderInfo)item;
+            LauncherModel.deleteUserFolderContentsFromDatabase(mLauncher, userFolderInfo);
+            mLauncher.removeFolder(userFolderInfo);
+        } else if (item instanceof LauncherAppWidgetInfo) {
+            final LauncherAppWidgetInfo launcherAppWidgetInfo = (LauncherAppWidgetInfo) item;
+            final LauncherAppWidgetHost appWidgetHost = mLauncher.getAppWidgetHost();
+            if (appWidgetHost != null) {
+                appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
+            }
+        }
+        LauncherModel.deleteItemFromDatabase(mLauncher, item);
+    }
+
+    public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        mTransition.reverseTransition(TRANSITION_DURATION);
+        dragView.setPaint(mTrashPaint);
+    }
+
+    public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        mTransition.reverseTransition(TRANSITION_DURATION);
+        dragView.setPaint(null);
+    }
+
+    public void onDragStart(DragSource source, Object info, int dragAction) {
+        final ItemInfo item = (ItemInfo) info;
+        if (item != null) {
+            mTrashMode = true;
+            createAnimations();
+            final int[] location = mLocation;
+            getLocationOnScreen(location);
+            mRegion.set(location[0], location[1], location[0] + mRight - mLeft,
+                    location[1] + mBottom - mTop);
+            mDragController.setDeleteRegion(mRegion);
+            mTransition.resetTransition();
+            startAnimation(mInAnimation);
+            mHandle.startAnimation(mHandleOutAnimation);
+            setVisibility(VISIBLE);
+        }
+    }
+
+    public void onDragEnd() {
+        if (mTrashMode) {
+            mTrashMode = false;
+            mDragController.setDeleteRegion(null);
+            startAnimation(mOutAnimation);
+            mHandle.startAnimation(mHandleInAnimation);
+            setVisibility(GONE);
+        }
+    }
+
+    private void createAnimations() {
+        if (mInAnimation == null) {
+            mInAnimation = new FastAnimationSet();
+            final AnimationSet animationSet = mInAnimation;
+            animationSet.setInterpolator(new AccelerateInterpolator());
+            animationSet.addAnimation(new AlphaAnimation(0.0f, 1.0f));
+            if (mOrientation == ORIENTATION_HORIZONTAL) {
+                animationSet.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f,
+                        Animation.RELATIVE_TO_SELF, 0.0f));
+            } else {
+                animationSet.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF,
+                        1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f));
+            }
+            animationSet.setDuration(ANIMATION_DURATION);
+        }
+        if (mHandleInAnimation == null) {
+            if (mOrientation == ORIENTATION_HORIZONTAL) {
+                mHandleInAnimation = new TranslateAnimation(Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f,
+                        Animation.RELATIVE_TO_SELF, 0.0f);
+            } else {
+                mHandleInAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
+                        1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f);
+            }
+            mHandleInAnimation.setDuration(ANIMATION_DURATION);
+        }
+        if (mOutAnimation == null) {
+            mOutAnimation = new FastAnimationSet();
+            final AnimationSet animationSet = mOutAnimation;
+            animationSet.setInterpolator(new AccelerateInterpolator());
+            animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
+            if (mOrientation == ORIENTATION_HORIZONTAL) {
+                animationSet.addAnimation(new FastTranslateAnimation(Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
+                        Animation.RELATIVE_TO_SELF, 1.0f));
+            } else {
+                animationSet.addAnimation(new FastTranslateAnimation(Animation.RELATIVE_TO_SELF,
+                        0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f));
+            }
+            animationSet.setDuration(ANIMATION_DURATION);
+        }
+        if (mHandleOutAnimation == null) {
+            if (mOrientation == ORIENTATION_HORIZONTAL) {
+                mHandleOutAnimation = new FastTranslateAnimation(Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
+                        Animation.RELATIVE_TO_SELF, 1.0f);
+            } else {
+                mHandleOutAnimation = new FastTranslateAnimation(Animation.RELATIVE_TO_SELF,
+                        0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.ABSOLUTE, 0.0f,
+                        Animation.ABSOLUTE, 0.0f);
+            }
+            mHandleOutAnimation.setFillAfter(true);
+            mHandleOutAnimation.setDuration(ANIMATION_DURATION);
+        }
+    }
+
+    void setLauncher(Launcher launcher) {
+        mLauncher = launcher;
+    }
+
+    void setDragController(DragController dragController) {
+        mDragController = dragController;
+    }
+
+    void setHandle(View view) {
+        mHandle = view;
+    }
+
+    private static class FastTranslateAnimation extends TranslateAnimation {
+        public FastTranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue,
+                int fromYType, float fromYValue, int toYType, float toYValue) {
+            super(fromXType, fromXValue, toXType, toXValue,
+                    fromYType, fromYValue, toYType, toYValue);
+        }
+
+        @Override
+        public boolean willChangeTransformationMatrix() {
+            return true;
+        }
+
+        @Override
+        public boolean willChangeBounds() {
+            return false;
+        }
+    }
+
+    private static class FastAnimationSet extends AnimationSet {
+        FastAnimationSet() {
+            super(false);
+        }
+
+        @Override
+        public boolean willChangeTransformationMatrix() {
+            return true;
+        }
+
+        @Override
+        public boolean willChangeBounds() {
+            return false;
+        }
+    }
+}
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
new file mode 100644
index 0000000..590ca69
--- /dev/null
+++ b/src/com/android/launcher2/DragController.java
@@ -0,0 +1,577 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.os.IBinder;
+import android.os.Handler;
+import android.os.Vibrator;
+import android.os.SystemClock;
+import android.util.AttributeSet;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+
+import java.util.ArrayList;
+
+/**
+ * Class for initiating a drag within a view or across multiple views.
+ */
+public class DragController {
+    private static final String TAG = "Launcher.DragController";
+
+    /** Indicates the drag is a move.  */
+    public static int DRAG_ACTION_MOVE = 0;
+
+    /** Indicates the drag is a copy.  */
+    public static int DRAG_ACTION_COPY = 1;
+
+    private static final int SCROLL_DELAY = 600;
+    private static final int SCROLL_ZONE = 20;
+    private static final int VIBRATE_DURATION = 35;
+
+    private static final boolean PROFILE_DRAWING_DURING_DRAG = false;
+
+    private static final int SCROLL_OUTSIDE_ZONE = 0;
+    private static final int SCROLL_WAITING_IN_ZONE = 1;
+
+    private static final int SCROLL_LEFT = 0;
+    private static final int SCROLL_RIGHT = 1;
+
+    private Context mContext;
+    private Handler mHandler;
+    private final Vibrator mVibrator = new Vibrator();
+
+    // temporaries to avoid gc thrash
+    private Rect mRectTemp = new Rect();
+    private final int[] mCoordinatesTemp = new int[2];
+
+    /** Whether or not we're dragging. */
+    private boolean mDragging;
+
+    /** X coordinate of the down event. */
+    private float mMotionDownX;
+
+    /** Y coordinate of the down event. */
+    private float mMotionDownY;
+
+    /** Info about the screen for clamping. */
+    private DisplayMetrics mDisplayMetrics = new DisplayMetrics();
+
+    /** Original view that is being dragged.  */
+    private View mOriginator;
+
+    /** X offset from the upper-left corner of the cell to where we touched.  */
+    private float mTouchOffsetX;
+
+    /** Y offset from the upper-left corner of the cell to where we touched.  */
+    private float mTouchOffsetY;
+
+    /** Where the drag originated */
+    private DragSource mDragSource;
+
+    /** The data associated with the object being dragged */
+    private Object mDragInfo;
+
+    /** The view that moves around while you drag.  */
+    private DragView mDragView;
+
+    /** Who can receive drop events */
+    private ArrayList<DropTarget> mDropTargets = new ArrayList<DropTarget>();
+
+    private DragListener mListener;
+
+    /** The window token used as the parent for the DragView. */
+    private IBinder mWindowToken;
+
+    /** The view that will be scrolled when dragging to the left and right edges of the screen. */
+    private View mScrollView;
+
+    private DragScroller mDragScroller;
+    private int mScrollState = SCROLL_OUTSIDE_ZONE;
+    private ScrollRunnable mScrollRunnable = new ScrollRunnable();
+
+    private RectF mDeleteRegion;
+    private DropTarget mLastDropTarget;
+
+    private InputMethodManager mInputMethodManager;
+
+    /**
+     * Interface to receive notifications when a drag starts or stops
+     */
+    interface DragListener {
+        
+        /**
+         * A drag has begun
+         * 
+         * @param source An object representing where the drag originated
+         * @param info The data associated with the object that is being dragged
+         * @param dragAction The drag action: either {@link DragController#DRAG_ACTION_MOVE}
+         *        or {@link DragController#DRAG_ACTION_COPY}
+         */
+        void onDragStart(DragSource source, Object info, int dragAction);
+        
+        /**
+         * The drag has eneded
+         */
+        void onDragEnd();
+    }
+    
+    /**
+     * Used to create a new DragLayer from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attribtues set containing the Workspace's customization values.
+     */
+    public DragController(Context context) {
+        mContext = context;
+        mHandler = new Handler();
+    }
+
+    /**
+     * Starts a drag.
+     * 
+     * @param v The view that is being dragged
+     * @param source An object representing where the drag originated
+     * @param info The data associated with the object that is being dragged
+     * @param dragAction The drag action: either {@link #DRAG_ACTION_MOVE} or
+     *        {@link #DRAG_ACTION_COPY}
+     */
+    public void startDrag(View v, DragSource source, Object dragInfo, int dragAction) {
+        mOriginator = v;
+
+        Bitmap b = getViewBitmap(v);
+
+        int[] loc = mCoordinatesTemp;
+        v.getLocationOnScreen(loc);
+        int screenX = loc[0];
+        int screenY = loc[1];
+
+        startDrag(b, screenX, screenY, 0, 0, b.getWidth(), b.getHeight(),
+                source, dragInfo, dragAction);
+
+        b.recycle();
+
+        if (dragAction == DRAG_ACTION_MOVE) {
+            v.setVisibility(View.GONE);
+        }
+    }
+
+    /**
+     * Starts a drag.
+     * 
+     * @param b The bitmap to display as the drag image.  It will be re-scaled to the
+     *          enlarged size.
+     * @param screenX The x position on screen of the left-top of the bitmap.
+     * @param screenY The y position on screen of the left-top of the bitmap.
+     * @param textureLeft The left edge of the region inside b to use.
+     * @param textureTop The top edge of the region inside b to use.
+     * @param textureWidth The width of the region inside b to use.
+     * @param textureHeight The height of the region inside b to use.
+     * @param source An object representing where the drag originated
+     * @param info The data associated with the object that is being dragged
+     * @param dragAction The drag action: either {@link #DRAG_ACTION_MOVE} or
+     *        {@link #DRAG_ACTION_COPY}
+     */
+    public void startDrag(Bitmap b, int screenX, int screenY,
+            int textureLeft, int textureTop, int textureWidth, int textureHeight,
+            DragSource source, Object dragInfo, int dragAction) {
+        if (PROFILE_DRAWING_DURING_DRAG) {
+            android.os.Debug.startMethodTracing("Launcher");
+        }
+
+        // Hide soft keyboard, if visible
+        if (mInputMethodManager == null) {
+            mInputMethodManager = (InputMethodManager)
+                    mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
+        }
+        mInputMethodManager.hideSoftInputFromWindow(mWindowToken, 0);
+
+        if (mListener != null) {
+            mListener.onDragStart(source, dragInfo, dragAction);
+        }
+
+        int registrationX = ((int)mMotionDownX) - screenX;
+        int registrationY = ((int)mMotionDownY) - screenY;
+
+        mTouchOffsetX = mMotionDownX - screenX;
+        mTouchOffsetY = mMotionDownY - screenY;
+
+        mDragging = true;
+        mDragSource = source;
+        mDragInfo = dragInfo;
+
+        mVibrator.vibrate(VIBRATE_DURATION);
+
+        DragView dragView = mDragView = new DragView(mContext, b, registrationX, registrationY,
+                textureLeft, textureTop, textureWidth, textureHeight);
+        dragView.show(mWindowToken, (int)mMotionDownX, (int)mMotionDownY);
+    }
+
+    /**
+     * Draw the view into a bitmap.
+     */
+    private Bitmap getViewBitmap(View v) {
+        v.clearFocus();
+        v.setPressed(false);
+
+        boolean willNotCache = v.willNotCacheDrawing();
+        v.setWillNotCacheDrawing(false);
+
+        // Reset the drawing cache background color to fully transparent
+        // for the duration of this operation
+        int color = v.getDrawingCacheBackgroundColor();
+        v.setDrawingCacheBackgroundColor(0);
+
+        if (color != 0) {
+            v.destroyDrawingCache();
+        }
+        v.buildDrawingCache();
+        Bitmap cacheBitmap = v.getDrawingCache();
+
+        Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
+
+        // Restore the view
+        v.destroyDrawingCache();
+        v.setWillNotCacheDrawing(willNotCache);
+        v.setDrawingCacheBackgroundColor(color);
+
+        return bitmap;
+    }
+
+    /**
+     * Call this from a drag source view like this:
+     *
+     * <pre>
+     *  @Override
+     *  public boolean dispatchKeyEvent(KeyEvent event) {
+     *      return mDragController.dispatchKeyEvent(this, event)
+     *              || super.dispatchKeyEvent(event);
+     * </pre>
+     */
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        return mDragging;
+    }
+
+    /**
+     * Stop dragging without dropping.
+     */
+    public void cancelDrag() {
+        endDrag();
+    }
+
+    private void endDrag() {
+        if (mDragging) {
+            mDragging = false;
+            if (mOriginator != null) {
+                mOriginator.setVisibility(View.VISIBLE);
+            }
+            if (mListener != null) {
+                mListener.onDragEnd();
+            }
+            if (mDragView != null) {
+                mDragView.remove();
+                mDragView = null;
+            }
+        }
+    }
+
+    /**
+     * Call this from a drag source view.
+     */
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        if (false) {
+            Log.d(Launcher.TAG, "DragController.onInterceptTouchEvent " + ev + " mDragging="
+                    + mDragging);
+        }
+        final int action = ev.getAction();
+
+        if (action == MotionEvent.ACTION_DOWN) {
+            recordScreenSize();
+        }
+
+        final int screenX = clamp((int)ev.getRawX(), 0, mDisplayMetrics.widthPixels);
+        final int screenY = clamp((int)ev.getRawY(), 0, mDisplayMetrics.heightPixels);
+
+        switch (action) {
+            case MotionEvent.ACTION_MOVE:
+                break;
+
+            case MotionEvent.ACTION_DOWN:
+                // Remember location of down touch
+                mMotionDownX = screenX;
+                mMotionDownY = screenY;
+                mLastDropTarget = null;
+                break;
+
+            case MotionEvent.ACTION_CANCEL:
+            case MotionEvent.ACTION_UP:
+                if (mDragging) {
+                    drop(screenX, screenY);
+                }
+                endDrag();
+                break;
+        }
+
+        return mDragging;
+    }
+
+    /**
+     * Call this from a drag source view.
+     */
+    public boolean onTouchEvent(MotionEvent ev) {
+        View scrollView = mScrollView;
+
+        if (!mDragging) {
+            return false;
+        }
+
+        final int action = ev.getAction();
+        final int screenX = clamp((int)ev.getRawX(), 0, mDisplayMetrics.widthPixels);
+        final int screenY = clamp((int)ev.getRawY(), 0, mDisplayMetrics.heightPixels);
+
+        switch (action) {
+        case MotionEvent.ACTION_DOWN:
+            // Remember where the motion event started
+            mMotionDownX = screenX;
+            mMotionDownY = screenY;
+
+            if ((screenX < SCROLL_ZONE) || (screenX > scrollView.getWidth() - SCROLL_ZONE)) {
+                mScrollState = SCROLL_WAITING_IN_ZONE;
+                mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+            } else {
+                mScrollState = SCROLL_OUTSIDE_ZONE;
+            }
+
+            break;
+        case MotionEvent.ACTION_MOVE:
+            // Update the drag view.  Don't use the clamped pos here so the dragging looks
+            // like it goes off screen a little, intead of bumping up against the edge.
+            mDragView.move((int)ev.getRawX(), (int)ev.getRawY());
+
+            // Drop on someone?
+            final int[] coordinates = mCoordinatesTemp;
+            DropTarget dropTarget = findDropTarget((int) screenX, (int) screenY, coordinates);
+            if (dropTarget != null) {
+                if (mLastDropTarget == dropTarget) {
+                    dropTarget.onDragOver(mDragSource, coordinates[0], coordinates[1],
+                        (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+                } else {
+                    if (mLastDropTarget != null) {
+                        mLastDropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+                            (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+                    }
+                    dropTarget.onDragEnter(mDragSource, coordinates[0], coordinates[1],
+                        (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+                }
+            } else {
+                if (mLastDropTarget != null) {
+                    mLastDropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+                        (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+                }
+            }
+            mLastDropTarget = dropTarget;
+
+            // Scroll, maybe, but not if we're in the delete region.
+            boolean inDeleteRegion = false;
+            if (mDeleteRegion != null) {
+                inDeleteRegion = mDeleteRegion.contains(screenX, screenY);
+            }
+            if (!inDeleteRegion && screenX < SCROLL_ZONE) {
+                if (mScrollState == SCROLL_OUTSIDE_ZONE) {
+                    mScrollState = SCROLL_WAITING_IN_ZONE;
+                    mScrollRunnable.setDirection(SCROLL_LEFT);
+                    mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+                }
+            } else if (!inDeleteRegion && screenX > scrollView.getWidth() - SCROLL_ZONE) {
+                if (mScrollState == SCROLL_OUTSIDE_ZONE) {
+                    mScrollState = SCROLL_WAITING_IN_ZONE;
+                    mScrollRunnable.setDirection(SCROLL_RIGHT);
+                    mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+                }
+            } else {
+                if (mScrollState == SCROLL_WAITING_IN_ZONE) {
+                    mScrollState = SCROLL_OUTSIDE_ZONE;
+                    mScrollRunnable.setDirection(SCROLL_RIGHT);
+                    mHandler.removeCallbacks(mScrollRunnable);
+                }
+            }
+
+            break;
+        case MotionEvent.ACTION_UP:
+            mHandler.removeCallbacks(mScrollRunnable);
+            if (mDragging) {
+                drop(screenX, screenY);
+            }
+            endDrag();
+
+            break;
+        case MotionEvent.ACTION_CANCEL:
+            cancelDrag();
+        }
+
+        return true;
+    }
+
+    private boolean drop(float x, float y) {
+        final int[] coordinates = mCoordinatesTemp;
+        DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);
+
+        if (dropTarget != null) {
+            dropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+                    (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+            if (dropTarget.acceptDrop(mDragSource, coordinates[0], coordinates[1],
+                    (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo)) {
+                dropTarget.onDrop(mDragSource, coordinates[0], coordinates[1],
+                        (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+                mDragSource.onDropCompleted((View) dropTarget, true);
+                return true;
+            } else {
+                mDragSource.onDropCompleted((View) dropTarget, false);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) {
+        final Rect r = mRectTemp;
+
+        final ArrayList<DropTarget> dropTargets = mDropTargets;
+        final int count = dropTargets.size();
+        for (int i=count-1; i>=0; i--) {
+            final DropTarget target = dropTargets.get(i);
+            target.getHitRect(r);
+            target.getLocationOnScreen(dropCoordinates);
+            r.offset(dropCoordinates[0] - target.getLeft(), dropCoordinates[1] - target.getTop());
+            if (r.contains(x, y)) {
+                dropCoordinates[0] = x - dropCoordinates[0];
+                dropCoordinates[1] = y - dropCoordinates[1];
+                return target;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Get the screen size so we can clamp events to the screen size so even if
+     * you drag off the edge of the screen, we find something.
+     */
+    private void recordScreenSize() {
+        ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
+                .getDefaultDisplay().getMetrics(mDisplayMetrics);
+    }
+
+    /**
+     * Clamp val to be &gt;= min and &lt; max.
+     */
+    private static int clamp(int val, int min, int max) {
+        if (val < min) {
+            return min;
+        } else if (val >= max) {
+            return max - 1;
+        } else {
+            return val;
+        }
+    }
+
+    public void setDragScoller(DragScroller scroller) {
+        mDragScroller = scroller;
+    }
+
+    public void setWindowToken(IBinder token) {
+        mWindowToken = token;
+    }
+
+    /**
+     * Sets the drag listner which will be notified when a drag starts or ends.
+     */
+    public void setDragListener(DragListener l) {
+        mListener = l;
+    }
+
+    /**
+     * Remove a previously installed drag listener.
+     */
+    public void removeDragListener(DragListener l) {
+        mListener = null;
+    }
+
+    /**
+     * Add a DropTarget to the list of potential places to receive drop events.
+     */
+    public void addDropTarget(DropTarget target) {
+        mDropTargets.add(target);
+    }
+
+    /**
+     * Don't send drop events to <em>target</em> any more.
+     */
+    public void removeDropTarget(DropTarget target) {
+        mDropTargets.remove(target);
+    }
+
+    /**
+     * Set which view scrolls for touch events near the edge of the screen.
+     */
+    public void setScrollView(View v) {
+        mScrollView = v;
+    }
+
+    /**
+     * Specifies the delete region.  We won't scroll on touch events over the delete region.
+     *
+     * @param region The rectangle in screen coordinates of the delete region.
+     */
+    void setDeleteRegion(RectF region) {
+        mDeleteRegion = region;
+    }
+
+    private class ScrollRunnable implements Runnable {
+        private int mDirection;
+
+        ScrollRunnable() {
+        }
+
+        public void run() {
+            if (mDragScroller != null) {
+                if (mDirection == SCROLL_LEFT) {
+                    mDragScroller.scrollLeft();
+                } else {
+                    mDragScroller.scrollRight();
+                }
+                mScrollState = SCROLL_OUTSIDE_ZONE;
+            }
+        }
+
+        void setDirection(int direction) {
+            mDirection = direction;
+        }
+    }
+}
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
new file mode 100644
index 0000000..7ae9891
--- /dev/null
+++ b/src/com/android/launcher2/DragLayer.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.KeyEvent;
+import android.widget.FrameLayout;
+
+/**
+ * A ViewGroup that coordinated dragging across its dscendants
+ */
+public class DragLayer extends FrameLayout {
+    DragController mDragController;
+
+    /**
+     * Used to create a new DragLayer from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attribtues set containing the Workspace's customization values.
+     */
+    public DragLayer(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public void setDragController(DragController controller) {
+        mDragController = controller;
+    }
+    
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        return mDragController.dispatchKeyEvent(event) || super.dispatchKeyEvent(event);
+    }
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        return mDragController.onInterceptTouchEvent(ev);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent ev) {
+        return mDragController.onTouchEvent(ev);
+    }
+}
diff --git a/src/com/android/launcher2/DragScroller.java b/src/com/android/launcher2/DragScroller.java
new file mode 100644
index 0000000..c3c251c
--- /dev/null
+++ b/src/com/android/launcher2/DragScroller.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+/**
+ * Handles scrolling while dragging
+ *
+ */
+public interface DragScroller {
+    void scrollLeft();
+    void scrollRight();
+}
diff --git a/src/com/android/launcher2/DragSource.java b/src/com/android/launcher2/DragSource.java
new file mode 100644
index 0000000..7c6ca58
--- /dev/null
+++ b/src/com/android/launcher2/DragSource.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.view.View;
+
+/**
+ * Interface defining an object that can originate a drag.
+ *
+ */
+public interface DragSource {
+    void setDragController(DragController dragger);
+    void onDropCompleted(View target, boolean success);
+}
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java
new file mode 100644
index 0000000..7a86273
--- /dev/null
+++ b/src/com/android/launcher2/DragView.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.PixelFormat;
+import android.graphics.Point;
+import android.os.IBinder;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.KeyEvent;
+import android.view.WindowManager;
+import android.view.WindowManagerImpl;
+
+public class DragView extends View implements TweenCallback {
+    // Number of pixels to add to the dragged item for scaling.  Should be even for pixel alignment.
+    private static final int DRAG_SCALE = 24;
+
+    private Bitmap mBitmap;
+    private Paint mPaint;
+    private int mRegistrationX;
+    private int mRegistrationY;
+
+    SymmetricalLinearTween mTween;
+    private float mScale;
+    private float mAnimationScale = 1.0f;
+
+    private WindowManager.LayoutParams mLayoutParams;
+    private WindowManager mWindowManager;
+
+    /**
+     * Construct the drag view.
+     * <p>
+     * The registration point is the point inside our view that the touch events should
+     * be centered upon.
+     *
+     * @param context A context
+     * @param bitmap The view that we're dragging around.  We scale it up when we draw it.
+     * @param registrationX The x coordinate of the registration point.
+     * @param registrationY The y coordinate of the registration point.
+     */
+    public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY,
+            int left, int top, int width, int height) {
+        super(context);
+
+        mWindowManager = WindowManagerImpl.getDefault();
+        
+        mTween = new SymmetricalLinearTween(false, 110 /*ms duration*/, this);
+
+        Matrix scale = new Matrix();
+        float scaleFactor = width;
+        scaleFactor = mScale = (scaleFactor + DRAG_SCALE) / scaleFactor;
+        scale.setScale(scaleFactor, scaleFactor);
+
+        mBitmap = Bitmap.createBitmap(bitmap, left, top, width, height, scale, true);
+
+        // The point in our scaled bitmap that the touch events are located
+        mRegistrationX = registrationX + (DRAG_SCALE / 2);
+        mRegistrationY = registrationY + (DRAG_SCALE / 2);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        setMeasuredDimension(mBitmap.getWidth(), mBitmap.getHeight());
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        if (false) {
+            // for debugging
+            Paint p = new Paint();
+            p.setStyle(Paint.Style.FILL);
+            p.setColor(0xaaffffff);
+            canvas.drawRect(0, 0, getWidth(), getHeight(), p);
+        }
+        float scale = mAnimationScale;
+        if (scale < 0.999f) { // allow for some float error
+            float width = mBitmap.getWidth();
+            float offset = (width-(width*scale))/2;
+            canvas.translate(offset, offset);
+            canvas.scale(scale, scale);
+        }
+        canvas.drawBitmap(mBitmap, 0.0f, 0.0f, mPaint);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        mBitmap.recycle();
+    }
+
+    public void onTweenValueChanged(float value, float oldValue) {
+        mAnimationScale = (1.0f+((mScale-1.0f)*value))/mScale;
+        invalidate();
+    }
+
+    public void onTweenStarted() {
+    }
+
+    public void onTweenFinished() {
+    }
+
+    public void setPaint(Paint paint) {
+        mPaint = paint;
+        invalidate();
+    }
+
+    /**
+     * Create a window containing this view and show it.
+     *
+     * @param windowToken obtained from v.getWindowToken() from one of your views
+     * @param touchX the x coordinate the user touched in screen coordinates
+     * @param touchY the y coordinate the user touched in screen coordinates
+     */
+    public void show(IBinder windowToken, int touchX, int touchY) {
+        WindowManager.LayoutParams lp;
+        int pixelFormat;
+
+        pixelFormat = PixelFormat.TRANSLUCENT;
+
+        lp = new WindowManager.LayoutParams(
+                ViewGroup.LayoutParams.WRAP_CONTENT,
+                ViewGroup.LayoutParams.WRAP_CONTENT,
+                touchX-mRegistrationX, touchY-mRegistrationY,
+                WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
+                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+                    | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
+                    /*| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM*/,
+                pixelFormat);
+//        lp.token = mStatusBarView.getWindowToken();
+        lp.gravity = Gravity.LEFT | Gravity.TOP;
+        lp.token = windowToken;
+        lp.setTitle("DragView");
+        mLayoutParams = lp;
+
+        mWindowManager.addView(this, lp);
+
+        mAnimationScale = 1.0f/mScale;
+        mTween.start(true);
+    }
+    
+    /**
+     * Move the window containing this view.
+     *
+     * @param touchX the x coordinate the user touched in screen coordinates
+     * @param touchY the y coordinate the user touched in screen coordinates
+     */
+    void move(int touchX, int touchY) {
+        WindowManager.LayoutParams lp = mLayoutParams;
+        lp.x = touchX - mRegistrationX;
+        lp.y = touchY - mRegistrationY;
+        mWindowManager.updateViewLayout(this, lp);
+    }
+
+    void remove() {
+        mWindowManager.removeView(this);
+    }
+}
+
diff --git a/src/com/android/launcher2/DropTarget.java b/src/com/android/launcher2/DropTarget.java
new file mode 100644
index 0000000..72eb330
--- /dev/null
+++ b/src/com/android/launcher2/DropTarget.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.graphics.Rect;
+
+/**
+ * Interface defining an object that can receive a drag.
+ *
+ */
+public interface DropTarget {
+
+    /**
+     * Handle an object being dropped on the DropTarget
+     * 
+     * @param source DragSource where the drag started
+     * @param x X coordinate of the drop location
+     * @param y Y coordinate of the drop location
+     * @param xOffset Horizontal offset with the object being dragged where the original
+     *          touch happened
+     * @param yOffset Vertical offset with the object being dragged where the original
+     *          touch happened
+     * @param dragView The DragView that's being dragged around on screen.
+     * @param dragInfo Data associated with the object being dragged
+     * 
+     */
+    void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo);
+    
+    void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo);
+
+    void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo);
+
+    void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo);
+
+    /**
+     * Check if a drop action can occur at, or near, the requested location.
+     * This may be called repeatedly during a drag, so any calls should return
+     * quickly.
+     * 
+     * @param source DragSource where the drag started
+     * @param x X coordinate of the drop location
+     * @param y Y coordinate of the drop location
+     * @param xOffset Horizontal offset with the object being dragged where the
+     *            original touch happened
+     * @param yOffset Vertical offset with the object being dragged where the
+     *            original touch happened
+     * @param dragView The DragView that's being dragged around on screen.
+     * @param dragInfo Data associated with the object being dragged
+     * @return True if the drop will be accepted, false otherwise.
+     */
+    boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo);
+
+    /**
+     * Estimate the surface area where this object would land if dropped at the
+     * given location.
+     * 
+     * @param source DragSource where the drag started
+     * @param x X coordinate of the drop location
+     * @param y Y coordinate of the drop location
+     * @param xOffset Horizontal offset with the object being dragged where the
+     *            original touch happened
+     * @param yOffset Vertical offset with the object being dragged where the
+     *            original touch happened
+     * @param dragView The DragView that's being dragged around on screen.
+     * @param dragInfo Data associated with the object being dragged
+     * @param recycle {@link Rect} object to be possibly recycled.
+     * @return Estimated area that would be occupied if object was dropped at
+     *         the given location. Should return null if no estimate is found,
+     *         or if this target doesn't provide estimations.
+     */
+    Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo, Rect recycle);
+
+    // These methods are implemented in Views
+    void getHitRect(Rect outRect);
+    void getLocationOnScreen(int[] loc);
+    int getLeft();
+    int getTop();
+}
diff --git a/src/com/android/launcher2/FastBitmapDrawable.java b/src/com/android/launcher2/FastBitmapDrawable.java
new file mode 100644
index 0000000..db2c01c
--- /dev/null
+++ b/src/com/android/launcher2/FastBitmapDrawable.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.graphics.drawable.Drawable;
+import android.graphics.PixelFormat;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+
+class FastBitmapDrawable extends Drawable {
+    private Bitmap mBitmap;
+
+    FastBitmapDrawable(Bitmap b) {
+        mBitmap = b;
+    }
+
+    @Override
+    public void draw(Canvas canvas) {
+        canvas.drawBitmap(mBitmap, 0.0f, 0.0f, null);
+    }
+
+    @Override
+    public int getOpacity() {
+        return PixelFormat.TRANSLUCENT;
+    }
+
+    @Override
+    public void setAlpha(int alpha) {
+    }
+
+    @Override
+    public void setColorFilter(ColorFilter cf) {
+    }
+
+    @Override
+    public int getIntrinsicWidth() {
+        return mBitmap.getWidth();
+    }
+
+    @Override
+    public int getIntrinsicHeight() {
+        return mBitmap.getHeight();
+    }
+
+    @Override
+    public int getMinimumWidth() {
+        return mBitmap.getWidth();
+    }
+
+    @Override
+    public int getMinimumHeight() {
+        return mBitmap.getHeight();
+    }
+
+    public Bitmap getBitmap() {
+        return mBitmap;
+    }
+}
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
new file mode 100644
index 0000000..4f66ad0
--- /dev/null
+++ b/src/com/android/launcher2/Folder.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.AbsListView;
+import android.widget.BaseAdapter;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.AdapterView.OnItemLongClickListener;
+
+/**
+ * Represents a set of icons chosen by the user or generated by the system.
+ */
+public class Folder extends LinearLayout implements DragSource, OnItemLongClickListener,
+        OnItemClickListener, OnClickListener, View.OnLongClickListener {
+
+    protected AbsListView mContent;
+    protected DragController mDragController;
+    
+    protected Launcher mLauncher;
+
+    protected Button mCloseButton;
+    
+    protected FolderInfo mInfo;
+    
+    /**
+     * Which item is being dragged
+     */
+    protected ApplicationInfo mDragItem;
+    private boolean mCloneInfo;
+
+    /**
+     * Used to inflate the Workspace from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attribtues set containing the Workspace's customization values.
+     */
+    public Folder(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        setAlwaysDrawnWithCacheEnabled(false);
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        mContent = (AbsListView) findViewById(R.id.folder_content);
+        mContent.setOnItemClickListener(this);
+        mContent.setOnItemLongClickListener(this);
+        
+        mCloseButton = (Button) findViewById(R.id.folder_close);
+        mCloseButton.setOnClickListener(this);
+        mCloseButton.setOnLongClickListener(this);
+    }
+    
+    public void onItemClick(AdapterView parent, View v, int position, long id) {
+        ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
+        mLauncher.startActivitySafely(app.intent);
+    }
+
+    public void onClick(View v) {
+        mLauncher.closeFolder(this);
+    }
+
+    public boolean onLongClick(View v) {
+        mLauncher.closeFolder(this);
+        mLauncher.showRenameDialog(mInfo);
+        return true;
+    }
+
+    public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
+        if (!view.isInTouchMode()) {
+            return false;
+        }
+
+        ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
+        if (mCloneInfo) {
+            app = new ApplicationInfo(app);
+        }
+
+        mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
+        mLauncher.closeFolder(this);
+        mDragItem = app;
+
+        return true;
+    }
+
+    void setCloneInfo(boolean cloneInfo) {
+        mCloneInfo = cloneInfo;
+    }
+
+    public void setDragController(DragController dragController) {
+        mDragController = dragController;
+    }
+
+    public void onDropCompleted(View target, boolean success) {
+    }
+
+    /**
+     * Sets the adapter used to populate the content area. The adapter must only
+     * contains ApplicationInfo items.
+     *
+     * @param adapter The list of applications to display in the folder.
+     */
+    void setContentAdapter(BaseAdapter adapter) {
+        mContent.setAdapter(adapter);
+    }
+
+    void notifyDataSetChanged() {
+        ((BaseAdapter) mContent.getAdapter()).notifyDataSetChanged();
+    }
+
+    void setLauncher(Launcher launcher) {
+        mLauncher = launcher;
+    }
+    
+    /**
+     * @return the FolderInfo object associated with this folder
+     */
+    FolderInfo getInfo() {
+        return mInfo;
+    }
+
+    // When the folder opens, we need to refresh the GridView's selection by
+    // forcing a layout
+    void onOpen() {
+        mContent.requestLayout();
+    }
+
+    void onClose() {
+        final Workspace workspace = mLauncher.getWorkspace();
+        workspace.getChildAt(workspace.getCurrentScreen()).requestFocus();
+    }
+
+    void bind(FolderInfo info) {
+        mInfo = info;
+        mCloseButton.setText(info.title);
+    }
+}
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
new file mode 100644
index 0000000..85fc3a7
--- /dev/null
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+/**
+ * An icon that can appear on in the workspace representing an {@link UserFolder}.
+ */
+public class FolderIcon extends BubbleTextView implements DropTarget {
+    private UserFolderInfo mInfo;
+    private Launcher mLauncher;
+    private Drawable mCloseIcon;
+    private Drawable mOpenIcon;
+
+    public FolderIcon(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public FolderIcon(Context context) {
+        super(context);
+    }
+
+    static FolderIcon fromXml(int resId, Launcher launcher, ViewGroup group,
+            UserFolderInfo folderInfo) {
+
+        FolderIcon icon = (FolderIcon) LayoutInflater.from(launcher).inflate(resId, group, false);
+
+        final Resources resources = launcher.getResources();
+        Drawable d = resources.getDrawable(R.drawable.ic_launcher_folder);
+        d = Utilities.createIconThumbnail(d, launcher);
+        icon.mCloseIcon = d;
+        icon.mOpenIcon = resources.getDrawable(R.drawable.ic_launcher_folder_open);
+        icon.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+        icon.setText(folderInfo.title);
+        icon.setTag(folderInfo);
+        icon.setOnClickListener(launcher);
+        icon.mInfo = folderInfo;
+        icon.mLauncher = launcher;
+        
+        return icon;
+    }
+
+    public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        final ItemInfo item = (ItemInfo) dragInfo;
+        final int itemType = item.itemType;
+        return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
+                itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT)
+                && item.container != mInfo.id;
+    }
+
+    public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo, Rect recycle) {
+        return null;
+    }
+
+    public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        final ApplicationInfo item = (ApplicationInfo) dragInfo;
+        // TODO: update open folder that is looking at this data
+        mInfo.add(item);
+        LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, 0, 0);
+    }
+
+    public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        setCompoundDrawablesWithIntrinsicBounds(null, mOpenIcon, null, null);
+    }
+
+    public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        setCompoundDrawablesWithIntrinsicBounds(null, mCloseIcon, null, null);
+    }
+}
diff --git a/src/com/android/launcher2/FolderInfo.java b/src/com/android/launcher2/FolderInfo.java
new file mode 100644
index 0000000..8732690
--- /dev/null
+++ b/src/com/android/launcher2/FolderInfo.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+
+/**
+ * Represents a folder containing shortcuts or apps.
+ */
+class FolderInfo extends ItemInfo {
+    
+    /**
+     * Whether this folder has been opened
+     */
+    boolean opened;
+
+    /**
+     * The folder name.
+     */
+    CharSequence title;
+}
diff --git a/src/com/android/launcher2/HandleView.java b/src/com/android/launcher2/HandleView.java
new file mode 100644
index 0000000..e07334e
--- /dev/null
+++ b/src/com/android/launcher2/HandleView.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.android.launcher2;
+
+import android.widget.ImageView;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.KeyEvent;
+import android.view.View;
+
+public class HandleView extends ImageView {
+    private static final int ORIENTATION_HORIZONTAL = 1;
+
+    private Launcher mLauncher;
+    private int mOrientation = ORIENTATION_HORIZONTAL;
+
+    public HandleView(Context context) {
+        super(context);
+    }
+
+    public HandleView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public HandleView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HandleView, defStyle, 0);
+        mOrientation = a.getInt(R.styleable.HandleView_direction, ORIENTATION_HORIZONTAL);
+        a.recycle();
+
+        setContentDescription(context.getString(R.string.all_apps_button_label));
+    }
+
+    @Override
+    public View focusSearch(int direction) {
+        View newFocus = super.focusSearch(direction);
+        if (newFocus == null && !mLauncher.isAllAppsVisible()) {
+            final Workspace workspace = mLauncher.getWorkspace();
+            workspace.dispatchUnhandledMove(null, direction);
+            return (mOrientation == ORIENTATION_HORIZONTAL && direction == FOCUS_DOWN) ?
+                    this : workspace;
+        }
+        return newFocus;
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN && mLauncher.isAllAppsVisible()) {
+            return false;
+        }
+        return super.onTouchEvent(ev);
+    }
+
+    private static boolean isDirectionKey(int keyCode) {
+        return keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
+                keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_UP;
+    }
+
+    void setLauncher(Launcher launcher) {
+        mLauncher = launcher;
+    }
+}
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
new file mode 100644
index 0000000..45ff24e
--- /dev/null
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ContentResolver;
+import android.database.Cursor;
+import android.widget.Toast;
+
+public class InstallShortcutReceiver extends BroadcastReceiver {
+    private static final String ACTION_INSTALL_SHORTCUT =
+            "com.android.launcher.action.INSTALL_SHORTCUT";
+
+    private final int[] mCoordinates = new int[2];
+
+    public void onReceive(Context context, Intent data) {
+        if (!ACTION_INSTALL_SHORTCUT.equals(data.getAction())) {
+            return;
+        }
+
+        int screen = Launcher.getScreen();
+
+        if (!installShortcut(context, data, screen)) {
+            // The target screen is full, let's try the other screens
+            for (int i = 0; i < Launcher.SCREEN_COUNT; i++) {
+                if (i != screen && installShortcut(context, data, i)) break;
+            }
+        }
+    }
+
+    private boolean installShortcut(Context context, Intent data, int screen) {
+        String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+
+        if (findEmptyCell(context, mCoordinates, screen)) {
+            CellLayout.CellInfo cell = new CellLayout.CellInfo();
+            cell.cellX = mCoordinates[0];
+            cell.cellY = mCoordinates[1];
+            cell.screen = screen;
+
+            Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
+
+            if (intent.getAction() == null) {
+                intent.setAction(Intent.ACTION_VIEW);
+            }
+
+            // By default, we allow for duplicate entries (located in
+            // different places)
+            boolean duplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true);
+            if (duplicate || !LauncherModel.shortcutExists(context, name, intent)) {
+                Launcher.addShortcut(context, data, cell, true);
+                Toast.makeText(context, context.getString(R.string.shortcut_installed, name),
+                        Toast.LENGTH_SHORT).show();
+            } else {
+                Toast.makeText(context, context.getString(R.string.shortcut_duplicate, name),
+                        Toast.LENGTH_SHORT).show();
+            }
+
+            return true;
+        } else {
+            Toast.makeText(context, context.getString(R.string.out_of_space),
+                    Toast.LENGTH_SHORT).show();
+        }
+
+        return false;
+    }
+
+    private static boolean findEmptyCell(Context context, int[] xy, int screen) {
+        final int xCount = Launcher.NUMBER_CELLS_X;
+        final int yCount = Launcher.NUMBER_CELLS_Y;
+
+        boolean[][] occupied = new boolean[xCount][yCount];
+
+        final ContentResolver cr = context.getContentResolver();
+        Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
+            new String[] { LauncherSettings.Favorites.CELLX, LauncherSettings.Favorites.CELLY,
+                    LauncherSettings.Favorites.SPANX, LauncherSettings.Favorites.SPANY },
+            LauncherSettings.Favorites.SCREEN + "=?",
+            new String[] { String.valueOf(screen) }, null);
+
+        final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
+        final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
+        final int spanXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SPANX);
+        final int spanYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SPANY);
+
+        try {
+            while (c.moveToNext()) {
+                int cellX = c.getInt(cellXIndex);
+                int cellY = c.getInt(cellYIndex);
+                int spanX = c.getInt(spanXIndex);
+                int spanY = c.getInt(spanYIndex);
+
+                for (int x = cellX; x < cellX + spanX && x < xCount; x++) {
+                    for (int y = cellY; y < cellY + spanY && y < yCount; y++) {
+                        occupied[x][y] = true;
+                    }
+                }
+            }
+        } catch (Exception e) {
+            return false;
+        } finally {
+            c.close();
+        }
+
+        return CellLayout.findVacantCell(xy, 1, 1, xCount, yCount, occupied);
+    }
+}
diff --git a/src/com/android/launcher2/ItemInfo.java b/src/com/android/launcher2/ItemInfo.java
new file mode 100644
index 0000000..f04880d
--- /dev/null
+++ b/src/com/android/launcher2/ItemInfo.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import android.content.ContentValues;
+import android.graphics.Bitmap;
+import android.util.Log;
+
+/**
+ * Represents an item in the launcher.
+ */
+class ItemInfo {
+    
+    static final int NO_ID = -1;
+    
+    /**
+     * The id in the settings database for this item
+     */
+    long id = NO_ID;
+    
+    /**
+     * One of {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION},
+     * {@link LauncherSettings.Favorites#ITEM_TYPE_SHORTCUT},
+     * {@link LauncherSettings.Favorites#ITEM_TYPE_USER_FOLDER}, or
+     * {@link LauncherSettings.Favorites#ITEM_TYPE_APPWIDGET}.
+     */
+    int itemType;
+    
+    /**
+     * The id of the container that holds this item. For the desktop, this will be 
+     * {@link LauncherSettings.Favorites#CONTAINER_DESKTOP}. For the all applications folder it
+     * will be {@link #NO_ID} (since it is not stored in the settings DB). For user folders
+     * it will be the id of the folder.
+     */
+    long container = NO_ID;
+    
+    /**
+     * Iindicates the screen in which the shortcut appears.
+     */
+    int screen = -1;
+    
+    /**
+     * Indicates the X position of the associated cell.
+     */
+    int cellX = -1;
+
+    /**
+     * Indicates the Y position of the associated cell.
+     */
+    int cellY = -1;
+
+    /**
+     * Indicates the X cell span.
+     */
+    int spanX = 1;
+
+    /**
+     * Indicates the Y cell span.
+     */
+    int spanY = 1;
+
+    /**
+     * Indicates whether the item is a gesture.
+     */
+    boolean isGesture = false;
+
+    ItemInfo() {
+    }
+
+    ItemInfo(ItemInfo info) {
+        id = info.id;
+        cellX = info.cellX;
+        cellY = info.cellY;
+        spanX = info.spanX;
+        spanY = info.spanY;
+        screen = info.screen;
+        itemType = info.itemType;
+        container = info.container;
+    }
+
+    /**
+     * Write the fields of this item to the DB
+     * 
+     * @param values
+     */
+    void onAddToDatabase(ContentValues values) { 
+        values.put(LauncherSettings.BaseLauncherColumns.ITEM_TYPE, itemType);
+        if (!isGesture) {
+            values.put(LauncherSettings.Favorites.CONTAINER, container);
+            values.put(LauncherSettings.Favorites.SCREEN, screen);
+            values.put(LauncherSettings.Favorites.CELLX, cellX);
+            values.put(LauncherSettings.Favorites.CELLY, cellY);
+            values.put(LauncherSettings.Favorites.SPANX, spanX);
+            values.put(LauncherSettings.Favorites.SPANY, spanY);
+        }
+    }
+
+    static void writeBitmap(ContentValues values, Bitmap bitmap) {
+        if (bitmap != null) {
+            // Try go guesstimate how much space the icon will take when serialized
+            // to avoid unnecessary allocations/copies during the write.
+            int size = bitmap.getWidth() * bitmap.getHeight() * 4;
+            ByteArrayOutputStream out = new ByteArrayOutputStream(size);
+            try {
+                bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
+                out.flush();
+                out.close();
+
+                values.put(LauncherSettings.Favorites.ICON, out.toByteArray());
+            } catch (IOException e) {
+                Log.w("Favorite", "Could not write icon");
+            }
+        }
+    }
+    
+    void unbind() {
+    }
+}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
new file mode 100644
index 0000000..45545db
--- /dev/null
+++ b/src/com/android/launcher2/Launcher.java
@@ -0,0 +1,2272 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.ISearchManager;
+import android.app.SearchManager;
+import android.app.StatusBarManager;
+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;
+import android.graphics.Bitmap;
+import android.graphics.Rect;
+import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Parcelable;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.SystemProperties;
+import android.provider.LiveFolders;
+import android.text.Selection;
+import android.text.SpannableStringBuilder;
+import android.text.TextUtils;
+import android.text.method.TextKeyListener;
+import android.util.Log;
+import android.view.Display;
+import android.view.HapticFeedbackConstants;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnLongClickListener;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.ImageView;
+import android.widget.PopupWindow;
+import android.widget.LinearLayout;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.io.DataOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.DataInputStream;
+
+/**
+ * Default launcher application.
+ */
+public final class Launcher extends Activity
+        implements View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks {
+    static final String TAG = "Launcher";
+    static final boolean LOGD = false;
+
+    static final boolean PROFILE_STARTUP = false;
+    static final boolean PROFILE_ROTATE = false;
+    static final boolean DEBUG_USER_INTERFACE = false;
+
+    private static final int WALLPAPER_SCREENS_SPAN = 2;
+
+    private static final int MENU_GROUP_ADD = 1;
+    private static final int MENU_ADD = Menu.FIRST + 1;
+    private static final int MENU_WALLPAPER_SETTINGS = MENU_ADD + 1;
+    private static final int MENU_SEARCH = MENU_WALLPAPER_SETTINGS + 1;
+    private static final int MENU_NOTIFICATIONS = MENU_SEARCH + 1;
+    private static final int MENU_SETTINGS = MENU_NOTIFICATIONS + 1;
+
+    private static final int REQUEST_CREATE_SHORTCUT = 1;
+    private static final int REQUEST_CREATE_LIVE_FOLDER = 4;
+    private static final int REQUEST_CREATE_APPWIDGET = 5;
+    private static final int REQUEST_PICK_APPLICATION = 6;
+    private static final int REQUEST_PICK_SHORTCUT = 7;
+    private static final int REQUEST_PICK_LIVE_FOLDER = 8;
+    private static final int REQUEST_PICK_APPWIDGET = 9;
+    private static final int REQUEST_PICK_WALLPAPER = 10;
+
+    static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
+
+    static final String EXTRA_CUSTOM_WIDGET = "custom_widget";
+    static final String SEARCH_WIDGET = "search_widget";
+
+    static final int SCREEN_COUNT = 5;
+    static final int DEFAULT_SCREEN = 2;
+    static final int NUMBER_CELLS_X = 4;
+    static final int NUMBER_CELLS_Y = 4;
+
+    static final int DIALOG_CREATE_SHORTCUT = 1;
+    static final int DIALOG_RENAME_FOLDER = 2;
+
+    private static final String PREFERENCES = "launcher.preferences";
+
+    // Type: int
+    private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
+    // Type: boolean
+    private static final String RUNTIME_STATE_ALL_APPS_FOLDER = "launcher.all_apps_folder";
+    // Type: long
+    private static final String RUNTIME_STATE_USER_FOLDERS = "launcher.user_folder";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_SCREEN = "launcher.add_screen";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_CELL_X = "launcher.add_cellX";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_CELL_Y = "launcher.add_cellY";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_SPAN_X = "launcher.add_spanX";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_SPAN_Y = "launcher.add_spanY";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_COUNT_X = "launcher.add_countX";
+    // Type: int
+    private static final String RUNTIME_STATE_PENDING_ADD_COUNT_Y = "launcher.add_countY";
+    // Type: int[]
+    private static final String RUNTIME_STATE_PENDING_ADD_OCCUPIED_CELLS = "launcher.add_occupied_cells";
+    // Type: boolean
+    private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME = "launcher.rename_folder";
+    // Type: long
+    private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME_ID = "launcher.rename_folder_id";
+
+    static final int APPWIDGET_HOST_ID = 1024;
+
+    private static final Object sLock = new Object();
+    private static int sScreen = DEFAULT_SCREEN;
+
+    private final BroadcastReceiver mCloseSystemDialogsReceiver
+            = new CloseSystemDialogsIntentReceiver();
+    private final ContentObserver mWidgetObserver = new AppWidgetResetObserver();
+
+    private LayoutInflater mInflater;
+
+    private DragController mDragController;
+    private Workspace mWorkspace;
+
+    private AppWidgetManager mAppWidgetManager;
+    private LauncherAppWidgetHost mAppWidgetHost;
+
+    private CellLayout.CellInfo mAddItemCellInfo;
+    private CellLayout.CellInfo mMenuAddInfo;
+    private final int[] mCellCoordinates = new int[2];
+    private FolderInfo mFolderInfo;
+
+    private DeleteZone mDeleteZone;
+    private HandleView mHandleView;
+    private AllAppsView mAllAppsGrid;
+
+    private Bundle mSavedState;
+
+    private SpannableStringBuilder mDefaultKeySsb = null;
+
+    private boolean mIsNewIntent;
+
+    private boolean mWorkspaceLoading = true;
+
+    private boolean mPaused = true;
+    private boolean mRestoring;
+    private boolean mWaitingForResult;
+
+    private Bundle mSavedInstanceState;
+
+    private LauncherModel mModel;
+
+    private ArrayList<ItemInfo> mDesktopItems = new ArrayList<ItemInfo>();
+    private static HashMap<Long, FolderInfo> mFolders = new HashMap<Long, FolderInfo>();
+
+    private ImageView mPreviousView;
+    private ImageView mNextView;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        mModel = ((LauncherApplication)getApplication()).setLauncher(this);
+        mDragController = new DragController(this);
+        mInflater = getLayoutInflater();
+
+        mAppWidgetManager = AppWidgetManager.getInstance(this);
+        mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
+        mAppWidgetHost.startListening();
+
+        if (PROFILE_STARTUP) {
+            android.os.Debug.startMethodTracing("/sdcard/launcher");
+        }
+
+        checkForLocaleChange();
+        setWallpaperDimension();
+
+        setContentView(R.layout.launcher);
+        setupViews();
+
+        registerContentObservers();
+
+        lockAllApps();
+
+        mSavedState = savedInstanceState;
+        restoreState(mSavedState);
+
+        if (PROFILE_STARTUP) {
+            android.os.Debug.stopMethodTracing();
+        }
+
+        // We have a new AllAppsView, we need to re-bind everything, and it could have
+        // changed in our absence.
+        mModel.setAllAppsDirty();
+        mModel.setWorkspaceDirty();
+
+        if (!mRestoring) {
+            mModel.startLoader(this, true);
+        }
+
+        // For handling default keys
+        mDefaultKeySsb = new SpannableStringBuilder();
+        Selection.setSelection(mDefaultKeySsb, 0);
+
+        IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+        registerReceiver(mCloseSystemDialogsReceiver, filter);
+    }
+
+    private void checkForLocaleChange() {
+        final LocaleConfiguration localeConfiguration = new LocaleConfiguration();
+        readConfiguration(this, localeConfiguration);
+
+        final Configuration configuration = getResources().getConfiguration();
+
+        final String previousLocale = localeConfiguration.locale;
+        final String locale = configuration.locale.toString();
+
+        final int previousMcc = localeConfiguration.mcc;
+        final int mcc = configuration.mcc;
+
+        final int previousMnc = localeConfiguration.mnc;
+        final int mnc = configuration.mnc;
+
+        boolean localeChanged = !locale.equals(previousLocale) || mcc != previousMcc || mnc != previousMnc;
+
+        if (localeChanged) {
+            localeConfiguration.locale = locale;
+            localeConfiguration.mcc = mcc;
+            localeConfiguration.mnc = mnc;
+
+            writeConfiguration(this, localeConfiguration);
+            AppInfoCache.flush();
+        }
+    }
+
+    private static class LocaleConfiguration {
+        public String locale;
+        public int mcc = -1;
+        public int mnc = -1;
+    }
+
+    private static void readConfiguration(Context context, LocaleConfiguration configuration) {
+        DataInputStream in = null;
+        try {
+            in = new DataInputStream(context.openFileInput(PREFERENCES));
+            configuration.locale = in.readUTF();
+            configuration.mcc = in.readInt();
+            configuration.mnc = in.readInt();
+        } catch (FileNotFoundException e) {
+            // Ignore
+        } catch (IOException e) {
+            // Ignore
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                    // Ignore
+                }
+            }
+        }
+    }
+
+    private static void writeConfiguration(Context context, LocaleConfiguration configuration) {
+        DataOutputStream out = null;
+        try {
+            out = new DataOutputStream(context.openFileOutput(PREFERENCES, MODE_PRIVATE));
+            out.writeUTF(configuration.locale);
+            out.writeInt(configuration.mcc);
+            out.writeInt(configuration.mnc);
+            out.flush();
+        } catch (FileNotFoundException e) {
+            // Ignore
+        } catch (IOException e) {
+            //noinspection ResultOfMethodCallIgnored
+            context.getFileStreamPath(PREFERENCES).delete();
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    // Ignore
+                }
+            }
+        }
+    }
+
+    static int getScreen() {
+        synchronized (sLock) {
+            return sScreen;
+        }
+    }
+
+    static void setScreen(int screen) {
+        synchronized (sLock) {
+            sScreen = screen;
+        }
+    }
+
+    private void setWallpaperDimension() {
+        WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
+
+        Display display = getWindowManager().getDefaultDisplay();
+        boolean isPortrait = display.getWidth() < display.getHeight();
+
+        final int width = isPortrait ? display.getWidth() : display.getHeight();
+        final int height = isPortrait ? display.getHeight() : display.getWidth();
+        wpm.suggestDesiredDimensions(width * WALLPAPER_SCREENS_SPAN, height);
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        mWaitingForResult = false;
+
+        // The pattern used here is that a user PICKs a specific application,
+        // which, depending on the target, might need to CREATE the actual target.
+
+        // For example, the user would PICK_SHORTCUT for "Music playlist", and we
+        // launch over to the Music app to actually CREATE_SHORTCUT.
+
+        if (resultCode == RESULT_OK && mAddItemCellInfo != null) {
+            switch (requestCode) {
+                case REQUEST_PICK_APPLICATION:
+                    completeAddApplication(this, data, mAddItemCellInfo);
+                    break;
+                case REQUEST_PICK_SHORTCUT:
+                    processShortcut(data, REQUEST_PICK_APPLICATION, REQUEST_CREATE_SHORTCUT);
+                    break;
+                case REQUEST_CREATE_SHORTCUT:
+                    completeAddShortcut(data, mAddItemCellInfo);
+                    break;
+                case REQUEST_PICK_LIVE_FOLDER:
+                    addLiveFolder(data);
+                    break;
+                case REQUEST_CREATE_LIVE_FOLDER:
+                    completeAddLiveFolder(data, mAddItemCellInfo);
+                    break;
+                case REQUEST_PICK_APPWIDGET:
+                    addAppWidget(data);
+                    break;
+                case REQUEST_CREATE_APPWIDGET:
+                    completeAddAppWidget(data, mAddItemCellInfo);
+                    break;
+                case REQUEST_PICK_WALLPAPER:
+                    // We just wanted the activity result here so we can clear mWaitingForResult
+                    break;
+            }
+        } else if ((requestCode == REQUEST_PICK_APPWIDGET ||
+                requestCode == REQUEST_CREATE_APPWIDGET) && resultCode == RESULT_CANCELED &&
+                data != null) {
+            // Clean up the appWidgetId if we canceled
+            int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+            if (appWidgetId != -1) {
+                mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+            }
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+
+        mPaused = false;
+
+        if (mRestoring) {
+            mWorkspaceLoading = true;
+            mModel.startLoader(this, true);
+            mRestoring = false;
+        }
+
+        // If this was a new intent (i.e., the mIsNewIntent flag got set to true by
+        // onNewIntent), then close the search dialog if needed, because it probably
+        // came from the user pressing 'home' (rather than, for example, pressing 'back').
+        if (mIsNewIntent) {
+            // Post to a handler so that this happens after the search dialog tries to open
+            // itself again.
+            mWorkspace.post(new Runnable() {
+                public void run() {
+                    stopSearch();
+                }
+            });
+        }
+
+        mIsNewIntent = false;
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        dismissPreview(mPreviousView);
+        dismissPreview(mNextView);
+        mDragController.cancelDrag();
+    }
+
+    @Override
+    public Object onRetainNonConfigurationInstance() {
+        // Flag the loader to stop early before switching
+        mModel.stopLoader();
+
+        if (PROFILE_ROTATE) {
+            android.os.Debug.startMethodTracing("/sdcard/launcher-rotate");
+        }
+        return null;
+    }
+
+    private boolean acceptFilter() {
+        final InputMethodManager inputManager = (InputMethodManager)
+                getSystemService(Context.INPUT_METHOD_SERVICE);
+        return !inputManager.isFullscreenMode();
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        boolean handled = super.onKeyDown(keyCode, event);
+        if (!handled && acceptFilter() && keyCode != KeyEvent.KEYCODE_ENTER) {
+            boolean gotKey = TextKeyListener.getInstance().onKeyDown(mWorkspace, mDefaultKeySsb,
+                    keyCode, event);
+            if (gotKey && mDefaultKeySsb != null && mDefaultKeySsb.length() > 0) {
+                // something usable has been typed - start a search
+                // the typed text will be retrieved and cleared by
+                // showSearchDialog()
+                // If there are multiple keystrokes before the search dialog takes focus,
+                // onSearchRequested() will be called for every keystroke,
+                // but it is idempotent, so it's fine.
+                return onSearchRequested();
+            }
+        }
+
+        return handled;
+    }
+
+    private String getTypedText() {
+        return mDefaultKeySsb.toString();
+    }
+
+    private void clearTypedText() {
+        mDefaultKeySsb.clear();
+        mDefaultKeySsb.clearSpans();
+        Selection.setSelection(mDefaultKeySsb, 0);
+    }
+
+    /**
+     * Restores the previous state, if it exists.
+     *
+     * @param savedState The previous state.
+     */
+    private void restoreState(Bundle savedState) {
+        if (savedState == null) {
+            return;
+        }
+
+        final boolean allApps = savedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
+        if (allApps) {
+            showAllApps(false);
+        }
+
+        final int currentScreen = savedState.getInt(RUNTIME_STATE_CURRENT_SCREEN, -1);
+        if (currentScreen > -1) {
+            mWorkspace.setCurrentScreen(currentScreen);
+        }
+
+        final int addScreen = savedState.getInt(RUNTIME_STATE_PENDING_ADD_SCREEN, -1);
+        if (addScreen > -1) {
+            mAddItemCellInfo = new CellLayout.CellInfo();
+            final CellLayout.CellInfo addItemCellInfo = mAddItemCellInfo;
+            addItemCellInfo.valid = true;
+            addItemCellInfo.screen = addScreen;
+            addItemCellInfo.cellX = savedState.getInt(RUNTIME_STATE_PENDING_ADD_CELL_X);
+            addItemCellInfo.cellY = savedState.getInt(RUNTIME_STATE_PENDING_ADD_CELL_Y);
+            addItemCellInfo.spanX = savedState.getInt(RUNTIME_STATE_PENDING_ADD_SPAN_X);
+            addItemCellInfo.spanY = savedState.getInt(RUNTIME_STATE_PENDING_ADD_SPAN_Y);
+            addItemCellInfo.findVacantCellsFromOccupied(
+                    savedState.getBooleanArray(RUNTIME_STATE_PENDING_ADD_OCCUPIED_CELLS),
+                    savedState.getInt(RUNTIME_STATE_PENDING_ADD_COUNT_X),
+                    savedState.getInt(RUNTIME_STATE_PENDING_ADD_COUNT_Y));
+            mRestoring = true;
+        }
+
+        boolean renameFolder = savedState.getBoolean(RUNTIME_STATE_PENDING_FOLDER_RENAME, false);
+        if (renameFolder) {
+            long id = savedState.getLong(RUNTIME_STATE_PENDING_FOLDER_RENAME_ID);
+            mFolderInfo = mModel.getFolderById(this, mFolders, id);
+            mRestoring = true;
+        }
+    }
+
+    /**
+     * Finds all the views we need and configure them properly.
+     */
+    private void setupViews() {
+        DragController dragController = mDragController;
+
+        DragLayer dragLayer = (DragLayer) findViewById(R.id.drag_layer);
+        dragLayer.setDragController(dragController);
+
+        mAllAppsGrid = (AllAppsView)dragLayer.findViewById(R.id.all_apps_view);
+        mAllAppsGrid.setLauncher(this);
+        mAllAppsGrid.setDragController(dragController);
+        mAllAppsGrid.setWillNotDraw(false); // We don't want a hole punched in our window.
+        // Manage focusability manually since this thing is always visible
+        mAllAppsGrid.setFocusable(false); 
+
+        mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
+        final Workspace workspace = mWorkspace;
+
+        DeleteZone deleteZone = (DeleteZone) dragLayer.findViewById(R.id.delete_zone);
+        mDeleteZone = deleteZone;
+
+        mHandleView = (HandleView) findViewById(R.id.all_apps_button);
+        mHandleView.setLauncher(this);
+        mHandleView.setOnClickListener(this);
+
+        mPreviousView = (ImageView) dragLayer.findViewById(R.id.previous_screen);
+        mNextView = (ImageView) dragLayer.findViewById(R.id.next_screen);
+
+        Drawable previous = mPreviousView.getDrawable();
+        Drawable next = mNextView.getDrawable();
+        mWorkspace.setIndicators(previous, next);
+
+        mPreviousView.setHapticFeedbackEnabled(false);
+        mPreviousView.setOnLongClickListener(this);
+        mNextView.setHapticFeedbackEnabled(false);
+        mNextView.setOnLongClickListener(this);
+
+        workspace.setOnLongClickListener(this);
+        workspace.setDragController(dragController);
+        workspace.setLauncher(this);
+
+        deleteZone.setLauncher(this);
+        deleteZone.setDragController(dragController);
+        deleteZone.setHandle(mHandleView);
+
+        dragController.setDragScoller(workspace);
+        dragController.setDragListener(deleteZone);
+        dragController.setScrollView(dragLayer);
+
+        // The order here is bottom to top.
+        dragController.addDropTarget(workspace);
+        dragController.addDropTarget(deleteZone);
+    }
+
+    @SuppressWarnings({"UnusedDeclaration"})
+    public void previousScreen(View v) {
+        if (!isAllAppsVisible()) {
+            mWorkspace.scrollLeft();
+        }
+    }
+
+    @SuppressWarnings({"UnusedDeclaration"})
+    public void nextScreen(View v) {
+        if (!isAllAppsVisible()) {
+            mWorkspace.scrollRight();
+        }
+    }
+    
+    /**
+     * Creates a view representing a shortcut.
+     *
+     * @param info The data structure describing the shortcut.
+     *
+     * @return A View inflated from R.layout.application.
+     */
+    View createShortcut(ApplicationInfo info) {
+        return createShortcut(R.layout.application,
+                (ViewGroup) mWorkspace.getChildAt(mWorkspace.getCurrentScreen()), info);
+    }
+
+    /**
+     * Creates a view representing a shortcut inflated from the specified resource.
+     *
+     * @param layoutResId The id of the XML layout used to create the shortcut.
+     * @param parent The group the shortcut belongs to.
+     * @param info The data structure describing the shortcut.
+     *
+     * @return A View inflated from layoutResId.
+     */
+    View createShortcut(int layoutResId, ViewGroup parent, ApplicationInfo info) {
+        TextView favorite = (TextView) mInflater.inflate(layoutResId, parent, false);
+
+        if (info.icon == null) {
+            info.icon = AppInfoCache.getIconDrawable(getPackageManager(), info);
+        }
+        if (!info.filtered) {
+            info.icon = Utilities.createIconThumbnail(info.icon, this);
+            info.filtered = true;
+        }
+
+        favorite.setCompoundDrawablesWithIntrinsicBounds(null, info.icon, null, null);
+        favorite.setText(info.title);
+        favorite.setTag(info);
+        favorite.setOnClickListener(this);
+
+        return favorite;
+    }
+
+    /**
+     * Add an application shortcut to the workspace.
+     *
+     * @param data The intent describing the application.
+     * @param cellInfo The position on screen where to create the shortcut.
+     */
+    void completeAddApplication(Context context, Intent data, CellLayout.CellInfo cellInfo) {
+        cellInfo.screen = mWorkspace.getCurrentScreen();
+        if (!findSingleSlot(cellInfo)) return;
+
+        final ApplicationInfo info = infoFromApplicationIntent(context, data);
+        if (info != null) {
+            mWorkspace.addApplicationShortcut(info, cellInfo, isWorkspaceLocked());
+        }
+    }
+
+    private static ApplicationInfo infoFromApplicationIntent(Context context, Intent data) {
+        ComponentName component = data.getComponent();
+        PackageManager packageManager = context.getPackageManager();
+        ActivityInfo activityInfo = null;
+        try {
+            activityInfo = packageManager.getActivityInfo(component, 0 /* no flags */);
+        } catch (NameNotFoundException e) {
+            Log.e(TAG, "Couldn't find ActivityInfo for selected application", e);
+        }
+
+        if (activityInfo != null) {
+            ApplicationInfo itemInfo = new ApplicationInfo();
+
+            itemInfo.title = activityInfo.loadLabel(packageManager);
+            if (itemInfo.title == null) {
+                itemInfo.title = activityInfo.name;
+            }
+
+            itemInfo.setActivity(component, Intent.FLAG_ACTIVITY_NEW_TASK |
+                    Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+            itemInfo.icon = activityInfo.loadIcon(packageManager);
+            itemInfo.container = ItemInfo.NO_ID;
+
+            return itemInfo;
+        }
+
+        return null;
+    }
+
+    /**
+     * Add a shortcut to the workspace.
+     *
+     * @param data The intent describing the shortcut.
+     * @param cellInfo The position on screen where to create the shortcut.
+     */
+    private void completeAddShortcut(Intent data, CellLayout.CellInfo cellInfo) {
+        cellInfo.screen = mWorkspace.getCurrentScreen();
+        if (!findSingleSlot(cellInfo)) return;
+
+        final ApplicationInfo info = addShortcut(this, data, cellInfo, false);
+
+        if (!mRestoring) {
+            final View view = createShortcut(info);
+            mWorkspace.addInCurrentScreen(view, cellInfo.cellX, cellInfo.cellY, 1, 1,
+                    isWorkspaceLocked());
+        }
+    }
+
+
+    /**
+     * Add a widget to the workspace.
+     *
+     * @param data The intent describing the appWidgetId.
+     * @param cellInfo The position on screen where to create the widget.
+     */
+    private void completeAddAppWidget(Intent data, CellLayout.CellInfo cellInfo) {
+        Bundle extras = data.getExtras();
+        int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+
+        if (LOGD) Log.d(TAG, "dumping extras content=" + extras.toString());
+
+        AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
+
+        // Calculate the grid spans needed to fit this widget
+        CellLayout layout = (CellLayout) mWorkspace.getChildAt(cellInfo.screen);
+        int[] spans = layout.rectToCell(appWidgetInfo.minWidth, appWidgetInfo.minHeight);
+
+        // Try finding open space on Launcher screen
+        final int[] xy = mCellCoordinates;
+        if (!findSlot(cellInfo, xy, spans[0], spans[1])) {
+            if (appWidgetId != -1) mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+            return;
+        }
+
+        // Build Launcher-specific widget info and save to database
+        LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId);
+        launcherInfo.spanX = spans[0];
+        launcherInfo.spanY = spans[1];
+
+        LauncherModel.addItemToDatabase(this, launcherInfo,
+                LauncherSettings.Favorites.CONTAINER_DESKTOP,
+                mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
+
+        if (!mRestoring) {
+            mDesktopItems.add(launcherInfo);
+
+            // Perform actual inflation because we're live
+            launcherInfo.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
+
+            launcherInfo.hostView.setAppWidget(appWidgetId, appWidgetInfo);
+            launcherInfo.hostView.setTag(launcherInfo);
+
+            mWorkspace.addInCurrentScreen(launcherInfo.hostView, xy[0], xy[1],
+                    launcherInfo.spanX, launcherInfo.spanY, isWorkspaceLocked());
+        }
+    }
+
+    public void removeAppWidget(LauncherAppWidgetInfo launcherInfo) {
+        mDesktopItems.remove(launcherInfo);
+        launcherInfo.hostView = null;
+    }
+
+    public LauncherAppWidgetHost getAppWidgetHost() {
+        return mAppWidgetHost;
+    }
+
+    static ApplicationInfo addShortcut(Context context, Intent data,
+            CellLayout.CellInfo cellInfo, boolean notify) {
+
+        final ApplicationInfo info = infoFromShortcutIntent(context, data);
+        LauncherModel.addItemToDatabase(context, info, LauncherSettings.Favorites.CONTAINER_DESKTOP,
+                cellInfo.screen, cellInfo.cellX, cellInfo.cellY, notify);
+
+        return info;
+    }
+
+    private static ApplicationInfo infoFromShortcutIntent(Context context, Intent data) {
+        Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
+        String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+        Bitmap bitmap = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_ICON);
+
+        Drawable icon = null;
+        boolean filtered = false;
+        boolean customIcon = false;
+        ShortcutIconResource iconResource = null;
+
+        if (bitmap != null) {
+            icon = new FastBitmapDrawable(Utilities.createBitmapThumbnail(bitmap, context));
+            filtered = true;
+            customIcon = true;
+        } else {
+            Parcelable extra = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE);
+            if (extra != null && extra instanceof ShortcutIconResource) {
+                try {
+                    iconResource = (ShortcutIconResource) extra;
+                    final PackageManager packageManager = context.getPackageManager();
+                    Resources resources = packageManager.getResourcesForApplication(
+                            iconResource.packageName);
+                    final int id = resources.getIdentifier(iconResource.resourceName, null, null);
+                    icon = resources.getDrawable(id);
+                } catch (Exception e) {
+                    Log.w(TAG, "Could not load shortcut icon: " + extra);
+                }
+            }
+        }
+
+        if (icon == null) {
+            icon = context.getPackageManager().getDefaultActivityIcon();
+        }
+
+        final ApplicationInfo info = new ApplicationInfo();
+        info.icon = icon;
+        info.filtered = filtered;
+        info.title = name;
+        info.intent = intent;
+        info.customIcon = customIcon;
+        info.iconResource = iconResource;
+
+        return info;
+    }
+
+    void closeSystemDialogs() {
+        getWindow().closeAllPanels();
+
+        try {
+            dismissDialog(DIALOG_CREATE_SHORTCUT);
+            // Unlock the workspace if the dialog was showing
+        } catch (Exception e) {
+            // An exception is thrown if the dialog is not visible, which is fine
+        }
+
+        try {
+            dismissDialog(DIALOG_RENAME_FOLDER);
+            // Unlock the workspace if the dialog was showing
+        } catch (Exception e) {
+            // An exception is thrown if the dialog is not visible, which is fine
+        }
+
+        // Whatever we were doing is hereby canceled.
+        mWaitingForResult = false;
+    }
+
+    @Override
+    protected void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+
+        // Close the menu
+        if (Intent.ACTION_MAIN.equals(intent.getAction())) {
+            // also will cancel mWaitingForResult.
+            closeSystemDialogs();
+
+            // Set this flag so that onResume knows to close the search dialog if it's open,
+            // because this was a new intent (thus a press of 'home' or some such) rather than
+            // for example onResume being called when the user pressed the 'back' button.
+            mIsNewIntent = true;
+
+            boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
+                        != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
+            boolean allAppsVisible = isAllAppsVisible();
+            if (!mWorkspace.isDefaultScreenShowing()) {
+                mWorkspace.moveToDefaultScreen(alreadyOnHome && !allAppsVisible);
+            }
+            closeAllApps(alreadyOnHome && allAppsVisible);
+
+            final View v = getWindow().peekDecorView();
+            if (v != null && v.getWindowToken() != null) {
+                InputMethodManager imm = (InputMethodManager)getSystemService(
+                        INPUT_METHOD_SERVICE);
+                imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+            }
+        }
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Bundle savedInstanceState) {
+        // Do not call super here
+        mSavedInstanceState = savedInstanceState;
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentScreen());
+
+        final ArrayList<Folder> folders = mWorkspace.getOpenFolders();
+        if (folders.size() > 0) {
+            final int count = folders.size();
+            long[] ids = new long[count];
+            for (int i = 0; i < count; i++) {
+                final FolderInfo info = folders.get(i).getInfo();
+                ids[i] = info.id;
+            }
+            outState.putLongArray(RUNTIME_STATE_USER_FOLDERS, ids);
+        } else {
+            super.onSaveInstanceState(outState);
+        }
+
+        // TODO should not do this if the drawer is currently closing.
+        if (isAllAppsVisible()) {
+            outState.putBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, true);
+        }
+
+        if (mAddItemCellInfo != null && mAddItemCellInfo.valid && mWaitingForResult) {
+            final CellLayout.CellInfo addItemCellInfo = mAddItemCellInfo;
+            final CellLayout layout = (CellLayout) mWorkspace.getChildAt(addItemCellInfo.screen);
+
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_SCREEN, addItemCellInfo.screen);
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_CELL_X, addItemCellInfo.cellX);
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_CELL_Y, addItemCellInfo.cellY);
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_SPAN_X, addItemCellInfo.spanX);
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_SPAN_Y, addItemCellInfo.spanY);
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_COUNT_X, layout.getCountX());
+            outState.putInt(RUNTIME_STATE_PENDING_ADD_COUNT_Y, layout.getCountY());
+            outState.putBooleanArray(RUNTIME_STATE_PENDING_ADD_OCCUPIED_CELLS,
+                   layout.getOccupiedCells());
+        }
+
+        if (mFolderInfo != null && mWaitingForResult) {
+            outState.putBoolean(RUNTIME_STATE_PENDING_FOLDER_RENAME, true);
+            outState.putLong(RUNTIME_STATE_PENDING_FOLDER_RENAME_ID, mFolderInfo.id);
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+
+        try {
+            mAppWidgetHost.stopListening();
+        } catch (NullPointerException ex) {
+            Log.w(TAG, "problem while stopping AppWidgetHost during Launcher destruction", ex);
+        }
+
+        TextKeyListener.getInstance().release();
+
+        mModel.stopLoader();
+
+        unbindDesktopItems();
+        AppInfoCache.unbindDrawables();
+
+        getContentResolver().unregisterContentObserver(mWidgetObserver);
+        
+        dismissPreview(mPreviousView);
+        dismissPreview(mNextView);
+
+        unregisterReceiver(mCloseSystemDialogsReceiver);
+    }
+
+    @Override
+    public void startActivityForResult(Intent intent, int requestCode) {
+        if (requestCode >= 0) mWaitingForResult = true;
+        super.startActivityForResult(intent, requestCode);
+    }
+
+    @Override
+    public void startSearch(String initialQuery, boolean selectInitialQuery,
+            Bundle appSearchData, boolean globalSearch) {
+
+        closeAllApps(true);
+
+        // Slide the search widget to the top, if it's on the current screen,
+        // otherwise show the search dialog immediately.
+        Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
+        if (searchWidget == null) {
+            showSearchDialog(initialQuery, selectInitialQuery, appSearchData, globalSearch);
+        } else {
+            searchWidget.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
+            // show the currently typed text in the search widget while sliding
+            searchWidget.setQuery(getTypedText());
+        }
+    }
+
+    /**
+     * Show the search dialog immediately, without changing the search widget.
+     *
+     * @see Activity#startSearch(String, boolean, android.os.Bundle, boolean)
+     */
+    void showSearchDialog(String initialQuery, boolean selectInitialQuery,
+            Bundle appSearchData, boolean globalSearch) {
+
+        if (initialQuery == null) {
+            // Use any text typed in the launcher as the initial query
+            initialQuery = getTypedText();
+            clearTypedText();
+        }
+        if (appSearchData == null) {
+            appSearchData = new Bundle();
+            appSearchData.putString(SearchManager.SOURCE, "launcher-search");
+        }
+
+        final SearchManager searchManager =
+                (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+
+        final Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
+        if (searchWidget != null) {
+            // This gets called when the user leaves the search dialog to go back to
+            // the Launcher.
+            searchManager.setOnCancelListener(new SearchManager.OnCancelListener() {
+                public void onCancel() {
+                    searchManager.setOnCancelListener(null);
+                    stopSearch();
+                }
+            });
+        }
+
+        searchManager.startSearch(initialQuery, selectInitialQuery, getComponentName(),
+            appSearchData, globalSearch);
+    }
+
+    /**
+     * Cancel search dialog if it is open.
+     */
+    void stopSearch() {
+        // Close search dialog
+        SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+        searchManager.stopSearch();
+        // Restore search widget to its normal position
+        Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
+        if (searchWidget != null) {
+            searchWidget.stopSearch(false);
+        }
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        if (isWorkspaceLocked()) {
+            return false;
+        }
+
+        super.onCreateOptionsMenu(menu);
+        menu.add(MENU_GROUP_ADD, MENU_ADD, 0, R.string.menu_add)
+                .setIcon(android.R.drawable.ic_menu_add)
+                .setAlphabeticShortcut('A');
+        menu.add(0, MENU_WALLPAPER_SETTINGS, 0, R.string.menu_wallpaper)
+                 .setIcon(android.R.drawable.ic_menu_gallery)
+                 .setAlphabeticShortcut('W');
+        menu.add(0, MENU_SEARCH, 0, R.string.menu_search)
+                .setIcon(android.R.drawable.ic_search_category_default)
+                .setAlphabeticShortcut(SearchManager.MENU_KEY);
+        menu.add(0, MENU_NOTIFICATIONS, 0, R.string.menu_notifications)
+                .setIcon(com.android.internal.R.drawable.ic_menu_notifications)
+                .setAlphabeticShortcut('N');
+
+        final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);
+        settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+                Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+
+        menu.add(0, MENU_SETTINGS, 0, R.string.menu_settings)
+                .setIcon(android.R.drawable.ic_menu_preferences).setAlphabeticShortcut('P')
+                .setIntent(settings);
+
+        return true;
+    }
+
+    @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        super.onPrepareOptionsMenu(menu);
+
+        mMenuAddInfo = mWorkspace.findAllVacantCells(null);
+        menu.setGroupEnabled(MENU_GROUP_ADD, mMenuAddInfo != null && mMenuAddInfo.valid);
+
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case MENU_ADD:
+                addItems();
+                return true;
+            case MENU_WALLPAPER_SETTINGS:
+                startWallpaper();
+                return true;
+            case MENU_SEARCH:
+                onSearchRequested();
+                return true;
+            case MENU_NOTIFICATIONS:
+                showNotifications();
+                return true;
+        }
+
+        return super.onOptionsItemSelected(item);
+    }
+
+    /**
+     * Indicates that we want global search for this activity by setting the globalSearch
+     * argument for {@link #startSearch} to true.
+     */
+
+    @Override
+    public boolean onSearchRequested() {
+        startSearch(null, false, null, true);
+        return true;
+    }
+
+    public boolean isWorkspaceLocked() {
+        return mWorkspaceLoading || mWaitingForResult;
+    }
+
+    private void addItems() {
+        closeAllApps(true);
+        showAddDialog(mMenuAddInfo);
+    }
+
+    void addAppWidget(Intent data) {
+        // TODO: catch bad widget exception when sent
+        int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+
+        String customWidget = data.getStringExtra(EXTRA_CUSTOM_WIDGET);
+        if (SEARCH_WIDGET.equals(customWidget)) {
+            // We don't need this any more, since this isn't a real app widget.
+            mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+            // add the search widget
+            addSearch();
+        } else {
+            AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
+
+            if (appWidget.configure != null) {
+                // Launch over to configure widget, if needed
+                Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
+                intent.setComponent(appWidget.configure);
+                intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+
+                startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
+            } else {
+                // Otherwise just add it
+                onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data);
+            }
+        }
+    }
+
+    void addSearch() {
+        final Widget info = Widget.makeSearch();
+        final CellLayout.CellInfo cellInfo = mAddItemCellInfo;
+
+        final int[] xy = mCellCoordinates;
+        final int spanX = info.spanX;
+        final int spanY = info.spanY;
+
+        if (!findSlot(cellInfo, xy, spanX, spanY)) return;
+
+        LauncherModel.addItemToDatabase(this, info, LauncherSettings.Favorites.CONTAINER_DESKTOP,
+        mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
+
+        final View view = mInflater.inflate(info.layoutResource, null);
+        view.setTag(info);
+        Search search = (Search) view.findViewById(R.id.widget_search);
+        search.setLauncher(this);
+
+        mWorkspace.addInCurrentScreen(view, xy[0], xy[1], info.spanX, spanY);
+    }
+
+    void processShortcut(Intent intent, int requestCodeApplication, int requestCodeShortcut) {
+        // Handle case where user selected "Applications"
+        String applicationName = getResources().getString(R.string.group_applications);
+        String shortcutName = intent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+
+        if (applicationName != null && applicationName.equals(shortcutName)) {
+            Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
+            mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+
+            Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
+            pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);
+            startActivityForResult(pickIntent, requestCodeApplication);
+        } else {
+            startActivityForResult(intent, requestCodeShortcut);
+        }
+    }
+
+    void addLiveFolder(Intent intent) {
+        // Handle case where user selected "Folder"
+        String folderName = getResources().getString(R.string.group_folder);
+        String shortcutName = intent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+
+        if (folderName != null && folderName.equals(shortcutName)) {
+            addFolder();
+        } else {
+            startActivityForResult(intent, REQUEST_CREATE_LIVE_FOLDER);
+        }
+    }
+
+    void addFolder() {
+        UserFolderInfo folderInfo = new UserFolderInfo();
+        folderInfo.title = getText(R.string.folder_name);
+
+        CellLayout.CellInfo cellInfo = mAddItemCellInfo;
+        cellInfo.screen = mWorkspace.getCurrentScreen();
+        if (!findSingleSlot(cellInfo)) return;
+
+        // Update the model
+        LauncherModel.addItemToDatabase(this, folderInfo,
+                LauncherSettings.Favorites.CONTAINER_DESKTOP,
+                mWorkspace.getCurrentScreen(), cellInfo.cellX, cellInfo.cellY, false);
+        mFolders.put(folderInfo.id, folderInfo);
+
+        // Create the view
+        FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
+                (ViewGroup) mWorkspace.getChildAt(mWorkspace.getCurrentScreen()), folderInfo);
+        mWorkspace.addInCurrentScreen(newFolder,
+                cellInfo.cellX, cellInfo.cellY, 1, 1, isWorkspaceLocked());
+    }
+
+    void removeFolder(FolderInfo folder) {
+        mFolders.remove(folder.id);
+    }
+
+    private void completeAddLiveFolder(Intent data, CellLayout.CellInfo cellInfo) {
+        cellInfo.screen = mWorkspace.getCurrentScreen();
+        if (!findSingleSlot(cellInfo)) return;
+
+        final LiveFolderInfo info = addLiveFolder(this, data, cellInfo, false);
+
+        if (!mRestoring) {
+            final View view = LiveFolderIcon.fromXml(R.layout.live_folder_icon, this,
+                (ViewGroup) mWorkspace.getChildAt(mWorkspace.getCurrentScreen()), info);
+            mWorkspace.addInCurrentScreen(view, cellInfo.cellX, cellInfo.cellY, 1, 1,
+                    isWorkspaceLocked());
+        }
+    }
+
+    static LiveFolderInfo addLiveFolder(Context context, Intent data,
+            CellLayout.CellInfo cellInfo, boolean notify) {
+
+        Intent baseIntent = data.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT);
+        String name = data.getStringExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME);
+
+        Drawable icon = null;
+        boolean filtered = false;
+        Intent.ShortcutIconResource iconResource = null;
+
+        Parcelable extra = data.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON);
+        if (extra != null && extra instanceof Intent.ShortcutIconResource) {
+            try {
+                iconResource = (Intent.ShortcutIconResource) extra;
+                final PackageManager packageManager = context.getPackageManager();
+                Resources resources = packageManager.getResourcesForApplication(
+                        iconResource.packageName);
+                final int id = resources.getIdentifier(iconResource.resourceName, null, null);
+                icon = resources.getDrawable(id);
+            } catch (Exception e) {
+                Log.w(TAG, "Could not load live folder icon: " + extra);
+            }
+        }
+
+        if (icon == null) {
+            icon = context.getResources().getDrawable(R.drawable.ic_launcher_folder);
+        }
+
+        final LiveFolderInfo info = new LiveFolderInfo();
+        info.icon = icon;
+        info.filtered = filtered;
+        info.title = name;
+        info.iconResource = iconResource;
+        info.uri = data.getData();
+        info.baseIntent = baseIntent;
+        info.displayMode = data.getIntExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE,
+                LiveFolders.DISPLAY_MODE_GRID);
+
+        LauncherModel.addItemToDatabase(context, info, LauncherSettings.Favorites.CONTAINER_DESKTOP,
+                cellInfo.screen, cellInfo.cellX, cellInfo.cellY, notify);
+        mFolders.put(info.id, info);
+
+        return info;
+    }
+
+    private boolean findSingleSlot(CellLayout.CellInfo cellInfo) {
+        final int[] xy = new int[2];
+        if (findSlot(cellInfo, xy, 1, 1)) {
+            cellInfo.cellX = xy[0];
+            cellInfo.cellY = xy[1];
+            return true;
+        }
+        return false;
+    }
+
+    private boolean findSlot(CellLayout.CellInfo cellInfo, int[] xy, int spanX, int spanY) {
+        if (!cellInfo.findCellForSpan(xy, spanX, spanY)) {
+            boolean[] occupied = mSavedState != null ?
+                    mSavedState.getBooleanArray(RUNTIME_STATE_PENDING_ADD_OCCUPIED_CELLS) : null;
+            cellInfo = mWorkspace.findAllVacantCells(occupied);
+            if (!cellInfo.findCellForSpan(xy, spanX, spanY)) {
+                Toast.makeText(this, getString(R.string.out_of_space), Toast.LENGTH_SHORT).show();
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private void showNotifications() {
+        final StatusBarManager statusBar = (StatusBarManager) getSystemService(STATUS_BAR_SERVICE);
+        if (statusBar != null) {
+            statusBar.expand();
+        }
+    }
+
+    private void startWallpaper() {
+        closeAllApps(true);
+        final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
+        Intent chooser = Intent.createChooser(pickWallpaper,
+                getText(R.string.chooser_wallpaper));
+        // NOTE: Adds a configure option to the chooser if the wallpaper supports it
+        //       Removed in Eclair MR1
+//        WallpaperManager wm = (WallpaperManager)
+//                getSystemService(Context.WALLPAPER_SERVICE);
+//        WallpaperInfo wi = wm.getWallpaperInfo();
+//        if (wi != null && wi.getSettingsActivity() != null) {
+//            LabeledIntent li = new LabeledIntent(getPackageName(),
+//                    R.string.configure_wallpaper, 0);
+//            li.setClassName(wi.getPackageName(), wi.getSettingsActivity());
+//            chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { li });
+//        }
+        startActivityForResult(chooser, REQUEST_PICK_WALLPAPER);
+    }
+
+    /**
+     * Registers various content observers. The current implementation registers
+     * only a favorites observer to keep track of the favorites applications.
+     */
+    private void registerContentObservers() {
+        ContentResolver resolver = getContentResolver();
+        resolver.registerContentObserver(LauncherProvider.CONTENT_APPWIDGET_RESET_URI,
+                true, mWidgetObserver);
+    }
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        if (event.getAction() == KeyEvent.ACTION_DOWN) {
+            switch (event.getKeyCode()) {
+                case KeyEvent.KEYCODE_HOME:
+                    return true;
+                case KeyEvent.KEYCODE_VOLUME_DOWN:
+                    if (SystemProperties.getInt("debug.launcher2.dumpstate", 0) != 0) {
+                        dumpState();
+                        return true;
+                    }
+                    break;
+            }
+        } else if (event.getAction() == KeyEvent.ACTION_UP) {
+            switch (event.getKeyCode()) {
+                case KeyEvent.KEYCODE_HOME:
+                    return true;
+            }
+        }
+
+        return super.dispatchKeyEvent(event);
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (isAllAppsVisible()) {
+            closeAllApps(true);
+        } else {
+            closeFolder();
+        }
+        dismissPreview(mPreviousView);
+        dismissPreview(mNextView);
+    }
+
+    private void closeFolder() {
+        Folder folder = mWorkspace.getOpenFolder();
+        if (folder != null) {
+            closeFolder(folder);
+        }
+    }
+
+    void closeFolder(Folder folder) {
+        folder.getInfo().opened = false;
+        ViewGroup parent = (ViewGroup) folder.getParent();
+        if (parent != null) {
+            parent.removeView(folder);
+            if (folder instanceof DropTarget) {
+                // Live folders aren't DropTargets.
+                mDragController.removeDropTarget((DropTarget)folder);
+            }
+        }
+        folder.onClose();
+    }
+
+    /**
+     * Re-listen when widgets are reset.
+     */
+    private void onAppWidgetReset() {
+        mAppWidgetHost.startListening();
+    }
+
+    /**
+     * Go through the and disconnect any of the callbacks in the drawables and the views or we
+     * leak the previous Home screen on orientation change.
+     */
+    private void unbindDesktopItems() {
+        for (ItemInfo item: mDesktopItems) {
+            item.unbind();
+        }
+    }
+
+    /**
+     * Launches the intent referred by the clicked shortcut.
+     *
+     * @param v The view representing the clicked shortcut.
+     */
+    public void onClick(View v) {
+        Object tag = v.getTag();
+        if (tag instanceof ApplicationInfo) {
+            // Open shortcut
+            final Intent intent = ((ApplicationInfo) tag).intent;
+            int[] pos = new int[2];
+            v.getLocationOnScreen(pos);
+            intent.setSourceBounds(
+                    new Rect(pos[0], pos[1], pos[0]+v.getWidth(), pos[1]+v.getHeight()));
+            startActivitySafely(intent);
+        } else if (tag instanceof FolderInfo) {
+            handleFolderClick((FolderInfo) tag);
+        } else if (v == mHandleView) {
+            if (isAllAppsVisible()) {
+                closeAllApps(true);
+            } else {
+                showAllApps(true);
+            }
+        }
+    }
+
+    void startActivitySafely(Intent intent) {
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        try {
+            startActivity(intent);
+        } 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) {
+            // Close any open folder
+            closeFolder();
+            // Open the requested folder
+            openFolder(folderInfo);
+        } else {
+            // Find the open folder...
+            Folder openFolder = mWorkspace.getFolderForTag(folderInfo);
+            int folderScreen;
+            if (openFolder != null) {
+                folderScreen = mWorkspace.getScreenForView(openFolder);
+                // .. and close it
+                closeFolder(openFolder);
+                if (folderScreen != mWorkspace.getCurrentScreen()) {
+                    // Close any folder open on the current screen
+                    closeFolder();
+                    // Pull the folder onto this screen
+                    openFolder(folderInfo);
+                }
+            }
+        }
+    }
+
+    /**
+     * Opens the user fodler described by the specified tag. The opening of the folder
+     * is animated relative to the specified View. If the View is null, no animation
+     * is played.
+     *
+     * @param folderInfo The FolderInfo describing the folder to open.
+     */
+    private void openFolder(FolderInfo folderInfo) {
+        Folder openFolder;
+
+        if (folderInfo instanceof UserFolderInfo) {
+            openFolder = UserFolder.fromXml(this);
+        } else if (folderInfo instanceof LiveFolderInfo) {
+            openFolder = com.android.launcher2.LiveFolder.fromXml(this, folderInfo);
+        } else {
+            return;
+        }
+
+        openFolder.setDragController(mDragController);
+        openFolder.setLauncher(this);
+
+        openFolder.bind(folderInfo);
+        folderInfo.opened = true;
+
+        mWorkspace.addInScreen(openFolder, folderInfo.screen, 0, 0, 4, 4);
+        openFolder.onOpen();
+    }
+
+    public boolean onLongClick(View v) {
+        switch (v.getId()) {
+            case R.id.previous_screen:
+                if (!isAllAppsVisible()) {
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    showPreviousPreview(v);
+                }
+                return true;
+            case R.id.next_screen:
+                if (!isAllAppsVisible()) {
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    showNextPreview(v);
+                }
+                return true;
+        }
+
+        if (isWorkspaceLocked()) {
+            return false;
+        }
+
+        if (!(v instanceof CellLayout)) {
+            v = (View) v.getParent();
+        }
+
+        CellLayout.CellInfo cellInfo = (CellLayout.CellInfo) v.getTag();
+
+        // This happens when long clicking an item with the dpad/trackball
+        if (cellInfo == null) {
+            return true;
+        }
+
+        if (mWorkspace.allowLongPress()) {
+            if (cellInfo.cell == null) {
+                if (cellInfo.valid) {
+                    // User long pressed on empty space
+                    mWorkspace.setAllowLongPress(false);
+                    showAddDialog(cellInfo);
+                }
+            } else {
+                if (!(cellInfo.cell instanceof Folder)) {
+                    // User long pressed on an item
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    mWorkspace.startDrag(cellInfo);
+                }
+            }
+        }
+        return true;
+    }
+
+    @SuppressWarnings({"unchecked"})
+    private void dismissPreview(final View v) {
+        final PopupWindow window = (PopupWindow) v.getTag();
+        if (window != null) {
+            window.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                public void onDismiss() {
+                    ViewGroup group = (ViewGroup) v.getTag(R.id.workspace);
+                    int count = group.getChildCount();
+                    for (int i = 0; i < count; i++) {
+                        ((ImageView) group.getChildAt(i)).setImageDrawable(null);
+                    }
+                    ArrayList<Bitmap> bitmaps = (ArrayList<Bitmap>) v.getTag(R.id.icon);
+                    for (Bitmap bitmap : bitmaps) bitmap.recycle();
+
+                    v.setTag(R.id.workspace, null);
+                    v.setTag(R.id.icon, null);
+                    window.setOnDismissListener(null);
+                }
+            });
+            window.dismiss();
+        }
+        v.setTag(null);
+    }
+
+    private void showPreviousPreview(View anchor) {
+        int current = mWorkspace.getCurrentScreen();
+        if (current <= 0) return;
+
+        showPreviews(anchor, 0, mWorkspace.getChildCount());
+    }
+
+    private void showNextPreview(View anchor) {
+        int current = mWorkspace.getCurrentScreen();
+        if (current >= mWorkspace.getChildCount() - 1) return;
+
+        showPreviews(anchor, 0, mWorkspace.getChildCount());        
+    }
+
+    private void showPreviews(final View anchor, int start, int end) {
+        Resources resources = getResources();
+
+        Workspace workspace = mWorkspace;
+        CellLayout cell = ((CellLayout) workspace.getChildAt(start));
+        
+        float max = workspace.getChildCount();
+        
+        Rect r = new Rect();
+        resources.getDrawable(R.drawable.preview_background).getPadding(r);
+        int extraW = (int) ((r.left + r.right) * max);
+        int extraH = r.top + r.bottom;
+
+        int aW = cell.getWidth() - extraW;
+        float w = aW / max;
+
+        int width = cell.getWidth();
+        int height = cell.getHeight();
+        int x = cell.getLeftPadding();
+        int y = cell.getTopPadding();
+        width -= (x + cell.getRightPadding());
+        height -= (y + cell.getBottomPadding());
+
+        float scale = w / width;
+
+        int count = end - start;
+
+        final float sWidth = width * scale;
+        float sHeight = height * scale;
+
+        LinearLayout preview = new LinearLayout(this);
+
+        PreviewTouchHandler handler = new PreviewTouchHandler(anchor);
+        ArrayList<Bitmap> bitmaps = new ArrayList<Bitmap>(count);
+
+        for (int i = start; i < end; i++) {
+            ImageView image = new ImageView(this);
+            cell = (CellLayout) workspace.getChildAt(i);
+
+            Bitmap bitmap = Bitmap.createBitmap((int) sWidth, (int) sHeight,
+                    Bitmap.Config.ARGB_8888);
+            
+            Canvas c = new Canvas(bitmap);
+            c.scale(scale, scale);
+            c.translate(-cell.getLeftPadding(), -cell.getTopPadding());
+            cell.dispatchDraw(c);
+
+            image.setBackgroundDrawable(resources.getDrawable(R.drawable.preview_background));
+            image.setImageBitmap(bitmap);
+            image.setTag(i);
+            image.setOnClickListener(handler);
+            image.setOnFocusChangeListener(handler);
+            image.setFocusable(true);
+            if (i == mWorkspace.getCurrentScreen()) image.requestFocus();
+
+            preview.addView(image,
+                    LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+
+            bitmaps.add(bitmap);            
+        }
+        
+        PopupWindow p = new PopupWindow(this);
+        p.setContentView(preview);
+        p.setWidth((int) (sWidth * count + extraW));
+        p.setHeight((int) (sHeight + extraH));
+        p.setAnimationStyle(R.style.AnimationPreview);
+        p.setOutsideTouchable(true);
+        p.setFocusable(true);
+        p.setBackgroundDrawable(new ColorDrawable(0));
+        p.showAsDropDown(anchor, 0, 0);
+
+        p.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            public void onDismiss() {
+                dismissPreview(anchor);
+            }
+        });
+
+        anchor.setTag(p);
+        anchor.setTag(R.id.workspace, preview);
+        anchor.setTag(R.id.icon, bitmaps);        
+    }
+
+    class PreviewTouchHandler implements View.OnClickListener, Runnable, View.OnFocusChangeListener {
+        private final View mAnchor;
+
+        public PreviewTouchHandler(View anchor) {
+            mAnchor = anchor;
+        }
+
+        public void onClick(View v) {
+            mWorkspace.snapToScreen((Integer) v.getTag());
+            v.post(this);
+        }
+
+        public void run() {
+            dismissPreview(mAnchor);            
+        }
+
+        public void onFocusChange(View v, boolean hasFocus) {
+            if (hasFocus) {
+                mWorkspace.snapToScreen((Integer) v.getTag());
+            }
+        }
+    }
+
+    View getDrawerHandle() {
+        return mHandleView;
+    }
+
+    Workspace getWorkspace() {
+        return mWorkspace;
+    }
+
+    @Override
+    protected Dialog onCreateDialog(int id) {
+        switch (id) {
+            case DIALOG_CREATE_SHORTCUT:
+                return new CreateShortcut().createDialog();
+            case DIALOG_RENAME_FOLDER:
+                return new RenameFolder().createDialog();
+        }
+
+        return super.onCreateDialog(id);
+    }
+
+    @Override
+    protected void onPrepareDialog(int id, Dialog dialog) {
+        switch (id) {
+            case DIALOG_CREATE_SHORTCUT:
+                break;
+            case DIALOG_RENAME_FOLDER:
+                if (mFolderInfo != null) {
+                    EditText input = (EditText) dialog.findViewById(R.id.folder_name);
+                    final CharSequence text = mFolderInfo.title;
+                    input.setText(text);
+                    input.setSelection(0, text.length());
+                }
+                break;
+        }
+    }
+
+    void showRenameDialog(FolderInfo info) {
+        mFolderInfo = info;
+        mWaitingForResult = true;
+        showDialog(DIALOG_RENAME_FOLDER);
+    }
+
+    private void showAddDialog(CellLayout.CellInfo cellInfo) {
+        mAddItemCellInfo = cellInfo;
+        mWaitingForResult = true;
+        showDialog(DIALOG_CREATE_SHORTCUT);
+    }
+
+    private void pickShortcut(int requestCode, int title) {
+        Bundle bundle = new Bundle();
+
+        ArrayList<String> shortcutNames = new ArrayList<String>();
+        shortcutNames.add(getString(R.string.group_applications));
+        bundle.putStringArrayList(Intent.EXTRA_SHORTCUT_NAME, shortcutNames);
+
+        ArrayList<ShortcutIconResource> shortcutIcons = new ArrayList<ShortcutIconResource>();
+        shortcutIcons.add(ShortcutIconResource.fromContext(Launcher.this,
+                        R.drawable.ic_launcher_application));
+        bundle.putParcelableArrayList(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, shortcutIcons);
+
+        Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
+        pickIntent.putExtra(Intent.EXTRA_INTENT, new Intent(Intent.ACTION_CREATE_SHORTCUT));
+        pickIntent.putExtra(Intent.EXTRA_TITLE, getText(title));
+        pickIntent.putExtras(bundle);
+
+        startActivityForResult(pickIntent, requestCode);
+    }
+
+    private class RenameFolder {
+        private EditText mInput;
+
+        Dialog createDialog() {
+            mWaitingForResult = true;
+            final View layout = View.inflate(Launcher.this, R.layout.rename_folder, null);
+            mInput = (EditText) layout.findViewById(R.id.folder_name);
+
+            AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this);
+            builder.setIcon(0);
+            builder.setTitle(getString(R.string.rename_folder_title));
+            builder.setCancelable(true);
+            builder.setOnCancelListener(new Dialog.OnCancelListener() {
+                public void onCancel(DialogInterface dialog) {
+                    cleanup();
+                }
+            });
+            builder.setNegativeButton(getString(R.string.cancel_action),
+                new Dialog.OnClickListener() {
+                    public void onClick(DialogInterface dialog, int which) {
+                        cleanup();
+                    }
+                }
+            );
+            builder.setPositiveButton(getString(R.string.rename_action),
+                new Dialog.OnClickListener() {
+                    public void onClick(DialogInterface dialog, int which) {
+                        changeFolderName();
+                    }
+                }
+            );
+            builder.setView(layout);
+
+            final AlertDialog dialog = builder.create();
+            dialog.setOnShowListener(new DialogInterface.OnShowListener() {
+                public void onShow(DialogInterface dialog) {
+                    mInput.requestFocus();
+                    InputMethodManager inputManager = (InputMethodManager)
+                            getSystemService(Context.INPUT_METHOD_SERVICE);
+                    inputManager.showSoftInput(mInput, 0);
+                }
+            });
+
+            return dialog;
+        }
+
+        private void changeFolderName() {
+            final String name = mInput.getText().toString();
+            if (!TextUtils.isEmpty(name)) {
+                // Make sure we have the right folder info
+                mFolderInfo = mFolders.get(mFolderInfo.id);
+                mFolderInfo.title = name;
+                LauncherModel.updateItemInDatabase(Launcher.this, mFolderInfo);
+
+                if (mWorkspaceLoading) {
+                    lockAllApps();
+                    mModel.setWorkspaceDirty();
+                    mModel.startLoader(Launcher.this, false);
+                } else {
+                    final FolderIcon folderIcon = (FolderIcon)
+                            mWorkspace.getViewForTag(mFolderInfo);
+                    if (folderIcon != null) {
+                        folderIcon.setText(name);
+                        getWorkspace().requestLayout();
+                    } else {
+                        lockAllApps();
+                        mModel.setWorkspaceDirty();
+                        mWorkspaceLoading = true;
+                        mModel.startLoader(Launcher.this, false);
+                    }
+                }
+            }
+            cleanup();
+        }
+
+        private void cleanup() {
+            dismissDialog(DIALOG_RENAME_FOLDER);
+            mWaitingForResult = false;
+            mFolderInfo = null;
+        }
+    }
+
+    boolean isAllAppsVisible() {
+        return mAllAppsGrid.isVisible();
+    }
+
+    boolean isAllAppsOpaque() {
+        return mAllAppsGrid.isOpaque();
+    }
+
+    void showAllApps(boolean animated) {
+        mAllAppsGrid.zoom(1.0f, animated);
+        //mWorkspace.hide();
+
+        mWorkspace.startFading(false);
+
+        mAllAppsGrid.setFocusable(true);
+        mAllAppsGrid.requestFocus();
+        
+        // TODO: fade these two too
+        mDeleteZone.setVisibility(View.GONE);
+        //mHandleView.setVisibility(View.GONE);
+    }
+
+    /**
+     * Things to test when changing this code.
+     *   - Home from workspace
+     *          - from center screen
+     *          - from other screens
+     *   - Home from all apps
+     *          - from center screen
+     *          - from other screens
+     *   - Back from all apps
+     *          - from center screen
+     *          - from other screens
+     *   - Launch app from workspace and quit
+     *          - with back
+     *          - with home
+     *   - Launch app from all apps and quit
+     *          - with back
+     *          - with home
+     *   - Go to a screen that's not the default, then all
+     *     apps, and launch and app, and go back
+     *          - with back
+     *          -with home
+     *   - On workspace, long press power and go back
+     *          - with back
+     *          - with home
+     *   - On all apps, long press power and go back
+     *          - with back
+     *          - with home
+     *   - On workspace, power off
+     *   - On all apps, power off
+     *   - Launch an app and turn off the screen while in that app
+     *          - Go back with home key
+     *          - Go back with back key  TODO: make this not go to workspace
+     *          - From all apps
+     *          - From workspace
+     */
+    void closeAllApps(boolean animated) {
+        if (mAllAppsGrid.isVisible()) {
+            mAllAppsGrid.zoom(0.0f, animated);
+            mAllAppsGrid.setFocusable(false);
+            mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
+            mWorkspace.startFading(true);
+
+            // TODO: fade these two too
+            /*
+            mDeleteZone.setVisibility(View.VISIBLE);
+            mHandleView.setVisibility(View.VISIBLE);
+            */
+        }
+    }
+
+    void lockAllApps() {
+        // TODO
+    }
+
+    void unlockAllApps() {
+        // TODO
+    }
+
+    /**
+     * Displays the shortcut creation dialog and launches, if necessary, the
+     * appropriate activity.
+     */
+    private class CreateShortcut implements DialogInterface.OnClickListener,
+            DialogInterface.OnCancelListener, DialogInterface.OnDismissListener,
+            DialogInterface.OnShowListener {
+
+        private AddAdapter mAdapter;
+
+        Dialog createDialog() {
+            mWaitingForResult = true;
+
+            mAdapter = new AddAdapter(Launcher.this);
+
+            final AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this);
+            builder.setTitle(getString(R.string.menu_item_add_item));
+            builder.setAdapter(mAdapter, this);
+
+            builder.setInverseBackgroundForced(true);
+
+            AlertDialog dialog = builder.create();
+            dialog.setOnCancelListener(this);
+            dialog.setOnDismissListener(this);
+            dialog.setOnShowListener(this);
+
+            return dialog;
+        }
+
+        public void onCancel(DialogInterface dialog) {
+            mWaitingForResult = false;
+            cleanup();
+        }
+
+        public void onDismiss(DialogInterface dialog) {
+        }
+
+        private void cleanup() {
+            try {
+                dismissDialog(DIALOG_CREATE_SHORTCUT);
+            } catch (Exception e) {
+                // An exception is thrown if the dialog is not visible, which is fine
+            }
+        }
+
+        /**
+         * Handle the action clicked in the "Add to home" dialog.
+         */
+        public void onClick(DialogInterface dialog, int which) {
+            Resources res = getResources();
+            cleanup();
+
+            switch (which) {
+                case AddAdapter.ITEM_SHORTCUT: {
+                    // Insert extra item to handle picking application
+                    pickShortcut(REQUEST_PICK_SHORTCUT, R.string.title_select_shortcut);
+                    break;
+                }
+
+                case AddAdapter.ITEM_APPWIDGET: {
+                    int appWidgetId = Launcher.this.mAppWidgetHost.allocateAppWidgetId();
+
+                    Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
+                    pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+                    // add the search widget
+                    ArrayList<AppWidgetProviderInfo> customInfo =
+                            new ArrayList<AppWidgetProviderInfo>();
+                    AppWidgetProviderInfo info = new AppWidgetProviderInfo();
+                    info.provider = new ComponentName(getPackageName(), "XXX.YYY");
+                    info.label = getString(R.string.group_search);
+                    info.icon = R.drawable.ic_search_widget;
+                    customInfo.add(info);
+                    pickIntent.putParcelableArrayListExtra(
+                            AppWidgetManager.EXTRA_CUSTOM_INFO, customInfo);
+                    ArrayList<Bundle> customExtras = new ArrayList<Bundle>();
+                    Bundle b = new Bundle();
+                    b.putString(EXTRA_CUSTOM_WIDGET, SEARCH_WIDGET);
+                    customExtras.add(b);
+                    pickIntent.putParcelableArrayListExtra(
+                            AppWidgetManager.EXTRA_CUSTOM_EXTRAS, customExtras);
+                    // start the pick activity
+                    startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
+                    break;
+                }
+
+                case AddAdapter.ITEM_LIVE_FOLDER: {
+                    // Insert extra item to handle inserting folder
+                    Bundle bundle = new Bundle();
+
+                    ArrayList<String> shortcutNames = new ArrayList<String>();
+                    shortcutNames.add(res.getString(R.string.group_folder));
+                    bundle.putStringArrayList(Intent.EXTRA_SHORTCUT_NAME, shortcutNames);
+
+                    ArrayList<ShortcutIconResource> shortcutIcons =
+                            new ArrayList<ShortcutIconResource>();
+                    shortcutIcons.add(ShortcutIconResource.fromContext(Launcher.this,
+                            R.drawable.ic_launcher_folder));
+                    bundle.putParcelableArrayList(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, shortcutIcons);
+
+                    Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
+                    pickIntent.putExtra(Intent.EXTRA_INTENT,
+                            new Intent(LiveFolders.ACTION_CREATE_LIVE_FOLDER));
+                    pickIntent.putExtra(Intent.EXTRA_TITLE,
+                            getText(R.string.title_select_live_folder));
+                    pickIntent.putExtras(bundle);
+
+                    startActivityForResult(pickIntent, REQUEST_PICK_LIVE_FOLDER);
+                    break;
+                }
+
+                case AddAdapter.ITEM_WALLPAPER: {
+                    startWallpaper();
+                    break;
+                }
+            }
+        }
+
+        public void onShow(DialogInterface dialog) {
+        }
+    }
+
+    /**
+     * Receives notifications when applications are added/removed.
+     */
+    private class CloseSystemDialogsIntentReceiver extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            closeSystemDialogs();
+            String reason = intent.getStringExtra("reason");
+            if (!"homekey".equals(reason)) {
+                boolean animate = true;
+                if (mPaused || "lock".equals(reason)) {
+                    animate = false;
+                }
+                closeAllApps(animate);
+            }
+        }
+    }
+
+    /**
+     * Receives notifications whenever the appwidgets are reset.
+     */
+    private class AppWidgetResetObserver extends ContentObserver {
+        public AppWidgetResetObserver() {
+            super(new Handler());
+        }
+
+        @Override
+        public void onChange(boolean selfChange) {
+            onAppWidgetReset();
+        }
+    }
+
+    /**
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public int getCurrentWorkspaceScreen() {
+        return mWorkspace.getCurrentScreen();
+    }
+
+    /**
+     * Refreshes the shortcuts shown on the workspace.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void startBinding() {
+        final Workspace workspace = mWorkspace;
+        int count = workspace.getChildCount();
+        for (int i = 0; i < count; i++) {
+            // Use removeAllViewsInLayout() to avoid an extra requestLayout() and invalidate().
+            ((ViewGroup) workspace.getChildAt(i)).removeAllViewsInLayout();
+        }
+
+        if (DEBUG_USER_INTERFACE) {
+            android.widget.Button finishButton = new android.widget.Button(this);
+            finishButton.setText("Finish");
+            workspace.addInScreen(finishButton, 1, 0, 0, 1, 1);
+
+            finishButton.setOnClickListener(new android.widget.Button.OnClickListener() {
+                public void onClick(View v) {
+                    finish();
+                }
+            });
+        }
+    }
+
+    /**
+     * Bind the items start-end from the list.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindItems(ArrayList<ItemInfo> shortcuts, int start, int end) {
+
+        final Workspace workspace = mWorkspace;
+
+        for (int i=start; i<end; i++) {
+            final ItemInfo item = shortcuts.get(i);
+            mDesktopItems.add(item);
+            switch (item.itemType) {
+                case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
+                case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+                    final View shortcut = createShortcut((ApplicationInfo) item);
+                    workspace.addInScreen(shortcut, item.screen, item.cellX, item.cellY, 1, 1,
+                            false);
+                    break;
+                case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
+                    final FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
+                            (ViewGroup) workspace.getChildAt(workspace.getCurrentScreen()),
+                            (UserFolderInfo) item);
+                    workspace.addInScreen(newFolder, item.screen, item.cellX, item.cellY, 1, 1,
+                            false);
+                    break;
+                case LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER:
+                    final FolderIcon newLiveFolder = LiveFolderIcon.fromXml(
+                            R.layout.live_folder_icon, this,
+                            (ViewGroup) workspace.getChildAt(workspace.getCurrentScreen()),
+                            (LiveFolderInfo) item);
+                    workspace.addInScreen(newLiveFolder, item.screen, item.cellX, item.cellY, 1, 1,
+                            false);
+                    break;
+                case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
+                    final int screen = workspace.getCurrentScreen();
+                    final View view = mInflater.inflate(R.layout.widget_search,
+                            (ViewGroup) workspace.getChildAt(screen), false);
+
+                    Search search = (Search) view.findViewById(R.id.widget_search);
+                    search.setLauncher(this);
+
+                    final Widget widget = (Widget) item;
+                    view.setTag(widget);
+
+                    workspace.addWidget(view, widget, false);
+                    break;
+            }
+        }
+
+        workspace.requestLayout();
+    }
+
+    /**
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindFolders(HashMap<Long, FolderInfo> folders) {
+        mFolders.clear();
+        mFolders.putAll(folders);
+    }
+
+    /**
+     * Add the views for a widget to the workspace.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindAppWidget(LauncherAppWidgetInfo item) {
+        final Workspace workspace = mWorkspace;
+
+        final int appWidgetId = item.appWidgetId;
+        final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
+        item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
+
+        item.hostView.setAppWidget(appWidgetId, appWidgetInfo);
+        item.hostView.setTag(item);
+
+        workspace.addInScreen(item.hostView, item.screen, item.cellX,
+                item.cellY, item.spanX, item.spanY, false);
+
+        workspace.requestLayout();
+
+        mDesktopItems.add(item);
+    }
+
+    /**
+     * Callback saying that there aren't any more items to bind.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void finishBindingItems() {
+        if (mSavedState != null) {
+            if (!mWorkspace.hasFocus()) {
+                mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
+            }
+
+            final long[] userFolders = mSavedState.getLongArray(RUNTIME_STATE_USER_FOLDERS);
+            if (userFolders != null) {
+                for (long folderId : userFolders) {
+                    final FolderInfo info = mFolders.get(folderId);
+                    if (info != null) {
+                        openFolder(info);
+                    }
+                }
+                final Folder openFolder = mWorkspace.getOpenFolder();
+                if (openFolder != null) {
+                    openFolder.requestFocus();
+                }
+            }
+
+            mSavedState = null;
+        }
+
+        if (mSavedInstanceState != null) {
+            super.onRestoreInstanceState(mSavedInstanceState);
+            mSavedInstanceState = null;
+        }
+
+        mWorkspaceLoading = false;
+    }
+
+    /**
+     * Add the icons for all apps.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindAllApplications(ArrayList<ApplicationInfo> apps) {
+        mAllAppsGrid.setApps(apps);
+    }
+
+    /**
+     * A package was installed.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindPackageAdded(ArrayList<ApplicationInfo> apps) {
+        removeDialog(DIALOG_CREATE_SHORTCUT);
+        mAllAppsGrid.addApps(apps);
+    }
+
+    /**
+     * A package was updated.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindPackageUpdated(String packageName, ArrayList<ApplicationInfo> apps) {
+        removeDialog(DIALOG_CREATE_SHORTCUT);
+        mWorkspace.updateShortcutsForPackage(packageName);
+        mAllAppsGrid.updateApps(packageName, apps);
+    }
+
+    /**
+     * A package was uninstalled.
+     *
+     * Implementation of the method from LauncherModel.Callbacks.
+     */
+    public void bindPackageRemoved(String packageName, ArrayList<ApplicationInfo> apps) {
+        removeDialog(DIALOG_CREATE_SHORTCUT);
+        mWorkspace.removeShortcutsForPackage(packageName);
+        mAllAppsGrid.removeApps(apps);
+    }
+
+    /**
+     * Prints out out state for debugging.
+     */
+    public void dumpState() {
+        Log.d(TAG, "BEGIN launcher2 dump state for launcher " + this);
+        Log.d(TAG, "mSavedState=" + mSavedState);
+        Log.d(TAG, "mIsNewIntent=" + mIsNewIntent);
+        Log.d(TAG, "mWorkspaceLoading=" + mWorkspaceLoading);
+        Log.d(TAG, "mRestoring=" + mRestoring);
+        Log.d(TAG, "mWaitingForResult=" + mWaitingForResult);
+        Log.d(TAG, "mSavedInstanceState=" + mSavedInstanceState);
+        Log.d(TAG, "mDesktopItems.size=" + mDesktopItems.size());
+        Log.d(TAG, "mFolders.size=" + mFolders.size());
+        mModel.dumpState();
+        mAllAppsGrid.dumpState();
+        Log.d(TAG, "END launcher2 dump state");
+    }
+}
diff --git a/src/com/android/launcher2/LauncherAppWidgetHost.java b/src/com/android/launcher2/LauncherAppWidgetHost.java
new file mode 100644
index 0000000..a5761ec
--- /dev/null
+++ b/src/com/android/launcher2/LauncherAppWidgetHost.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetHostView;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.Context;
+
+/**
+ * Specific {@link AppWidgetHost} that creates our {@link LauncherAppWidgetHostView}
+ * which correctly captures all long-press events. This ensures that users can
+ * always pick up and move widgets.
+ */
+public class LauncherAppWidgetHost extends AppWidgetHost {
+    public LauncherAppWidgetHost(Context context, int hostId) {
+        super(context, hostId);
+    }
+    
+    @Override
+    protected AppWidgetHostView onCreateView(Context context, int appWidgetId,
+            AppWidgetProviderInfo appWidget) {
+        return new LauncherAppWidgetHostView(context);
+    }
+}
diff --git a/src/com/android/launcher2/LauncherAppWidgetHostView.java b/src/com/android/launcher2/LauncherAppWidgetHostView.java
new file mode 100644
index 0000000..d8fe499
--- /dev/null
+++ b/src/com/android/launcher2/LauncherAppWidgetHostView.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.appwidget.AppWidgetHostView;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewConfiguration;
+
+/**
+ * {@inheritDoc}
+ */
+public class LauncherAppWidgetHostView extends AppWidgetHostView {
+    private boolean mHasPerformedLongPress;
+    
+    private CheckForLongPress mPendingCheckForLongPress;
+    
+    private LayoutInflater mInflater;
+    
+    public LauncherAppWidgetHostView(Context context) {
+        super(context);
+        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+    }
+    
+    @Override
+    protected View getErrorView() {
+        return mInflater.inflate(R.layout.appwidget_error, this, false);
+    }
+
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        // Consume any touch events for ourselves after longpress is triggered
+        if (mHasPerformedLongPress) {
+            mHasPerformedLongPress = false;
+            return true;
+        }
+            
+        // Watch for longpress events at this level to make sure
+        // users can always pick up this widget
+        switch (ev.getAction()) {
+            case MotionEvent.ACTION_DOWN: {
+                postCheckForLongClick();
+                break;
+            }
+            
+            case MotionEvent.ACTION_UP:
+            case MotionEvent.ACTION_CANCEL:
+                mHasPerformedLongPress = false;
+                if (mPendingCheckForLongPress != null) {
+                    removeCallbacks(mPendingCheckForLongPress);
+                }
+                break;
+        }
+        
+        // Otherwise continue letting touch events fall through to children
+        return false;
+    }
+    
+    class CheckForLongPress implements Runnable {
+        private int mOriginalWindowAttachCount;
+
+        public void run() {
+            if ((mParent != null) && hasWindowFocus()
+                    && mOriginalWindowAttachCount == getWindowAttachCount()
+                    && !mHasPerformedLongPress) {
+                if (performLongClick()) {
+                    mHasPerformedLongPress = true;
+                }
+            }
+        }
+
+        public void rememberWindowAttachCount() {
+            mOriginalWindowAttachCount = getWindowAttachCount();
+        }
+    }
+
+    private void postCheckForLongClick() {
+        mHasPerformedLongPress = false;
+
+        if (mPendingCheckForLongPress == null) {
+            mPendingCheckForLongPress = new CheckForLongPress();
+        }
+        mPendingCheckForLongPress.rememberWindowAttachCount();
+        postDelayed(mPendingCheckForLongPress, ViewConfiguration.getLongPressTimeout());
+    }
+
+    @Override
+    public void cancelLongPress() {
+        super.cancelLongPress();
+
+        mHasPerformedLongPress = false;
+        if (mPendingCheckForLongPress != null) {
+            removeCallbacks(mPendingCheckForLongPress);
+        }
+    }
+}
diff --git a/src/com/android/launcher2/LauncherAppWidgetInfo.java b/src/com/android/launcher2/LauncherAppWidgetInfo.java
new file mode 100644
index 0000000..25db72b
--- /dev/null
+++ b/src/com/android/launcher2/LauncherAppWidgetInfo.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.appwidget.AppWidgetHostView;
+import android.content.ContentValues;
+
+/**
+ * Represents a widget, which just contains an identifier.
+ */
+class LauncherAppWidgetInfo extends ItemInfo {
+
+    /**
+     * Identifier for this widget when talking with {@link AppWidgetManager} for updates.
+     */
+    int appWidgetId;
+    
+    /**
+     * View that holds this widget after it's been created.  This view isn't created
+     * until Launcher knows it's needed.
+     */
+    AppWidgetHostView hostView = null;
+
+    LauncherAppWidgetInfo(int appWidgetId) {
+        itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
+        this.appWidgetId = appWidgetId;
+    }
+    
+    @Override
+    void onAddToDatabase(ContentValues values) {
+        super.onAddToDatabase(values);
+        values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
+    }
+
+    @Override
+    public String toString() {
+        return Integer.toString(appWidgetId);
+    }
+
+
+    @Override
+    void unbind() {
+        super.unbind();
+        hostView = null;
+    }
+}
diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/android/launcher2/LauncherApplication.java
new file mode 100644
index 0000000..9b63524
--- /dev/null
+++ b/src/com/android/launcher2/LauncherApplication.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.app.Application;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.database.ContentObserver;
+import android.os.Handler;
+import dalvik.system.VMRuntime;
+
+public class LauncherApplication extends Application {
+    public final LauncherModel mModel;
+
+    public LauncherApplication() {
+        mModel = new LauncherModel(this);
+    }
+
+    @Override
+    public void onCreate() {
+        VMRuntime.getRuntime().setMinimumHeapSize(4 * 1024 * 1024);
+
+        super.onCreate();
+
+        // Register intent receivers
+        IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
+        filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
+        filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
+        filter.addDataScheme("package");
+        registerReceiver(mModel, filter);
+
+        // Register for changes to the favorites
+        ContentResolver resolver = getContentResolver();
+        resolver.registerContentObserver(LauncherSettings.Favorites.CONTENT_URI, true,
+                mFavoritesObserver);
+    }
+
+    /**
+     * There's no guarantee that this function is ever called.
+     */
+    @Override
+    public void onTerminate() {
+        super.onTerminate();
+
+        unregisterReceiver(mModel);
+
+        ContentResolver resolver = getContentResolver();
+        resolver.unregisterContentObserver(mFavoritesObserver);
+    }
+
+    /**
+     * Receives notifications whenever the user favorites have changed.
+     */
+    private final ContentObserver mFavoritesObserver = new ContentObserver(new Handler()) {
+        @Override
+        public void onChange(boolean selfChange) {
+            // TODO: lockAllApps();
+            mModel.setWorkspaceDirty();
+            mModel.startLoader(LauncherApplication.this, false);
+        }
+    };
+
+    LauncherModel setLauncher(Launcher launcher) {
+        mModel.initialize(launcher);
+        return mModel;
+    }
+}
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
new file mode 100644
index 0000000..97fa554
--- /dev/null
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -0,0 +1,1239 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.util.Log;
+import android.os.Process;
+import android.os.SystemClock;
+
+import java.lang.ref.WeakReference;
+import java.net.URISyntaxException;
+import java.text.Collator;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * 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
+ * for the Launcher.
+ */
+public class LauncherModel extends BroadcastReceiver {
+    static final boolean DEBUG_LOADERS = false;
+    static final String TAG = "Launcher.Model";
+
+    private final LauncherApplication mApp;
+    private final Object mLock = new Object();
+    private DeferredHandler mHandler = new DeferredHandler();
+    private Loader mLoader = new Loader();
+
+    private boolean mBeforeFirstLoad = true;
+    private WeakReference<Callbacks> mCallbacks;
+
+    private AllAppsList mAllAppsList = new AllAppsList();
+
+    public interface Callbacks {
+        public int getCurrentWorkspaceScreen();
+        public void startBinding();
+        public void bindItems(ArrayList<ItemInfo> shortcuts, int start, int end);
+        public void bindFolders(HashMap<Long,FolderInfo> folders);
+        public void finishBindingItems();
+        public void bindAppWidget(LauncherAppWidgetInfo info);
+        public void bindAllApplications(ArrayList<ApplicationInfo> apps);
+        public void bindPackageAdded(ArrayList<ApplicationInfo> apps);
+        public void bindPackageUpdated(String packageName, ArrayList<ApplicationInfo> apps);
+        public void bindPackageRemoved(String packageName, ArrayList<ApplicationInfo> apps);
+    }
+
+    LauncherModel(LauncherApplication app) {
+        mApp = app;
+    }
+
+    /**
+     * Adds an item to the DB if it was not created previously, or move it to a new
+     * <container, screen, cellX, cellY>
+     */
+    static void addOrMoveItemInDatabase(Context context, ItemInfo item, long container,
+            int screen, int cellX, int cellY) {
+        if (item.container == ItemInfo.NO_ID) {
+            // From all apps
+            addItemToDatabase(context, item, container, screen, cellX, cellY, false);
+        } else {
+            // From somewhere else
+            moveItemInDatabase(context, item, container, screen, cellX, cellY);
+        }
+    }
+
+    /**
+     * Move an item in the DB to a new <container, screen, cellX, cellY>
+     */
+    static void moveItemInDatabase(Context context, ItemInfo item, long container, int screen,
+            int cellX, int cellY) {
+        item.container = container;
+        item.screen = screen;
+        item.cellX = cellX;
+        item.cellY = cellY;
+
+        final ContentValues values = new ContentValues();
+        final ContentResolver cr = context.getContentResolver();
+
+        values.put(LauncherSettings.Favorites.CONTAINER, item.container);
+        values.put(LauncherSettings.Favorites.CELLX, item.cellX);
+        values.put(LauncherSettings.Favorites.CELLY, item.cellY);
+        values.put(LauncherSettings.Favorites.SCREEN, item.screen);
+
+        cr.update(LauncherSettings.Favorites.getContentUri(item.id, false), values, null, null);
+    }
+
+    /**
+     * Returns true if the shortcuts already exists in the database.
+     * we identify a shortcut by its title and intent.
+     */
+    static boolean shortcutExists(Context context, String title, Intent intent) {
+        final ContentResolver cr = context.getContentResolver();
+        Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
+            new String[] { "title", "intent" }, "title=? and intent=?",
+            new String[] { title, intent.toUri(0) }, null);
+        boolean result = false;
+        try {
+            result = c.moveToFirst();
+        } finally {
+            c.close();
+        }
+        return result;
+    }
+
+    /**
+     * Find a folder in the db, creating the FolderInfo if necessary, and adding it to folderList.
+     */
+    FolderInfo getFolderById(Context context, HashMap<Long,FolderInfo> folderList, long id) {
+        final ContentResolver cr = context.getContentResolver();
+        Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, null,
+                "_id=? and (itemType=? or itemType=?)",
+                new String[] { String.valueOf(id),
+                        String.valueOf(LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER),
+                        String.valueOf(LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER) }, null);
+
+        try {
+            if (c.moveToFirst()) {
+                final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
+                final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
+                final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
+                final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
+                final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
+                final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
+
+                FolderInfo folderInfo = null;
+                switch (c.getInt(itemTypeIndex)) {
+                    case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
+                        folderInfo = findOrMakeUserFolder(folderList, id);
+                        break;
+                    case LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER:
+                        folderInfo = findOrMakeLiveFolder(folderList, id);
+                        break;
+                }
+
+                folderInfo.title = c.getString(titleIndex);
+                folderInfo.id = id;
+                folderInfo.container = c.getInt(containerIndex);
+                folderInfo.screen = c.getInt(screenIndex);
+                folderInfo.cellX = c.getInt(cellXIndex);
+                folderInfo.cellY = c.getInt(cellYIndex);
+
+                return folderInfo;
+            }
+        } finally {
+            c.close();
+        }
+
+        return null;
+    }
+
+    /**
+     * Add an item to the database in a specified container. Sets the container, screen, cellX and
+     * cellY fields of the item. Also assigns an ID to the item.
+     */
+    static void addItemToDatabase(Context context, ItemInfo item, long container,
+            int screen, int cellX, int cellY, boolean notify) {
+        item.container = container;
+        item.screen = screen;
+        item.cellX = cellX;
+        item.cellY = cellY;
+
+        final ContentValues values = new ContentValues();
+        final ContentResolver cr = context.getContentResolver();
+
+        item.onAddToDatabase(values);
+
+        Uri result = cr.insert(notify ? LauncherSettings.Favorites.CONTENT_URI :
+                LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, values);
+
+        if (result != null) {
+            item.id = Integer.parseInt(result.getPathSegments().get(1));
+        }
+    }
+
+    /**
+     * Update an item to the database in a specified container.
+     */
+    static void updateItemInDatabase(Context context, ItemInfo item) {
+        final ContentValues values = new ContentValues();
+        final ContentResolver cr = context.getContentResolver();
+
+        item.onAddToDatabase(values);
+
+        cr.update(LauncherSettings.Favorites.getContentUri(item.id, false), values, null, null);
+    }
+
+    /**
+     * Removes the specified item from the database
+     * @param context
+     * @param item
+     */
+    static void deleteItemFromDatabase(Context context, ItemInfo item) {
+        final ContentResolver cr = context.getContentResolver();
+
+        cr.delete(LauncherSettings.Favorites.getContentUri(item.id, false), null, null);
+    }
+
+    /**
+     * Remove the contents of the specified folder from the database
+     */
+    static void deleteUserFolderContentsFromDatabase(Context context, UserFolderInfo info) {
+        final ContentResolver cr = context.getContentResolver();
+
+        cr.delete(LauncherSettings.Favorites.getContentUri(info.id, false), null, null);
+        cr.delete(LauncherSettings.Favorites.CONTENT_URI,
+                LauncherSettings.Favorites.CONTAINER + "=" + info.id, null);
+    }
+
+    /**
+     * Set this as the current Launcher activity object for the loader.
+     */
+    public void initialize(Callbacks callbacks) {
+        synchronized (mLock) {
+            mCallbacks = new WeakReference<Callbacks>(callbacks);
+        }
+    }
+
+    public void startLoader(Context context, boolean isLaunching) {
+        mLoader.startLoader(context, isLaunching);
+    }
+
+    public void stopLoader() {
+        mLoader.stopLoader();
+    }
+
+    /**
+     * We pick up most of the changes to all apps.
+     */
+    public void setAllAppsDirty() {
+        mLoader.setAllAppsDirty();
+    }
+
+    public void setWorkspaceDirty() {
+        mLoader.setWorkspaceDirty();
+    }
+
+    /**
+     * Call from the handler for ACTION_PACKAGE_ADDED, ACTION_PACKAGE_REMOVED and
+     * ACTION_PACKAGE_CHANGED.
+     */
+    public void onReceive(Context context, Intent intent) {
+        // Use the app as the context.
+        context = mApp;
+
+        final String packageName = intent.getData().getSchemeSpecificPart();
+
+        ArrayList<ApplicationInfo> added = null;
+        ArrayList<ApplicationInfo> removed = null;
+        ArrayList<ApplicationInfo> modified = null;
+
+        synchronized (mLock) {
+            if (mBeforeFirstLoad) {
+                // If we haven't even loaded yet, don't bother, since we'll just pick
+                // up the changes.
+                return;
+            }
+
+            final String action = intent.getAction();
+            final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
+
+            if (packageName == null || packageName.length() == 0) {
+                // they sent us a bad intent
+                return;
+            }
+
+            if (Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
+                mAllAppsList.updatePackage(context, packageName);
+            } else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
+                if (!replacing) {
+                    mAllAppsList.removePackage(packageName);
+                }
+                // else, we are replacing the package, so a PACKAGE_ADDED will be sent
+                // later, we will update the package at this time
+            } else {
+                if (!replacing) {
+                    mAllAppsList.addPackage(context, packageName);
+                } else {
+                    mAllAppsList.updatePackage(context, packageName);
+                }
+            }
+
+            if (mAllAppsList.added.size() > 0) {
+                added = mAllAppsList.added;
+                mAllAppsList.added = new ArrayList<ApplicationInfo>();
+            }
+            if (mAllAppsList.removed.size() > 0) {
+                removed = mAllAppsList.removed;
+                mAllAppsList.removed = new ArrayList<ApplicationInfo>();
+                for (ApplicationInfo info: removed) {
+                    AppInfoCache.remove(info.intent.getComponent());
+                }
+            }
+            if (mAllAppsList.modified.size() > 0) {
+                modified = mAllAppsList.modified;
+                mAllAppsList.modified = new ArrayList<ApplicationInfo>();
+            }
+
+            final Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
+            if (callbacks == null) {
+                Log.w(TAG, "Nobody to tell about the new app.  Launcher is probably loading.");
+                return;
+            }
+
+            if (added != null) {
+                final ArrayList<ApplicationInfo> addedFinal = added;
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        callbacks.bindPackageAdded(addedFinal);
+                    }
+                });
+            }
+            if (modified != null) {
+                final ArrayList<ApplicationInfo> modifiedFinal = modified;
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        callbacks.bindPackageUpdated(packageName, modifiedFinal);
+                    }
+                });
+            }
+            if (removed != null) {
+                final ArrayList<ApplicationInfo> removedFinal = removed;
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        callbacks.bindPackageRemoved(packageName, removedFinal);
+                    }
+                });
+            }
+        }
+    }
+
+    public class Loader {
+        private static final int ITEMS_CHUNK = 6;
+
+        private LoaderThread mLoaderThread;
+
+        private int mLastWorkspaceSeq = 0;
+        private int mWorkspaceSeq = 1;
+
+        private int mLastAllAppsSeq = 0;
+        private int mAllAppsSeq = 1;
+
+        final ArrayList<ItemInfo> mItems = new ArrayList<ItemInfo>();
+        final ArrayList<LauncherAppWidgetInfo> mAppWidgets = new ArrayList<LauncherAppWidgetInfo>();
+        final HashMap<Long, FolderInfo> mFolders = new HashMap<Long, FolderInfo>();
+                
+        /**
+         * Call this from the ui thread so the handler is initialized on the correct thread.
+         */
+        public Loader() {
+        }
+
+        public void startLoader(Context context, boolean isLaunching) {
+            synchronized (mLock) {
+                if (DEBUG_LOADERS) {
+                    Log.d(TAG, "startLoader isLaunching=" + isLaunching);
+                }
+                // Don't bother to start the thread if we know it's not going to do anything
+                if (mCallbacks.get() != null) {
+                    LoaderThread oldThread = mLoaderThread;
+                    if (oldThread != null) {
+                        if (oldThread.isLaunching()) {
+                            // don't downgrade isLaunching if we're already running
+                            isLaunching = true;
+                        }
+                        oldThread.stopLocked();
+                    }
+                    mLoaderThread = new LoaderThread(context, oldThread, isLaunching);
+                    mLoaderThread.start();
+                }
+            }
+        }
+
+        public void stopLoader() {
+            synchronized (mLock) {
+                if (mLoaderThread != null) {
+                    mLoaderThread.stopLocked();
+                }
+            }
+        }
+
+        public void setWorkspaceDirty() {
+            synchronized (mLock) {
+                mWorkspaceSeq++;
+            }
+        }
+
+        public void setAllAppsDirty() {
+            synchronized (mLock) {
+                mAllAppsSeq++;
+            }
+        }
+
+        /**
+         * Runnable for the thread that loads the contents of the launcher:
+         *   - workspace icons
+         *   - widgets
+         *   - all apps icons
+         */
+        private class LoaderThread extends Thread {
+            private Context mContext;
+            private Thread mWaitThread;
+            private boolean mIsLaunching;
+            private boolean mStopped;
+            private boolean mWorkspaceDoneBinding;
+
+            LoaderThread(Context context, Thread waitThread, boolean isLaunching) {
+                mContext = context;
+                mWaitThread = waitThread;
+                mIsLaunching = isLaunching;
+            }
+
+            boolean isLaunching() {
+                return mIsLaunching;
+            }
+
+            /**
+             * If another LoaderThread was supplied, we need to wait for that to finish before
+             * we start our processing.  This keeps the ordering of the setting and clearing
+             * of the dirty flags correct by making sure we don't start processing stuff until
+             * they've had a chance to re-set them.  We do this waiting the worker thread, not
+             * the ui thread to avoid ANRs.
+             */
+            private void waitForOtherThread() {
+                if (mWaitThread != null) {
+                    boolean done = false;
+                    while (!done) {
+                        try {
+                            mWaitThread.join();
+                            done = true;
+                        } catch (InterruptedException ex) {
+                            // Ignore
+                        }
+                    }
+                    mWaitThread = null;
+                }
+            }
+
+            public void run() {
+                waitForOtherThread();
+
+                // Elevate priority when Home launches for the first time to avoid
+                // starving at boot time. Staring at a blank home is not cool.
+                synchronized (mLock) {
+                    android.os.Process.setThreadPriority(mIsLaunching
+                            ? Process.THREAD_PRIORITY_DEFAULT : Process.THREAD_PRIORITY_BACKGROUND);
+                }
+
+                // Load the workspace only if it's dirty.
+                int workspaceSeq;
+                boolean workspaceDirty;
+                synchronized (mLock) {
+                    workspaceSeq = mWorkspaceSeq;
+                    workspaceDirty = mWorkspaceSeq != mLastWorkspaceSeq;
+                }
+                if (workspaceDirty) {
+                    loadWorkspace();
+                }
+                synchronized (mLock) {
+                    // If we're not stopped, and nobody has incremented mWorkspaceSeq.
+                    if (mStopped) {
+                        return;
+                    }
+                    if (workspaceSeq == mWorkspaceSeq) {
+                        mLastWorkspaceSeq = mWorkspaceSeq;
+                    }
+                }
+
+                // Bind the workspace
+                bindWorkspace();
+                
+                // Wait until the either we're stopped or the other threads are done.
+                // This way we don't start loading all apps until the workspace has settled
+                // down.
+                synchronized (LoaderThread.this) {
+                    mHandler.postIdle(new Runnable() {
+                            public void run() {
+                                synchronized (LoaderThread.this) {
+                                    mWorkspaceDoneBinding = true;
+                                    if (DEBUG_LOADERS) {
+                                        Log.d(TAG, "done with workspace");
+                                        }
+                                    LoaderThread.this.notify();
+                                }
+                            }
+                        });
+                    if (DEBUG_LOADERS) {
+                        Log.d(TAG, "waiting to be done with workspace");
+                    }
+                    while (!mStopped && !mWorkspaceDoneBinding) {
+                        try {
+                            this.wait();
+                        } catch (InterruptedException ex) {
+                            // Ignore
+                        }
+                    }
+                    if (DEBUG_LOADERS) {
+                        Log.d(TAG, "done waiting to be done with workspace");
+                    }
+                }
+
+                // Load all apps if they're dirty
+                int allAppsSeq;
+                boolean allAppsDirty;
+                synchronized (mLock) {
+                    allAppsSeq = mAllAppsSeq;
+                    allAppsDirty = mAllAppsSeq != mLastAllAppsSeq;
+                    if (DEBUG_LOADERS) {
+                        Log.d(TAG, "mAllAppsSeq=" + mAllAppsSeq
+                                + " mLastAllAppsSeq=" + mLastAllAppsSeq + " allAppsDirty");
+                    }
+                }
+                if (allAppsDirty) {
+                    loadAllApps();
+                }
+                synchronized (mLock) {
+                    // If we're not stopped, and nobody has incremented mAllAppsSeq.
+                    if (mStopped) {
+                        return;
+                    }
+                    if (allAppsSeq == mAllAppsSeq) {
+                        mLastAllAppsSeq = mAllAppsSeq;
+                    }
+                }
+
+                // Bind all apps
+                if (allAppsDirty) {
+                    bindAllApps();
+                }
+
+                // Clear out this reference, otherwise we end up holding it until all of the
+                // callback runnables are done.
+                mContext = null;
+
+                synchronized (mLock) {
+                    // Setting the reference is atomic, but we can't do it inside the other critical
+                    // sections.
+                    mLoaderThread = null;
+                }
+            }
+
+            public void stopLocked() {
+                synchronized (LoaderThread.this) {
+                    mStopped = true;
+                    this.notify();
+                }
+            }
+
+            /**
+             * Gets the callbacks object.  If we've been stopped, or if the launcher object
+             * has somehow been garbage collected, return null instead.
+             */
+            Callbacks tryGetCallbacks() {
+                synchronized (mLock) {
+                    if (mStopped) {
+                        return null;
+                    }
+
+                    final Callbacks callbacks = mCallbacks.get();
+                    if (callbacks == null) {
+                        Log.w(TAG, "no mCallbacks");
+                        return null;
+                    }
+
+                    return callbacks;
+                }
+            }
+
+            private void loadWorkspace() {
+                long t = SystemClock.uptimeMillis();
+
+                final Context context = mContext;
+                final ContentResolver contentResolver = context.getContentResolver();
+                final PackageManager manager = context.getPackageManager();
+
+                /* TODO
+                if (mLocaleChanged) {
+                    updateShortcutLabels(contentResolver, manager);
+                }
+                */
+
+                mItems.clear();
+                mAppWidgets.clear();
+                mFolders.clear();
+
+                final Cursor c = contentResolver.query(
+                        LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
+
+                try {
+                    final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
+                    final int intentIndex = c.getColumnIndexOrThrow
+                            (LauncherSettings.Favorites.INTENT);
+                    final int titleIndex = c.getColumnIndexOrThrow
+                            (LauncherSettings.Favorites.TITLE);
+                    final int iconTypeIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.ICON_TYPE);
+                    final int iconIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
+                    final int iconPackageIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.ICON_PACKAGE);
+                    final int iconResourceIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.ICON_RESOURCE);
+                    final int containerIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.CONTAINER);
+                    final int itemTypeIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.ITEM_TYPE);
+                    final int appWidgetIdIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.APPWIDGET_ID);
+                    final int screenIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.SCREEN);
+                    final int cellXIndex = c.getColumnIndexOrThrow
+                            (LauncherSettings.Favorites.CELLX);
+                    final int cellYIndex = c.getColumnIndexOrThrow
+                            (LauncherSettings.Favorites.CELLY);
+                    final int spanXIndex = c.getColumnIndexOrThrow
+                            (LauncherSettings.Favorites.SPANX);
+                    final int spanYIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.SPANY);
+                    final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
+                    final int displayModeIndex = c.getColumnIndexOrThrow(
+                            LauncherSettings.Favorites.DISPLAY_MODE);
+
+                    ApplicationInfo info;
+                    String intentDescription;
+                    Widget widgetInfo;
+                    LauncherAppWidgetInfo appWidgetInfo;
+                    int container;
+                    long id;
+                    Intent intent;
+
+                    while (!mStopped && c.moveToNext()) {
+                        try {
+                            int itemType = c.getInt(itemTypeIndex);
+
+                            switch (itemType) {
+                            case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
+                            case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+                                intentDescription = c.getString(intentIndex);
+                                try {
+                                    intent = Intent.parseUri(intentDescription, 0);
+                                } catch (URISyntaxException e) {
+                                    continue;
+                                }
+
+                                if (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
+                                    info = getApplicationInfo(manager, intent, context);
+                                } else {
+                                    info = getApplicationInfoShortcut(c, context, iconTypeIndex,
+                                            iconPackageIndex, iconResourceIndex, iconIndex);
+                                }
+
+                                if (info == null) {
+                                    info = new ApplicationInfo();
+                                    info.icon = manager.getDefaultActivityIcon();
+                                }
+
+                                if (info != null) {
+                                    if (itemType
+                                            != LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
+                                        info.title = c.getString(titleIndex);
+                                    }
+                                    info.intent = intent;
+
+                                    info.id = c.getLong(idIndex);
+                                    container = c.getInt(containerIndex);
+                                    info.container = container;
+                                    info.screen = c.getInt(screenIndex);
+                                    info.cellX = c.getInt(cellXIndex);
+                                    info.cellY = c.getInt(cellYIndex);
+
+                                    switch (container) {
+                                    case LauncherSettings.Favorites.CONTAINER_DESKTOP:
+                                        mItems.add(info);
+                                        break;
+                                    default:
+                                        // Item is in a user folder
+                                        UserFolderInfo folderInfo =
+                                                findOrMakeUserFolder(mFolders, container);
+                                        folderInfo.add(info);
+                                        break;
+                                    }
+                                }
+                                break;
+
+                            case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
+                                id = c.getLong(idIndex);
+                                UserFolderInfo folderInfo = findOrMakeUserFolder(mFolders, id);
+
+                                folderInfo.title = c.getString(titleIndex);
+
+                                folderInfo.id = id;
+                                container = c.getInt(containerIndex);
+                                folderInfo.container = container;
+                                folderInfo.screen = c.getInt(screenIndex);
+                                folderInfo.cellX = c.getInt(cellXIndex);
+                                folderInfo.cellY = c.getInt(cellYIndex);
+
+                                switch (container) {
+                                    case LauncherSettings.Favorites.CONTAINER_DESKTOP:
+                                        mItems.add(folderInfo);
+                                        break;
+                                }
+
+                                mFolders.put(folderInfo.id, folderInfo);
+                                break;
+
+                            case LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER:
+
+                                id = c.getLong(idIndex);
+                                LiveFolderInfo liveFolderInfo = findOrMakeLiveFolder(mFolders, id);
+
+                                intentDescription = c.getString(intentIndex);
+                                intent = null;
+                                if (intentDescription != null) {
+                                    try {
+                                        intent = Intent.parseUri(intentDescription, 0);
+                                    } catch (URISyntaxException e) {
+                                        // Ignore, a live folder might not have a base intent
+                                    }
+                                }
+
+                                liveFolderInfo.title = c.getString(titleIndex);
+                                liveFolderInfo.id = id;
+                                container = c.getInt(containerIndex);
+                                liveFolderInfo.container = container;
+                                liveFolderInfo.screen = c.getInt(screenIndex);
+                                liveFolderInfo.cellX = c.getInt(cellXIndex);
+                                liveFolderInfo.cellY = c.getInt(cellYIndex);
+                                liveFolderInfo.uri = Uri.parse(c.getString(uriIndex));
+                                liveFolderInfo.baseIntent = intent;
+                                liveFolderInfo.displayMode = c.getInt(displayModeIndex);
+
+                                loadLiveFolderIcon(context, c, iconTypeIndex, iconPackageIndex,
+                                        iconResourceIndex, liveFolderInfo);
+
+                                switch (container) {
+                                    case LauncherSettings.Favorites.CONTAINER_DESKTOP:
+                                        mItems.add(liveFolderInfo);
+                                        break;
+                                }
+                                mFolders.put(liveFolderInfo.id, liveFolderInfo);
+                                break;
+
+                            case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
+                                widgetInfo = Widget.makeSearch();
+
+                                container = c.getInt(containerIndex);
+                                if (container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+                                    Log.e(TAG, "Widget found where container "
+                                            + "!= CONTAINER_DESKTOP  ignoring!");
+                                    continue;
+                                }
+
+                                widgetInfo.id = c.getLong(idIndex);
+                                widgetInfo.screen = c.getInt(screenIndex);
+                                widgetInfo.container = container;
+                                widgetInfo.cellX = c.getInt(cellXIndex);
+                                widgetInfo.cellY = c.getInt(cellYIndex);
+
+                                mItems.add(widgetInfo);
+                                break;
+
+                            case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
+                                // Read all Launcher-specific widget details
+                                int appWidgetId = c.getInt(appWidgetIdIndex);
+                                appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId);
+                                appWidgetInfo.id = c.getLong(idIndex);
+                                appWidgetInfo.screen = c.getInt(screenIndex);
+                                appWidgetInfo.cellX = c.getInt(cellXIndex);
+                                appWidgetInfo.cellY = c.getInt(cellYIndex);
+                                appWidgetInfo.spanX = c.getInt(spanXIndex);
+                                appWidgetInfo.spanY = c.getInt(spanYIndex);
+
+                                container = c.getInt(containerIndex);
+                                if (container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+                                    Log.e(TAG, "Widget found where container "
+                                            + "!= CONTAINER_DESKTOP -- ignoring!");
+                                    continue;
+                                }
+                                appWidgetInfo.container = c.getInt(containerIndex);
+
+                                mAppWidgets.add(appWidgetInfo);
+                                break;
+                            }
+                        } catch (Exception e) {
+                            Log.w(TAG, "Desktop items loading interrupted:", e);
+                        }
+                    }
+                } finally {
+                    c.close();
+                }
+                if (DEBUG_LOADERS) {
+                    Log.d(TAG, "loaded workspace in " + (SystemClock.uptimeMillis()-t) + "ms");
+                }
+            }
+
+            /**
+             * Read everything out of our database.
+             */
+            private void bindWorkspace() {
+                final long t = SystemClock.uptimeMillis();
+
+                // Don't use these two variables in any of the callback runnables.
+                // Otherwise we hold a reference to them.
+                Callbacks callbacks = mCallbacks.get();
+                if (callbacks == null) {
+                    // This launcher has exited and nobody bothered to tell us.  Just bail.
+                    Log.w(TAG, "LoaderThread running with no launcher");
+                    return;
+                }
+
+                int N;
+                // Tell the workspace that we're about to start firing items at it
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        Callbacks callbacks = tryGetCallbacks();
+                        if (callbacks != null) {
+                            callbacks.startBinding();
+                        }
+                    }
+                });
+                // Add the items to the workspace.
+                N = mItems.size();
+                for (int i=0; i<N; i+=ITEMS_CHUNK) {
+                    final int start = i;
+                    final int chunkSize = (i+ITEMS_CHUNK <= N) ? ITEMS_CHUNK : (N-i);
+                    mHandler.post(new Runnable() {
+                        public void run() {
+                            Callbacks callbacks = tryGetCallbacks();
+                            if (callbacks != null) {
+                                callbacks.bindItems(mItems, start, start+chunkSize);
+                            }
+                        }
+                    });
+                }
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        Callbacks callbacks = tryGetCallbacks();
+                        if (callbacks != null) {
+                            callbacks.bindFolders(mFolders);
+                        }
+                    }
+                });
+                // Wait until the queue goes empty.
+                mHandler.postIdle(new Runnable() {
+                    public void run() {
+                        if (DEBUG_LOADERS) {
+                            Log.d(TAG, "Going to start binding widgets soon.");
+                        }
+                    }
+                });
+                // Bind the widgets, one at a time.
+                // WARNING: this is calling into the workspace from the background thread,
+                // but since getCurrentScreen() just returns the int, we should be okay.  This
+                // is just a hint for the order, and if it's wrong, we'll be okay.
+                // TODO: instead, we should have that push the current screen into here.
+                final int currentScreen = callbacks.getCurrentWorkspaceScreen();
+                N = mAppWidgets.size();
+                // once for the current screen
+                for (int i=0; i<N; i++) {
+                    final LauncherAppWidgetInfo widget = mAppWidgets.get(i);
+                    if (widget.screen == currentScreen) {
+                        mHandler.post(new Runnable() {
+                            public void run() {
+                                Callbacks callbacks = tryGetCallbacks();
+                                if (callbacks != null) {
+                                    callbacks.bindAppWidget(widget);
+                                }
+                            }
+                        });
+                    }
+                }
+                // once for the other screens
+                for (int i=0; i<N; i++) {
+                    final LauncherAppWidgetInfo widget = mAppWidgets.get(i);
+                    if (widget.screen != currentScreen) {
+                        mHandler.post(new Runnable() {
+                            public void run() {
+                                Callbacks callbacks = tryGetCallbacks();
+                                if (callbacks != null) {
+                                    callbacks.bindAppWidget(widget);
+                                }
+                            }
+                        });
+                    }
+                }
+                // Tell the workspace that we're done.
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        Callbacks callbacks = tryGetCallbacks();
+                        if (callbacks != null) {
+                            callbacks.finishBindingItems();
+                        }
+                    }
+                });
+                // If we're profiling, this is the last thing in the queue.
+                mHandler.post(new Runnable() {
+                    public void run() {
+                        if (DEBUG_LOADERS) {
+                            Log.d(TAG, "bound workspace in "
+                                + (SystemClock.uptimeMillis()-t) + "ms");
+                        }
+                        if (Launcher.PROFILE_ROTATE) {
+                            android.os.Debug.stopMethodTracing();
+                        }
+                    }
+                });
+            }
+
+            private void loadAllApps() {
+                final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
+                mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+
+                final Callbacks callbacks = tryGetCallbacks();
+                if (callbacks == null) {
+                    return;
+                }
+
+                final Context context = mContext;
+                final PackageManager packageManager = context.getPackageManager();
+
+                final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0);
+
+                synchronized (mLock) {
+                    mBeforeFirstLoad = false;
+
+                    mAllAppsList.clear();
+                    if (apps != null) {
+                        long t = SystemClock.uptimeMillis();
+
+                        int N = apps.size();
+                        Utilities.BubbleText bubble = new Utilities.BubbleText(context);
+                        for (int i=0; i<N && !mStopped; i++) {
+                            // This builds the icon bitmaps.
+                            mAllAppsList.add(AppInfoCache.cache(apps.get(i), context, bubble));
+                        }
+                        Collections.sort(mAllAppsList.data, APP_NAME_COMPARATOR);
+                        Collections.sort(mAllAppsList.added, APP_NAME_COMPARATOR);
+                        if (DEBUG_LOADERS) {
+                            Log.d(TAG, "cached app icons in "
+                                    + (SystemClock.uptimeMillis()-t) + "ms");
+                        }
+                    }
+                }
+            }
+
+            private void bindAllApps() {
+                synchronized (mLock) {
+                    final ArrayList<ApplicationInfo> results
+                            = (ArrayList<ApplicationInfo>)mAllAppsList.data.clone();
+                    // We're adding this now, so clear out this so we don't re-send them.
+                    mAllAppsList.added = new ArrayList<ApplicationInfo>();
+                    mHandler.post(new Runnable() {
+                        public void run() {
+                            final long t = SystemClock.uptimeMillis();
+                            final int count = results.size();
+
+                            Callbacks callbacks = tryGetCallbacks();
+                            if (callbacks != null) {
+                                callbacks.bindAllApplications(results);
+                            }
+
+                            if (DEBUG_LOADERS) {
+                                Log.d(TAG, "bound app " + count + " icons in "
+                                    + (SystemClock.uptimeMillis()-t) + "ms");
+                            }
+                        }
+                    });
+                }
+            }
+
+            public void dumpState() {
+                Log.d(TAG, "mLoader.mLoaderThread.mContext=" + mContext);
+                Log.d(TAG, "mLoader.mLoaderThread.mWaitThread=" + mWaitThread);
+                Log.d(TAG, "mLoader.mLoaderThread.mIsLaunching=" + mIsLaunching);
+                Log.d(TAG, "mLoader.mLoaderThread.mStopped=" + mStopped);
+                Log.d(TAG, "mLoader.mLoaderThread.mWorkspaceDoneBinding=" + mWorkspaceDoneBinding);
+            }
+        }
+
+        public void dumpState() {
+            Log.d(TAG, "mLoader.mLastWorkspaceSeq=" + mLoader.mLastWorkspaceSeq);
+            Log.d(TAG, "mLoader.mWorkspaceSeq=" + mLoader.mWorkspaceSeq);
+            Log.d(TAG, "mLoader.mLastAllAppsSeq=" + mLoader.mLastAllAppsSeq);
+            Log.d(TAG, "mLoader.mAllAppsSeq=" + mLoader.mAllAppsSeq);
+            Log.d(TAG, "mLoader.mItems size=" + mLoader.mItems.size());
+            if (mLoaderThread != null) {
+                mLoaderThread.dumpState();
+            } else {
+                Log.d(TAG, "mLoader.mLoaderThread=null");
+            }
+        }
+    }
+
+    /**
+     * Make an ApplicationInfo object for an application.
+     */
+    private static ApplicationInfo getApplicationInfo(PackageManager manager, Intent intent,
+                                                      Context context) {
+        final ResolveInfo resolveInfo = manager.resolveActivity(intent, 0);
+
+        if (resolveInfo == null) {
+            return null;
+        }
+
+        final ApplicationInfo info = new ApplicationInfo();
+        final ActivityInfo activityInfo = resolveInfo.activityInfo;
+        info.icon = Utilities.createIconThumbnail(activityInfo.loadIcon(manager), context);
+        if (info.title == null || info.title.length() == 0) {
+            info.title = activityInfo.loadLabel(manager);
+        }
+        if (info.title == null) {
+            info.title = "";
+        }
+        info.itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
+        return info;
+    }
+
+    /**
+     * Make an ApplicationInfo object for a sortcut
+     */
+    private static ApplicationInfo getApplicationInfoShortcut(Cursor c, Context context,
+            int iconTypeIndex, int iconPackageIndex, int iconResourceIndex, int iconIndex) {
+
+        final ApplicationInfo info = new ApplicationInfo();
+        info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
+
+        int iconType = c.getInt(iconTypeIndex);
+        switch (iconType) {
+        case LauncherSettings.Favorites.ICON_TYPE_RESOURCE:
+            String packageName = c.getString(iconPackageIndex);
+            String resourceName = c.getString(iconResourceIndex);
+            PackageManager packageManager = context.getPackageManager();
+            try {
+                Resources resources = packageManager.getResourcesForApplication(packageName);
+                final int id = resources.getIdentifier(resourceName, null, null);
+                info.icon = Utilities.createIconThumbnail(resources.getDrawable(id), context);
+            } catch (Exception e) {
+                info.icon = packageManager.getDefaultActivityIcon();
+            }
+            info.iconResource = new Intent.ShortcutIconResource();
+            info.iconResource.packageName = packageName;
+            info.iconResource.resourceName = resourceName;
+            info.customIcon = false;
+            break;
+        case LauncherSettings.Favorites.ICON_TYPE_BITMAP:
+            byte[] data = c.getBlob(iconIndex);
+            try {
+                Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
+                info.icon = new FastBitmapDrawable(
+                        Utilities.createBitmapThumbnail(bitmap, context));
+            } catch (Exception e) {
+                packageManager = context.getPackageManager();
+                info.icon = packageManager.getDefaultActivityIcon();
+            }
+            info.filtered = true;
+            info.customIcon = true;
+            break;
+        default:
+            info.icon = context.getPackageManager().getDefaultActivityIcon();
+            info.customIcon = false;
+            break;
+        }
+        return info;
+    }
+
+    private static void loadLiveFolderIcon(Context context, Cursor c, int iconTypeIndex,
+            int iconPackageIndex, int iconResourceIndex, LiveFolderInfo liveFolderInfo) {
+
+        int iconType = c.getInt(iconTypeIndex);
+        switch (iconType) {
+        case LauncherSettings.Favorites.ICON_TYPE_RESOURCE:
+            String packageName = c.getString(iconPackageIndex);
+            String resourceName = c.getString(iconResourceIndex);
+            PackageManager packageManager = context.getPackageManager();
+            try {
+                Resources resources = packageManager.getResourcesForApplication(packageName);
+                final int id = resources.getIdentifier(resourceName, null, null);
+                liveFolderInfo.icon = resources.getDrawable(id);
+            } catch (Exception e) {
+                liveFolderInfo.icon =
+                        context.getResources().getDrawable(R.drawable.ic_launcher_folder);
+            }
+            liveFolderInfo.iconResource = new Intent.ShortcutIconResource();
+            liveFolderInfo.iconResource.packageName = packageName;
+            liveFolderInfo.iconResource.resourceName = resourceName;
+            break;
+        default:
+            liveFolderInfo.icon =
+                    context.getResources().getDrawable(R.drawable.ic_launcher_folder);
+        }
+    }
+
+    /**
+     * Return an existing UserFolderInfo object if we have encountered this ID previously,
+     * or make a new one.
+     */
+    private static UserFolderInfo findOrMakeUserFolder(HashMap<Long, FolderInfo> folders, long id) {
+        // See if a placeholder was created for us already
+        FolderInfo folderInfo = folders.get(id);
+        if (folderInfo == null || !(folderInfo instanceof UserFolderInfo)) {
+            // No placeholder -- create a new instance
+            folderInfo = new UserFolderInfo();
+            folders.put(id, folderInfo);
+        }
+        return (UserFolderInfo) folderInfo;
+    }
+
+    /**
+     * Return an existing UserFolderInfo object if we have encountered this ID previously, or make a
+     * new one.
+     */
+    private static LiveFolderInfo findOrMakeLiveFolder(HashMap<Long, FolderInfo> folders, long id) {
+        // See if a placeholder was created for us already
+        FolderInfo folderInfo = folders.get(id);
+        if (folderInfo == null || !(folderInfo instanceof LiveFolderInfo)) {
+            // No placeholder -- create a new instance
+            folderInfo = new LiveFolderInfo();
+            folders.put(id, folderInfo);
+        }
+        return (LiveFolderInfo) folderInfo;
+    }
+
+    private static void updateShortcutLabels(ContentResolver resolver, PackageManager manager) {
+        final Cursor c = resolver.query(LauncherSettings.Favorites.CONTENT_URI,
+                new String[] { LauncherSettings.Favorites._ID, LauncherSettings.Favorites.TITLE,
+                        LauncherSettings.Favorites.INTENT, LauncherSettings.Favorites.ITEM_TYPE },
+                null, null, null);
+
+        final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
+        final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
+        final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
+        final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
+
+        // boolean changed = false;
+
+        try {
+            while (c.moveToNext()) {
+                try {
+                    if (c.getInt(itemTypeIndex) !=
+                            LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
+                        continue;
+                    }
+
+                    final String intentUri = c.getString(intentIndex);
+                    if (intentUri != null) {
+                        final Intent shortcut = Intent.parseUri(intentUri, 0);
+                        if (Intent.ACTION_MAIN.equals(shortcut.getAction())) {
+                            final ComponentName name = shortcut.getComponent();
+                            if (name != null) {
+                                final ActivityInfo activityInfo = manager.getActivityInfo(name, 0);
+                                final String title = c.getString(titleIndex);
+                                String label = getLabel(manager, activityInfo);
+
+                                if (title == null || !title.equals(label)) {
+                                    final ContentValues values = new ContentValues();
+                                    values.put(LauncherSettings.Favorites.TITLE, label);
+
+                                    resolver.update(
+                                            LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION,
+                                            values, "_id=?",
+                                            new String[] { String.valueOf(c.getLong(idIndex)) });
+
+                                    // changed = true;
+                                }
+                            }
+                        }
+                    }
+                } catch (URISyntaxException e) {
+                    // Ignore
+                } catch (PackageManager.NameNotFoundException e) {
+                    // Ignore
+                }
+            }
+        } finally {
+            c.close();
+        }
+
+        // if (changed) resolver.notifyChange(Settings.Favorites.CONTENT_URI, null);
+    }
+
+    private static String getLabel(PackageManager manager, ActivityInfo activityInfo) {
+        String label = activityInfo.loadLabel(manager).toString();
+        if (label == null) {
+            label = manager.getApplicationLabel(activityInfo.applicationInfo).toString();
+            if (label == null) {
+                label = activityInfo.name;
+            }
+        }
+        return label;
+    }
+
+    private static final Collator sCollator = Collator.getInstance();
+    public static final Comparator<ApplicationInfo> APP_NAME_COMPARATOR
+            = new Comparator<ApplicationInfo>() {
+        public final int compare(ApplicationInfo a, ApplicationInfo b) {
+            return sCollator.compare(a.title.toString(), b.title.toString());
+        }
+    };
+
+    public void dumpState() {
+        Log.d(TAG, "mBeforeFirstLoad=" + mBeforeFirstLoad);
+        Log.d(TAG, "mCallbacks=" + mCallbacks);
+        ApplicationInfo.dumpApplicationInfoList(TAG, "mAllAppsList.data", mAllAppsList.data);
+        ApplicationInfo.dumpApplicationInfoList(TAG, "mAllAppsList.added", mAllAppsList.added);
+        ApplicationInfo.dumpApplicationInfoList(TAG, "mAllAppsList.removed", mAllAppsList.removed);
+        ApplicationInfo.dumpApplicationInfoList(TAG, "mAllAppsList.modified", mAllAppsList.modified);
+        mLoader.dumpState();
+    }
+}
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
new file mode 100644
index 0000000..c3ceefd
--- /dev/null
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -0,0 +1,808 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetManager;
+import android.content.ContentProvider;
+import android.content.Context;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.ComponentName;
+import android.content.ContentUris;
+import android.content.ContentResolver;
+import android.content.res.Resources;
+import android.content.res.XmlResourceParser;
+import android.content.res.TypedArray;
+import android.content.pm.PackageManager;
+import android.content.pm.ActivityInfo;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteQueryBuilder;
+import android.database.Cursor;
+import android.database.SQLException;
+import android.util.Log;
+import android.util.Xml;
+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 org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParser;
+import com.android.internal.util.XmlUtils;
+import com.android.launcher2.LauncherSettings.Favorites;
+
+public class LauncherProvider extends ContentProvider {
+    private static final String TAG = "Launcher.LauncherProvider";
+    private static final boolean LOGD = false;
+
+    private static final String DATABASE_NAME = "launcher.db";
+    
+    private static final int DATABASE_VERSION = 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";
+
+    /**
+     * {@link Uri} triggered at any registered {@link android.database.ContentObserver} when
+     * {@link AppWidgetHost#deleteHost()} is called during database creation.
+     * Use this to recall {@link AppWidgetHost#startListening()} if needed.
+     */
+    static final Uri CONTENT_APPWIDGET_RESET_URI =
+            Uri.parse("content://" + AUTHORITY + "/appWidgetReset");
+    
+    private SQLiteOpenHelper mOpenHelper;
+
+    @Override
+    public boolean onCreate() {
+        mOpenHelper = new DatabaseHelper(getContext());
+        return true;
+    }
+
+    @Override
+    public String getType(Uri uri) {
+        SqlArguments args = new SqlArguments(uri, null, null);
+        if (TextUtils.isEmpty(args.where)) {
+            return "vnd.android.cursor.dir/" + args.table;
+        } else {
+            return "vnd.android.cursor.item/" + args.table;
+        }
+    }
+
+    @Override
+    public Cursor query(Uri uri, String[] projection, String selection,
+            String[] selectionArgs, String sortOrder) {
+
+        SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
+        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
+        qb.setTables(args.table);
+
+        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+        Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder);
+        result.setNotificationUri(getContext().getContentResolver(), uri);
+
+        return result;
+    }
+
+    @Override
+    public Uri insert(Uri uri, ContentValues initialValues) {
+        SqlArguments args = new SqlArguments(uri);
+
+        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+        final long rowId = db.insert(args.table, null, initialValues);
+        if (rowId <= 0) return null;
+
+        uri = ContentUris.withAppendedId(uri, rowId);
+        sendNotify(uri);
+
+        return uri;
+    }
+
+    @Override
+    public int bulkInsert(Uri uri, ContentValues[] values) {
+        SqlArguments args = new SqlArguments(uri);
+
+        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+        db.beginTransaction();
+        try {
+            int numValues = values.length;
+            for (int i = 0; i < numValues; i++) {
+                if (db.insert(args.table, null, values[i]) < 0) return 0;
+            }
+            db.setTransactionSuccessful();
+        } finally {
+            db.endTransaction();
+        }
+
+        sendNotify(uri);
+        return values.length;
+    }
+
+    @Override
+    public int delete(Uri uri, String selection, String[] selectionArgs) {
+        SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
+
+        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+        int count = db.delete(args.table, args.where, args.args);
+        if (count > 0) sendNotify(uri);
+
+        return count;
+    }
+
+    @Override
+    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+        SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
+
+        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+        int count = db.update(args.table, values, args.where, args.args);
+        if (count > 0) sendNotify(uri);
+
+        return count;
+    }
+
+    private void sendNotify(Uri uri) {
+        String notify = uri.getQueryParameter(PARAMETER_NOTIFY);
+        if (notify == null || "true".equals(notify)) {
+            getContext().getContentResolver().notifyChange(uri, null);
+        }
+    }
+
+    private static class DatabaseHelper extends SQLiteOpenHelper {
+        private static final String TAG_FAVORITES = "favorites";
+        private static final String TAG_FAVORITE = "favorite";
+        private static final String TAG_CLOCK = "clock";
+        private static final String TAG_SEARCH = "search";
+        private static final String TAG_APPWIDGET = "appwidget";
+        private static final String TAG_SHORTCUT = "shortcut";
+        
+        private final Context mContext;
+        private final AppWidgetHost mAppWidgetHost;
+
+        DatabaseHelper(Context context) {
+            super(context, DATABASE_NAME, null, DATABASE_VERSION);
+            mContext = context;
+            mAppWidgetHost = new AppWidgetHost(context, Launcher.APPWIDGET_HOST_ID);
+        }
+
+        /**
+         * Send notification that we've deleted the {@link AppWidgetHost},
+         * probably as part of the initial database creation. The receiver may
+         * want to re-call {@link AppWidgetHost#startListening()} to ensure
+         * callbacks are correctly set.
+         */
+        private void sendAppWidgetResetNotify() {
+            final ContentResolver resolver = mContext.getContentResolver();
+            resolver.notifyChange(CONTENT_APPWIDGET_RESET_URI, null);
+        }
+
+        @Override
+        public void onCreate(SQLiteDatabase db) {
+            if (LOGD) Log.d(TAG, "creating new launcher database");
+            
+            db.execSQL("CREATE TABLE favorites (" +
+                    "_id INTEGER PRIMARY KEY," +
+                    "title TEXT," +
+                    "intent TEXT," +
+                    "container INTEGER," +
+                    "screen INTEGER," +
+                    "cellX INTEGER," +
+                    "cellY INTEGER," +
+                    "spanX INTEGER," +
+                    "spanY INTEGER," +
+                    "itemType INTEGER," +
+                    "appWidgetId INTEGER NOT NULL DEFAULT -1," +
+                    "isShortcut INTEGER," +
+                    "iconType INTEGER," +
+                    "iconPackage TEXT," +
+                    "iconResource TEXT," +
+                    "icon BLOB," +
+                    "uri TEXT," +
+                    "displayMode INTEGER" +
+                    ");");
+
+            // Database was just created, so wipe any previous widgets
+            if (mAppWidgetHost != null) {
+                mAppWidgetHost.deleteHost();
+                sendAppWidgetResetNotify();
+            }
+            
+            if (!convertDatabase(db)) {
+                // Populate favorites table with initial favorites
+                loadFavorites(db);
+            }
+        }
+
+        private boolean convertDatabase(SQLiteDatabase db) {
+            if (LOGD) Log.d(TAG, "converting database from an older format, but not onUpgrade");
+            boolean converted = false;
+
+            final Uri uri = Uri.parse("content://" + Settings.AUTHORITY +
+                    "/old_favorites?notify=true");
+            final ContentResolver resolver = mContext.getContentResolver();
+            Cursor cursor = null;
+
+            try {
+                cursor = resolver.query(uri, null, null, null, null);
+            } catch (Exception e) {
+	            // Ignore
+            }
+
+            // We already have a favorites database in the old provider
+            if (cursor != null && cursor.getCount() > 0) {
+                try {
+                    converted = copyFromCursor(db, cursor) > 0;
+                } finally {
+                    cursor.close();
+                }
+
+                if (converted) {
+                    resolver.delete(uri, null, null);
+                }
+            }
+            
+            if (converted) {
+                // Convert widgets from this import into widgets
+                if (LOGD) Log.d(TAG, "converted and now triggering widget upgrade");
+                convertWidgets(db);
+            }
+
+            return converted;
+        }
+
+        private int copyFromCursor(SQLiteDatabase db, Cursor c) {
+            final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
+            final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
+            final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
+            final int iconTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_TYPE);
+            final int iconIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
+            final int iconPackageIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_PACKAGE);
+            final int iconResourceIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_RESOURCE);
+            final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
+            final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
+            final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
+            final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
+            final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
+            final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
+            final int displayModeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE);
+
+            ContentValues[] rows = new ContentValues[c.getCount()];
+            int i = 0;
+            while (c.moveToNext()) {
+                ContentValues values = new ContentValues(c.getColumnCount());
+                values.put(LauncherSettings.Favorites._ID, c.getLong(idIndex));
+                values.put(LauncherSettings.Favorites.INTENT, c.getString(intentIndex));
+                values.put(LauncherSettings.Favorites.TITLE, c.getString(titleIndex));
+                values.put(LauncherSettings.Favorites.ICON_TYPE, c.getInt(iconTypeIndex));
+                values.put(LauncherSettings.Favorites.ICON, c.getBlob(iconIndex));
+                values.put(LauncherSettings.Favorites.ICON_PACKAGE, c.getString(iconPackageIndex));
+                values.put(LauncherSettings.Favorites.ICON_RESOURCE, c.getString(iconResourceIndex));
+                values.put(LauncherSettings.Favorites.CONTAINER, c.getInt(containerIndex));
+                values.put(LauncherSettings.Favorites.ITEM_TYPE, c.getInt(itemTypeIndex));
+                values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1);
+                values.put(LauncherSettings.Favorites.SCREEN, c.getInt(screenIndex));
+                values.put(LauncherSettings.Favorites.CELLX, c.getInt(cellXIndex));
+                values.put(LauncherSettings.Favorites.CELLY, c.getInt(cellYIndex));
+                values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex));
+                values.put(LauncherSettings.Favorites.DISPLAY_MODE, c.getInt(displayModeIndex));
+                rows[i++] = values;
+            }
+
+            db.beginTransaction();
+            int total = 0;
+            try {
+                int numValues = rows.length;
+                for (i = 0; i < numValues; i++) {
+                    if (db.insert(TABLE_FAVORITES, null, rows[i]) < 0) {
+                        return 0;
+                    } else {
+                        total++;
+                    }
+                }
+                db.setTransactionSuccessful();
+            } finally {
+                db.endTransaction();
+            }
+
+            return total;
+        }
+
+        @Override
+        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+            if (LOGD) Log.d(TAG, "onUpgrade triggered");
+            
+            int version = oldVersion;
+            if (version < 3) {
+                // upgrade 1,2 -> 3 added appWidgetId column
+                db.beginTransaction();
+                try {
+                    // Insert new column for holding appWidgetIds
+                    db.execSQL("ALTER TABLE favorites " +
+                        "ADD COLUMN appWidgetId INTEGER NOT NULL DEFAULT -1;");
+                    db.setTransactionSuccessful();
+                    version = 3;
+                } catch (SQLException ex) {
+                    // Old version remains, which means we wipe old data
+                    Log.e(TAG, ex.getMessage(), ex);
+                } finally {
+                    db.endTransaction();
+                }
+                
+                // Convert existing widgets only if table upgrade was successful
+                if (version == 3) {
+                    convertWidgets(db);
+                }
+            }
+
+            if (version < 4) {
+                version = 4;
+            }
+            
+            if (version < 5) {
+                // We went from 3 to 5 screens. Move everything 1 to the right
+                db.beginTransaction();
+                try {
+                    db.execSQL("UPDATE favorites SET screen=(screen + 1);");
+                    db.setTransactionSuccessful();
+                    version = 5;
+                } catch (SQLException ex) {
+                    // Old version remains, which means we wipe old data
+                    Log.e(TAG, ex.getMessage(), ex);
+                } finally {
+                    db.endTransaction();
+                }
+            }
+            
+            if (version < 6) {
+                if (updateContactsShortcuts(db)) {
+                    version = 6;
+                }
+            }
+            
+            if (version != DATABASE_VERSION) {
+                Log.w(TAG, "Destroying all old data.");
+                db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);
+                onCreate(db);
+            }
+        }
+
+        private boolean updateContactsShortcuts(SQLiteDatabase db) {
+            Cursor c = null;
+            final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE,
+                    new int[] { Favorites.ITEM_TYPE_SHORTCUT });
+
+            db.beginTransaction();
+            try {
+                // Select and iterate through each matching widget
+                c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID, Favorites.INTENT },
+                        selectWhere, null, null, null, null);
+                
+                if (LOGD) Log.d(TAG, "found upgrade cursor count=" + c.getCount());
+                
+                final ContentValues values = new ContentValues();
+                final int idIndex = c.getColumnIndex(Favorites._ID);
+                final int intentIndex = c.getColumnIndex(Favorites.INTENT);
+                
+                while (c != null && c.moveToNext()) {
+                    long favoriteId = c.getLong(idIndex);
+                    final String intentUri = c.getString(intentIndex);
+                    if (intentUri != null) {
+                        try {
+                            Intent intent = Intent.parseUri(intentUri, 0);
+                            android.util.Log.d("Home", intent.toString());
+                            final Uri uri = intent.getData();
+                            final String data = uri.toString();
+                            if (Intent.ACTION_VIEW.equals(intent.getAction()) &&
+                                    (data.startsWith("content://contacts/people/") ||
+                                    data.startsWith("content://com.android.contacts/contacts/lookup/"))) {
+
+                                intent = new Intent("com.android.contacts.action.QUICK_CONTACT");
+                                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+                                        Intent.FLAG_ACTIVITY_CLEAR_TOP |
+                                        Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+
+                                intent.setData(uri);
+                                intent.putExtra("mode", 3);
+                                intent.putExtra("exclude_mimes", (String[]) null);
+
+                                values.clear();
+                                values.put(LauncherSettings.Favorites.INTENT, intent.toUri(0));
+    
+                                String updateWhere = Favorites._ID + "=" + favoriteId;
+                                db.update(TABLE_FAVORITES, values, updateWhere, null);                                
+                            }
+                        } catch (RuntimeException ex) {
+                            Log.e(TAG, "Problem upgrading shortcut", ex);
+                        } catch (URISyntaxException e) {
+                            Log.e(TAG, "Problem upgrading shortcut", e);                            
+                        }
+                    }
+                }
+                
+                db.setTransactionSuccessful();
+            } catch (SQLException ex) {
+                Log.w(TAG, "Problem while upgrading contacts", ex);
+                return false;
+            } finally {
+                db.endTransaction();
+                if (c != null) {
+                    c.close();
+                }
+            }
+
+            return true;
+        }
+
+        /**
+         * Upgrade existing clock and photo frame widgets into their new widget
+         * equivalents. This method allocates appWidgetIds, and then hands off to
+         * LauncherAppWidgetBinder to finish the actual binding.
+         */
+        private void convertWidgets(SQLiteDatabase db) {
+            final int[] bindSources = new int[] {
+                    Favorites.ITEM_TYPE_WIDGET_CLOCK,
+                    Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
+            };
+            
+            final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
+            bindTargets.add(new ComponentName("com.android.alarmclock",
+                    "com.android.alarmclock.AnalogAppWidgetProvider"));
+            bindTargets.add(new ComponentName("com.android.camera",
+                    "com.android.camera.PhotoAppWidgetProvider"));
+            
+            final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
+            
+            Cursor c = null;
+            boolean allocatedAppWidgets = false;
+            
+            db.beginTransaction();
+            try {
+                // Select and iterate through each matching widget
+                c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID },
+                        selectWhere, null, null, null, null);
+                
+                if (LOGD) Log.d(TAG, "found upgrade cursor count=" + c.getCount());
+                
+                final ContentValues values = new ContentValues();
+                while (c != null && c.moveToNext()) {
+                    long favoriteId = c.getLong(0);
+                    
+                    // Allocate and update database with new appWidgetId
+                    try {
+                        int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
+                        
+                        if (LOGD) {
+                            Log.d(TAG, "allocated appWidgetId=" + appWidgetId
+                                    + " for favoriteId=" + favoriteId);
+                        }
+                        
+                        values.clear();
+                        values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
+                        
+                        // Original widgets might not have valid spans when upgrading
+                        values.put(LauncherSettings.Favorites.SPANX, 2);
+                        values.put(LauncherSettings.Favorites.SPANY, 2);
+
+                        String updateWhere = Favorites._ID + "=" + favoriteId;
+                        db.update(TABLE_FAVORITES, values, updateWhere, null);
+                        
+                        allocatedAppWidgets = true;
+                    } catch (RuntimeException ex) {
+                        Log.e(TAG, "Problem allocating appWidgetId", ex);
+                    }
+                }
+                
+                db.setTransactionSuccessful();
+            } catch (SQLException ex) {
+                Log.w(TAG, "Problem while allocating appWidgetIds for existing widgets", ex);
+            } finally {
+                db.endTransaction();
+                if (c != null) {
+                    c.close();
+                }
+            }
+            
+            // If any appWidgetIds allocated, then launch over to binder
+            if (allocatedAppWidgets) {
+                launchAppWidgetBinder(bindSources, bindTargets);
+            }
+        }
+
+        /**
+         * Launch the widget binder that walks through the Launcher database,
+         * binding any matching widgets to the corresponding targets. We can't
+         * bind ourselves because our parent process can't obtain the
+         * BIND_APPWIDGET permission.
+         */
+        private void launchAppWidgetBinder(int[] bindSources, ArrayList<ComponentName> bindTargets) {
+            final Intent intent = new Intent();
+            intent.setComponent(new ComponentName("com.android.settings",
+                    "com.android.settings.LauncherAppWidgetBinder"));
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            
+            final Bundle extras = new Bundle();
+            extras.putIntArray(EXTRA_BIND_SOURCES, bindSources);
+            extras.putParcelableArrayList(EXTRA_BIND_TARGETS, bindTargets);
+            intent.putExtras(extras);
+            
+            mContext.startActivity(intent);
+        }
+        
+        /**
+         * Loads the default set of favorite packages from an xml file.
+         *
+         * @param db The database to write the values into
+         */
+        private int loadFavorites(SQLiteDatabase db) {
+            Intent intent = new Intent(Intent.ACTION_MAIN, null);
+            intent.addCategory(Intent.CATEGORY_LAUNCHER);
+            ContentValues values = new ContentValues();
+
+            PackageManager packageManager = mContext.getPackageManager();
+            int i = 0;
+            try {
+                XmlResourceParser parser = mContext.getResources().getXml(R.xml.default_workspace);
+                AttributeSet attrs = Xml.asAttributeSet(parser);
+                XmlUtils.beginDocument(parser, TAG_FAVORITES);
+
+                final int depth = parser.getDepth();
+
+                int type;
+                while (((type = parser.next()) != XmlPullParser.END_TAG ||
+                        parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) {
+
+                    if (type != XmlPullParser.START_TAG) {
+                        continue;
+                    }
+
+                    boolean added = false;
+                    final String name = parser.getName();
+
+                    TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.Favorite);
+
+                    values.clear();                    
+                    values.put(LauncherSettings.Favorites.CONTAINER,
+                            LauncherSettings.Favorites.CONTAINER_DESKTOP);
+                    values.put(LauncherSettings.Favorites.SCREEN,
+                            a.getString(R.styleable.Favorite_screen));
+                    values.put(LauncherSettings.Favorites.CELLX,
+                            a.getString(R.styleable.Favorite_x));
+                    values.put(LauncherSettings.Favorites.CELLY,
+                            a.getString(R.styleable.Favorite_y));
+
+                    if (TAG_FAVORITE.equals(name)) {
+                        added = addAppShortcut(db, values, a, packageManager, intent);
+                    } else if (TAG_SEARCH.equals(name)) {
+                        added = addSearchWidget(db, values);
+                    } else if (TAG_CLOCK.equals(name)) {
+                        added = addClockWidget(db, values);
+                    } else if (TAG_APPWIDGET.equals(name)) {
+                        added = addAppWidget(db, values, a);
+                    } else if (TAG_SHORTCUT.equals(name)) {
+                        added = addUriShortcut(db, values, a);
+                    }
+
+                    if (added) i++;
+
+                    a.recycle();
+                }
+            } catch (XmlPullParserException e) {
+                Log.w(TAG, "Got exception parsing favorites.", e);
+            } catch (IOException e) {
+                Log.w(TAG, "Got exception parsing favorites.", e);
+            }
+
+            return i;
+        }
+
+        private boolean addAppShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
+                PackageManager packageManager, Intent intent) {
+
+            ActivityInfo info;
+            String packageName = a.getString(R.styleable.Favorite_packageName);
+            String className = a.getString(R.styleable.Favorite_className);
+            try {
+                ComponentName cn = new ComponentName(packageName, className);
+                info = packageManager.getActivityInfo(cn, 0);
+                intent.setComponent(cn);
+                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+                        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+                values.put(Favorites.INTENT, intent.toUri(0));
+                values.put(Favorites.TITLE, info.loadLabel(packageManager).toString());
+                values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPLICATION);
+                values.put(Favorites.SPANX, 1);
+                values.put(Favorites.SPANY, 1);
+                db.insert(TABLE_FAVORITES, null, values);
+            } catch (PackageManager.NameNotFoundException e) {
+                Log.w(TAG, "Unable to add favorite: " + packageName +
+                        "/" + className, e);
+                return false;
+            }
+            return true;
+        }
+
+        private boolean addSearchWidget(SQLiteDatabase db, ContentValues values) {
+            // Add a search box
+            values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_WIDGET_SEARCH);
+            values.put(Favorites.SPANX, 4);
+            values.put(Favorites.SPANY, 1);
+            db.insert(TABLE_FAVORITES, null, values);
+
+            return true;
+        }
+
+        private boolean addClockWidget(SQLiteDatabase db, ContentValues values) {
+            final int[] bindSources = new int[] {
+                    Favorites.ITEM_TYPE_WIDGET_CLOCK,
+            };
+
+            final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
+            bindTargets.add(new ComponentName("com.android.alarmclock",
+                    "com.android.alarmclock.AnalogAppWidgetProvider"));
+
+            boolean allocatedAppWidgets = false;
+            
+            // Try binding to an analog clock widget
+            try {
+                int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
+
+                values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_WIDGET_CLOCK);
+                values.put(Favorites.SPANX, 2);
+                values.put(Favorites.SPANY, 2);
+                values.put(Favorites.APPWIDGET_ID, appWidgetId);
+                db.insert(TABLE_FAVORITES, null, values);
+
+                allocatedAppWidgets = true;
+            } catch (RuntimeException ex) {
+                Log.e(TAG, "Problem allocating appWidgetId", ex);
+            }
+
+            // If any appWidgetIds allocated, then launch over to binder
+            if (allocatedAppWidgets) {
+                launchAppWidgetBinder(bindSources, bindTargets);
+            }
+
+            return allocatedAppWidgets;
+        }
+        
+        private boolean addAppWidget(SQLiteDatabase db, ContentValues values, TypedArray a) {
+            String packageName = a.getString(R.styleable.Favorite_packageName);
+            String className = a.getString(R.styleable.Favorite_className);
+
+            if (packageName == null || className == null) {
+                return false;
+            }
+            
+            ComponentName cn = new ComponentName(packageName, className);
+            
+            boolean allocatedAppWidgets = false;
+            final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
+
+            try {
+                int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
+                
+                values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
+                values.put(Favorites.SPANX, a.getString(R.styleable.Favorite_spanX));
+                values.put(Favorites.SPANY, a.getString(R.styleable.Favorite_spanY));
+                values.put(Favorites.APPWIDGET_ID, appWidgetId);
+                db.insert(TABLE_FAVORITES, null, values);
+
+                allocatedAppWidgets = true;
+                
+                appWidgetManager.bindAppWidgetId(appWidgetId, cn);
+            } catch (RuntimeException ex) {
+                Log.e(TAG, "Problem allocating appWidgetId", ex);
+            }
+            
+            return allocatedAppWidgets;
+        }
+        
+        private boolean addUriShortcut(SQLiteDatabase db, ContentValues values,
+                TypedArray a) {
+            Resources r = mContext.getResources();
+
+            final int iconResId = a.getResourceId(R.styleable.Favorite_icon, 0);
+            final int titleResId = a.getResourceId(R.styleable.Favorite_title, 0);
+
+            Intent intent;
+            String uri = null;
+            try {
+                uri = a.getString(R.styleable.Favorite_uri);
+                intent = Intent.parseUri(uri, 0);
+            } catch (URISyntaxException e) {
+                Log.w(TAG, "Shortcut has malformed uri: " + uri);
+                return false; // Oh well
+            }
+
+            if (iconResId == 0 || titleResId == 0) {
+                Log.w(TAG, "Shortcut is missing title or icon resource ID");
+                return false;
+            }
+
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            values.put(Favorites.INTENT, intent.toUri(0));
+            values.put(Favorites.TITLE, r.getString(titleResId));
+            values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_SHORTCUT);
+            values.put(Favorites.SPANX, 1);
+            values.put(Favorites.SPANY, 1);
+            values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
+            values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
+            values.put(Favorites.ICON_RESOURCE, r.getResourceName(iconResId));
+
+            db.insert(TABLE_FAVORITES, null, values);
+
+            return true;
+        }
+    }
+    
+    /**
+     * Build a query string that will match any row where the column matches
+     * anything in the values list.
+     */
+    static String buildOrWhereString(String column, int[] values) {
+        StringBuilder selectWhere = new StringBuilder();
+        for (int i = values.length - 1; i >= 0; i--) {
+            selectWhere.append(column).append("=").append(values[i]);
+            if (i > 0) {
+                selectWhere.append(" OR ");
+            }
+        }
+        return selectWhere.toString();
+    }
+
+    static class SqlArguments {
+        public final String table;
+        public final String where;
+        public final String[] args;
+
+        SqlArguments(Uri url, String where, String[] args) {
+            if (url.getPathSegments().size() == 1) {
+                this.table = url.getPathSegments().get(0);
+                this.where = where;
+                this.args = args;
+            } else if (url.getPathSegments().size() != 2) {
+                throw new IllegalArgumentException("Invalid URI: " + url);
+            } else if (!TextUtils.isEmpty(where)) {
+                throw new UnsupportedOperationException("WHERE clause not supported: " + url);
+            } else {
+                this.table = url.getPathSegments().get(0);
+                this.where = "_id=" + ContentUris.parseId(url);                
+                this.args = null;
+            }
+        }
+
+        SqlArguments(Uri url) {
+            if (url.getPathSegments().size() == 1) {
+                table = url.getPathSegments().get(0);
+                where = null;
+                args = null;
+            } else {
+                throw new IllegalArgumentException("Invalid URI: " + url);
+            }
+        }
+    }
+}
diff --git a/src/com/android/launcher2/LauncherSettings.java b/src/com/android/launcher2/LauncherSettings.java
new file mode 100644
index 0000000..a438d47
--- /dev/null
+++ b/src/com/android/launcher2/LauncherSettings.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.provider.BaseColumns;
+import android.net.Uri;
+
+/**
+ * Settings related utilities.
+ */
+class LauncherSettings {
+    static interface BaseLauncherColumns extends BaseColumns {
+        /**
+         * Descriptive name of the gesture that can be displayed to the user.
+         * <P>Type: TEXT</P>
+         */
+        static final String TITLE = "title";
+
+        /**
+         * The Intent URL of the gesture, describing what it points to. This
+         * value is given to {@link android.content.Intent#parseUri(String, int)} to create
+         * an Intent that can be launched.
+         * <P>Type: TEXT</P>
+         */
+        static final String INTENT = "intent";
+
+        /**
+         * The type of the gesture
+         *
+         * <P>Type: INTEGER</P>
+         */
+        static final String ITEM_TYPE = "itemType";
+
+        /**
+         * The gesture is an application
+         */
+        static final int ITEM_TYPE_APPLICATION = 0;
+
+        /**
+         * The gesture is an application created shortcut
+         */
+        static final int ITEM_TYPE_SHORTCUT = 1;
+
+        /**
+         * The icon type.
+         * <P>Type: INTEGER</P>
+         */
+        static final String ICON_TYPE = "iconType";
+
+        /**
+         * The icon is a resource identified by a package name and an integer id.
+         */
+        static final int ICON_TYPE_RESOURCE = 0;
+
+        /**
+         * The icon is a bitmap.
+         */
+        static final int ICON_TYPE_BITMAP = 1;
+
+        /**
+         * The icon package name, if icon type is ICON_TYPE_RESOURCE.
+         * <P>Type: TEXT</P>
+         */
+        static final String ICON_PACKAGE = "iconPackage";
+
+        /**
+         * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
+         * <P>Type: TEXT</P>
+         */
+        static final String ICON_RESOURCE = "iconResource";
+
+        /**
+         * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
+         * <P>Type: BLOB</P>
+         */
+        static final String ICON = "icon";
+    }
+
+    /**
+     * Favorites. When changing these values, be sure to update
+     * {@link com.android.settings.LauncherAppWidgetBinder} as needed.
+     */
+    static final class Favorites implements BaseLauncherColumns {
+        /**
+         * The content:// style URL for this table
+         */
+        static final Uri CONTENT_URI = Uri.parse("content://" +
+                LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+                "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
+
+        /**
+         * The content:// style URL for this table. When this Uri is used, no notification is
+         * sent if the content changes.
+         */
+        static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
+                LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+                "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
+
+        /**
+         * The content:// style URL for a given row, identified by its id.
+         *
+         * @param id The row id.
+         * @param notify True to send a notification is the content changes.
+         *
+         * @return The unique content URL for the specified row.
+         */
+        static Uri getContentUri(long id, boolean notify) {
+            return Uri.parse("content://" + LauncherProvider.AUTHORITY +
+                    "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
+                    LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
+        }
+
+        /**
+         * The container holding the favorite
+         * <P>Type: INTEGER</P>
+         */
+        static final String CONTAINER = "container";
+
+        /**
+         * The icon is a resource identified by a package name and an integer id.
+         */
+        static final int CONTAINER_DESKTOP = -100;
+
+        /**
+         * The screen holding the favorite (if container is CONTAINER_DESKTOP)
+         * <P>Type: INTEGER</P>
+         */
+        static final String SCREEN = "screen";
+
+        /**
+         * The X coordinate of the cell holding the favorite
+         * (if container is CONTAINER_DESKTOP or CONTAINER_DOCK)
+         * <P>Type: INTEGER</P>
+         */
+        static final String CELLX = "cellX";
+
+        /**
+         * The Y coordinate of the cell holding the favorite
+         * (if container is CONTAINER_DESKTOP)
+         * <P>Type: INTEGER</P>
+         */
+        static final String CELLY = "cellY";
+
+        /**
+         * The X span of the cell holding the favorite
+         * <P>Type: INTEGER</P>
+         */
+        static final String SPANX = "spanX";
+
+        /**
+         * The Y span of the cell holding the favorite
+         * <P>Type: INTEGER</P>
+         */
+        static final String SPANY = "spanY";
+
+        /**
+         * The favorite is a user created folder
+         */
+        static final int ITEM_TYPE_USER_FOLDER = 2;
+
+        /**
+         * The favorite is a live folder
+         */
+        static final int ITEM_TYPE_LIVE_FOLDER = 3;
+
+        /**
+         * The favorite is a widget
+         */
+        static final int ITEM_TYPE_APPWIDGET = 4;
+
+        /**
+         * The favorite is a clock
+         */
+        static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
+
+        /**
+         * The favorite is a search widget
+         */
+        static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
+
+        /**
+         * The favorite is a photo frame
+         */
+        static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
+
+        /**
+         * The appWidgetId of the widget
+         *
+         * <P>Type: INTEGER</P>
+         */
+        static final String APPWIDGET_ID = "appWidgetId";
+        
+        /**
+         * Indicates whether this favorite is an application-created shortcut or not.
+         * If the value is 0, the favorite is not an application-created shortcut, if the
+         * value is 1, it is an application-created shortcut.
+         * <P>Type: INTEGER</P>
+         */
+        @Deprecated
+        static final String IS_SHORTCUT = "isShortcut";
+
+        /**
+         * The URI associated with the favorite. It is used, for instance, by
+         * live folders to find the content provider.
+         * <P>Type: TEXT</P>
+         */
+        static final String URI = "uri";
+
+        /**
+         * The display mode if the item is a live folder.
+         * <P>Type: INTEGER</P>
+         *
+         * @see android.provider.LiveFolders#DISPLAY_MODE_GRID
+         * @see android.provider.LiveFolders#DISPLAY_MODE_LIST
+         */
+        static final String DISPLAY_MODE = "displayMode";
+    }
+}
diff --git a/src/com/android/launcher2/LiveFolder.java b/src/com/android/launcher2/LiveFolder.java
new file mode 100644
index 0000000..ecd9bdf
--- /dev/null
+++ b/src/com/android/launcher2/LiveFolder.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.Intent;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.AdapterView;
+import android.net.Uri;
+import android.provider.LiveFolders;
+import android.os.AsyncTask;
+import android.database.Cursor;
+
+import java.lang.ref.WeakReference;
+
+public class LiveFolder extends Folder {
+    private AsyncTask<LiveFolderInfo,Void,Cursor> mLoadingTask;
+
+    public LiveFolder(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    static LiveFolder fromXml(Context context, FolderInfo folderInfo) {
+        final int layout = isDisplayModeList(folderInfo) ?
+                R.layout.live_folder_list : R.layout.live_folder_grid;
+        return (LiveFolder) LayoutInflater.from(context).inflate(layout, null);
+    }
+
+    private static boolean isDisplayModeList(FolderInfo folderInfo) {
+        return ((LiveFolderInfo) folderInfo).displayMode ==
+                LiveFolders.DISPLAY_MODE_LIST;
+    }
+
+    @Override
+    public void onItemClick(AdapterView parent, View v, int position, long id) {
+        LiveFolderAdapter.ViewHolder holder = (LiveFolderAdapter.ViewHolder) v.getTag();
+
+        if (holder.useBaseIntent) {
+            final Intent baseIntent = ((LiveFolderInfo) mInfo).baseIntent;
+            if (baseIntent != null) {
+                final Intent intent = new Intent(baseIntent);
+                Uri uri = baseIntent.getData();
+                uri = uri.buildUpon().appendPath(Long.toString(holder.id)).build();
+                intent.setData(uri);
+                mLauncher.startActivitySafely(intent);
+            }
+        } else if (holder.intent != null) {
+            mLauncher.startActivitySafely(holder.intent);
+        }
+    }
+
+    @Override
+    public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
+        return false;
+    }
+
+    void bind(FolderInfo info) {
+        super.bind(info);
+        if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
+            mLoadingTask.cancel(true);
+        }
+        mLoadingTask = new FolderLoadingTask(this).execute((LiveFolderInfo) info);
+    }
+
+    @Override
+    void onOpen() {
+        super.onOpen();
+        requestFocus();
+    }
+
+    @Override
+    void onClose() {
+        super.onClose();
+        if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
+            mLoadingTask.cancel(true);
+        }
+
+        // The adapter can be null if onClose() is called before FolderLoadingTask
+        // is done querying the provider
+        final LiveFolderAdapter adapter = (LiveFolderAdapter) mContent.getAdapter();
+        if (adapter != null) {
+            adapter.cleanup();
+        }
+    }
+
+    static class FolderLoadingTask extends AsyncTask<LiveFolderInfo, Void, Cursor> {
+        private final WeakReference<LiveFolder> mFolder;
+        private LiveFolderInfo mInfo;
+
+        FolderLoadingTask(LiveFolder folder) {
+            mFolder = new WeakReference<LiveFolder>(folder);
+        }
+
+        protected Cursor doInBackground(LiveFolderInfo... params) {
+            final LiveFolder folder = mFolder.get();
+            if (folder != null) {
+                mInfo = params[0];
+                return LiveFolderAdapter.query(folder.mLauncher, mInfo);
+            }
+            return null;
+        }
+
+        @Override
+        protected void onPostExecute(Cursor cursor) {
+            if (!isCancelled()) {
+                if (cursor != null) {
+                    final LiveFolder folder = mFolder.get();
+                    if (folder != null) {
+                        final Launcher launcher = folder.mLauncher;
+                        folder.setContentAdapter(new LiveFolderAdapter(launcher, mInfo, cursor));
+                    }
+                }
+            } else if (cursor != null) {
+                cursor.close();
+            }
+        }
+    }
+}
diff --git a/src/com/android/launcher2/LiveFolderAdapter.java b/src/com/android/launcher2/LiveFolderAdapter.java
new file mode 100644
index 0000000..b0e9eff
--- /dev/null
+++ b/src/com/android/launcher2/LiveFolderAdapter.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.widget.CursorAdapter;
+import android.widget.TextView;
+import android.widget.ImageView;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.content.pm.PackageManager;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.LayoutInflater;
+import android.database.Cursor;
+import android.provider.LiveFolders;
+import android.graphics.drawable.Drawable;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.lang.ref.SoftReference;
+
+class LiveFolderAdapter extends CursorAdapter {
+    private boolean mIsList;
+    private LayoutInflater mInflater;
+
+    private final HashMap<String, Drawable> mIcons = new HashMap<String, Drawable>();
+    private final HashMap<Long, SoftReference<Drawable>> mCustomIcons =
+            new HashMap<Long, SoftReference<Drawable>>();
+    private final Launcher mLauncher;
+
+    LiveFolderAdapter(Launcher launcher, LiveFolderInfo info, Cursor cursor) {
+        super(launcher, cursor, true);
+        mIsList = info.displayMode == LiveFolders.DISPLAY_MODE_LIST;
+        mInflater = LayoutInflater.from(launcher);
+        mLauncher = launcher;
+
+        mLauncher.startManagingCursor(getCursor());
+    }
+
+    static Cursor query(Context context, LiveFolderInfo info) {
+        return context.getContentResolver().query(info.uri, null, null,
+                null, LiveFolders.NAME + " ASC");
+    }
+
+    public View newView(Context context, Cursor cursor, ViewGroup parent) {
+        View view;
+        final ViewHolder holder = new ViewHolder();
+
+        if (!mIsList) {
+            view = mInflater.inflate(R.layout.application_boxed, parent, false);
+        } else {
+            view = mInflater.inflate(R.layout.application_list, parent, false);
+            holder.description = (TextView) view.findViewById(R.id.description);
+            holder.icon = (ImageView) view.findViewById(R.id.icon);
+        }
+
+        holder.name = (TextView) view.findViewById(R.id.name);
+
+        holder.idIndex = cursor.getColumnIndexOrThrow(LiveFolders._ID);
+        holder.nameIndex = cursor.getColumnIndexOrThrow(LiveFolders.NAME);
+        holder.descriptionIndex = cursor.getColumnIndex(LiveFolders.DESCRIPTION);
+        holder.intentIndex = cursor.getColumnIndex(LiveFolders.INTENT);
+        holder.iconBitmapIndex = cursor.getColumnIndex(LiveFolders.ICON_BITMAP);
+        holder.iconResourceIndex = cursor.getColumnIndex(LiveFolders.ICON_RESOURCE);
+        holder.iconPackageIndex = cursor.getColumnIndex(LiveFolders.ICON_PACKAGE);
+
+        view.setTag(holder);
+
+        return view;
+    }
+
+    public void bindView(View view, Context context, Cursor cursor) {
+        final ViewHolder holder = (ViewHolder) view.getTag();
+
+        holder.id = cursor.getLong(holder.idIndex);
+        final Drawable icon = loadIcon(context, cursor, holder);
+
+        holder.name.setText(cursor.getString(holder.nameIndex));
+
+        if (!mIsList) {
+            holder.name.setCompoundDrawablesWithIntrinsicBounds(null, icon, null, null);
+        } else {
+            final boolean hasIcon = icon != null;
+            holder.icon.setVisibility(hasIcon ? View.VISIBLE : View.GONE);
+            if (hasIcon) holder.icon.setImageDrawable(icon);
+
+            if (holder.descriptionIndex != -1) {
+                final String description = cursor.getString(holder.descriptionIndex);
+                if (description != null) {
+                    holder.description.setText(description);
+                    holder.description.setVisibility(View.VISIBLE);
+                } else {
+                    holder.description.setVisibility(View.GONE);                    
+                }
+            } else {
+                holder.description.setVisibility(View.GONE);                
+            }
+        }
+
+        if (holder.intentIndex != -1) {
+            try {
+                holder.intent = Intent.parseUri(cursor.getString(holder.intentIndex), 0);
+            } catch (URISyntaxException e) {
+                // Ignore
+            }
+        } else {
+            holder.useBaseIntent = true;
+        }
+    }
+
+    private Drawable loadIcon(Context context, Cursor cursor, ViewHolder holder) {
+        Drawable icon = null;
+        byte[] data = null;
+
+        if (holder.iconBitmapIndex != -1) {
+            data = cursor.getBlob(holder.iconBitmapIndex);
+        }
+
+        if (data != null) {
+            final SoftReference<Drawable> reference = mCustomIcons.get(holder.id);
+            if (reference != null) {
+                icon = reference.get();
+            }
+
+            if (icon == null) {
+                final Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
+                icon = new FastBitmapDrawable(Utilities.createBitmapThumbnail(bitmap, mContext));
+                mCustomIcons.put(holder.id, new SoftReference<Drawable>(icon));
+            }
+        } else if (holder.iconResourceIndex != -1 && holder.iconPackageIndex != -1) {
+            final String resource = cursor.getString(holder.iconResourceIndex);
+            icon = mIcons.get(resource);
+            if (icon == null) {
+                try {
+                    final PackageManager packageManager = context.getPackageManager();
+                    Resources resources = packageManager.getResourcesForApplication(
+                            cursor.getString(holder.iconPackageIndex));
+                    final int id = resources.getIdentifier(resource,
+                            null, null);
+                    icon = Utilities.createIconThumbnail(resources.getDrawable(id), mContext);
+                    mIcons.put(resource, icon);
+                } catch (Exception e) {
+                    // Ignore
+                }
+            }
+        }
+
+        return icon;
+    }
+
+    void cleanup() {
+        for (Drawable icon : mIcons.values()) {
+            icon.setCallback(null);
+        }
+        mIcons.clear();
+
+        for (SoftReference<Drawable> icon : mCustomIcons.values()) {
+            final Drawable drawable = icon.get();
+            if (drawable != null) {
+                drawable.setCallback(null);
+            }
+        }
+        mCustomIcons.clear();
+
+        final Cursor cursor = getCursor();
+        if (cursor != null) {
+            try {
+                cursor.close();
+            } finally {
+                mLauncher.stopManagingCursor(cursor);
+            }
+        }
+    }
+
+    static class ViewHolder {
+        TextView name;
+        TextView description;
+        ImageView icon;
+
+        Intent intent;
+        long id;
+        boolean useBaseIntent;
+
+        int idIndex;
+        int nameIndex;
+        int descriptionIndex = -1;
+        int intentIndex = -1;
+        int iconBitmapIndex = -1;
+        int iconResourceIndex = -1;
+        int iconPackageIndex = -1;
+    }
+}
diff --git a/src/com/android/launcher2/LiveFolderIcon.java b/src/com/android/launcher2/LiveFolderIcon.java
new file mode 100644
index 0000000..55f100c
--- /dev/null
+++ b/src/com/android/launcher2/LiveFolderIcon.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.util.AttributeSet;
+import android.view.ViewGroup;
+import android.view.LayoutInflater;
+import android.graphics.drawable.Drawable;
+
+public class LiveFolderIcon extends FolderIcon {
+    public LiveFolderIcon(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public LiveFolderIcon(Context context) {
+        super(context);
+    }
+
+    static LiveFolderIcon fromXml(int resId, Launcher launcher, ViewGroup group,
+            LiveFolderInfo folderInfo) {
+
+        LiveFolderIcon icon = (LiveFolderIcon)
+                LayoutInflater.from(launcher).inflate(resId, group, false);
+
+        final Resources resources = launcher.getResources();
+        Drawable d = folderInfo.icon;
+        if (d == null) {
+            d = Utilities.createIconThumbnail(resources.getDrawable(R.drawable.ic_launcher_folder),
+                    launcher);
+            folderInfo.filtered = true;
+        }
+        icon.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+        icon.setText(folderInfo.title);
+        icon.setTag(folderInfo);
+        icon.setOnClickListener(launcher);
+        
+        return icon;
+    }
+
+    @Override
+    public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        return false;
+    }
+
+    @Override
+    public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    @Override
+    public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    @Override
+    public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    @Override
+    public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+}
diff --git a/src/com/android/launcher2/LiveFolderInfo.java b/src/com/android/launcher2/LiveFolderInfo.java
new file mode 100644
index 0000000..5b1217c
--- /dev/null
+++ b/src/com/android/launcher2/LiveFolderInfo.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ContentValues;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+
+class LiveFolderInfo extends FolderInfo {
+
+    /**
+     * The base intent, if it exists.
+     */
+    Intent baseIntent;
+
+    /**
+     * The live folder's content uri.
+     */
+    Uri uri;
+
+    /**
+     * The live folder's display type.
+     */
+    int displayMode;
+
+    /**
+     * The live folder icon.
+     */
+    Drawable icon;
+
+    /**
+     * When set to true, indicates that the icon has been resized.
+     */
+    boolean filtered;
+
+    /**
+     * Reference to the live folder icon as an application's resource.
+     */
+    Intent.ShortcutIconResource iconResource;
+
+    LiveFolderInfo() {
+        itemType = LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER;
+    }
+
+    @Override
+    void onAddToDatabase(ContentValues values) {
+        super.onAddToDatabase(values);
+        values.put(LauncherSettings.Favorites.TITLE, title.toString());
+        values.put(LauncherSettings.Favorites.URI, uri.toString());
+        if (baseIntent != null) {
+            values.put(LauncherSettings.Favorites.INTENT, baseIntent.toUri(0));
+        }
+        values.put(LauncherSettings.Favorites.ICON_TYPE, LauncherSettings.Favorites.ICON_TYPE_RESOURCE);
+        values.put(LauncherSettings.Favorites.DISPLAY_MODE, displayMode);
+        if (iconResource != null) {
+            values.put(LauncherSettings.Favorites.ICON_PACKAGE, iconResource.packageName);
+            values.put(LauncherSettings.Favorites.ICON_RESOURCE, iconResource.resourceName);
+        }
+    }
+}
diff --git a/src/com/android/launcher2/Search.java b/src/com/android/launcher2/Search.java
new file mode 100644
index 0000000..283042d
--- /dev/null
+++ b/src/com/android/launcher2/Search.java
@@ -0,0 +1,380 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.app.Activity;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Configuration;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnKeyListener;
+import android.view.View.OnLongClickListener;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.view.animation.Animation;
+import android.view.animation.Interpolator;
+import android.view.animation.Transformation;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+public class Search extends LinearLayout 
+        implements OnClickListener, OnKeyListener, OnLongClickListener {
+
+    // Speed at which the widget slides up/down, in pixels/ms.
+    private static final float ANIMATION_VELOCITY = 1.0f;
+
+    /** The distance in dips between the optical top of the widget and the top if its bounds */
+    private static final float WIDGET_TOP_OFFSET = 9;
+
+    
+    private final String TAG = "Launcher.SearchWidget";
+
+    private Launcher mLauncher;
+
+    private TextView mSearchText;
+    private ImageButton mVoiceButton;
+
+    /** The animation that morphs the search widget to the search dialog. */
+    private Animation mMorphAnimation;
+
+    /** The animation that morphs the search widget back to its normal position. */
+    private Animation mUnmorphAnimation;
+
+    // These four are passed to Launcher.startSearch() when the search widget
+    // has finished morphing. They are instance variables to make it possible to update
+    // them while the widget is morphing.
+    private String mInitialQuery;
+    private boolean mSelectInitialQuery;    
+    private Bundle mAppSearchData;
+    private boolean mGlobalSearch;
+
+    // For voice searching
+    private Intent mVoiceSearchIntent;
+    
+    private int mWidgetTopOffset;
+
+    /**
+     * Used to inflate the Workspace from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attributes set containing the Workspace's customization values.
+     */
+    public Search(Context context, AttributeSet attrs) {
+        super(context, attrs);
+
+        final float scale = context.getResources().getDisplayMetrics().density;
+        mWidgetTopOffset = Math.round(WIDGET_TOP_OFFSET * scale);
+        
+        Interpolator interpolator = new AccelerateDecelerateInterpolator();
+
+        mMorphAnimation = new ToParentOriginAnimation();
+        // no need to apply transformation before the animation starts,
+        // since the gadget is already in its normal place.
+        mMorphAnimation.setFillBefore(false);
+        // stay in the top position after the animation finishes
+        mMorphAnimation.setFillAfter(true);
+        mMorphAnimation.setInterpolator(interpolator);
+        mMorphAnimation.setAnimationListener(new Animation.AnimationListener() {
+            // The amount of time before the animation ends to show the search dialog.
+            private static final long TIME_BEFORE_ANIMATION_END = 80;
+            
+            // The runnable which we'll pass to our handler to show the search dialog.
+            private final Runnable mShowSearchDialogRunnable = new Runnable() {
+                public void run() {
+                    showSearchDialog();
+                }
+            };
+            
+            public void onAnimationEnd(Animation animation) { }
+            public void onAnimationRepeat(Animation animation) { }
+            public void onAnimationStart(Animation animation) {
+                // Make the search dialog show up ideally *just* as the animation reaches
+                // the top, to aid the illusion that the widget becomes the search dialog.
+                // Otherwise, there is a short delay when the widget reaches the top before
+                // the search dialog shows. We do this roughly 80ms before the animation ends.
+                getHandler().postDelayed(
+                        mShowSearchDialogRunnable,
+                        Math.max(mMorphAnimation.getDuration() - TIME_BEFORE_ANIMATION_END, 0));
+            }
+        });
+
+        mUnmorphAnimation = new FromParentOriginAnimation();
+        // stay in the top position until the animation starts
+        mUnmorphAnimation.setFillBefore(true);
+        // no need to apply transformation after the animation finishes,
+        // since the gadget is now back in its normal place.
+        mUnmorphAnimation.setFillAfter(false);
+        mUnmorphAnimation.setInterpolator(interpolator);
+        mUnmorphAnimation.setAnimationListener(new Animation.AnimationListener(){
+            public void onAnimationEnd(Animation animation) {
+                clearAnimation();
+            }
+            public void onAnimationRepeat(Animation animation) { }
+            public void onAnimationStart(Animation animation) { }
+        });
+        
+        mVoiceSearchIntent = new Intent(android.speech.RecognizerIntent.ACTION_WEB_SEARCH);
+        mVoiceSearchIntent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL,
+                android.speech.RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
+    }
+
+    /**
+     * Implements OnClickListener.
+     */
+    public void onClick(View v) {
+        if (v == mVoiceButton) {
+            startVoiceSearch();
+        } else {
+            mLauncher.onSearchRequested();
+        }
+    }
+
+    private void startVoiceSearch() {
+        try {
+            getContext().startActivity(mVoiceSearchIntent);
+        } catch (ActivityNotFoundException ex) {
+            // Should not happen, since we check the availability of
+            // voice search before showing the button. But just in case...
+            Log.w(TAG, "Could not find voice search activity");
+        }
+    }
+
+    /**
+     * Sets the query text. The query field is not editable, instead we forward
+     * the key events to the launcher, which keeps track of the text, 
+     * calls setQuery() to show it, and gives it to the search dialog.
+     */
+    public void setQuery(String query) {
+        mSearchText.setText(query, TextView.BufferType.NORMAL);
+    }
+
+    /**
+     * Morph the search gadget to the search dialog.
+     * See {@link Activity#startSearch()} for the arguments.
+     */
+    public void startSearch(String initialQuery, boolean selectInitialQuery, 
+            Bundle appSearchData, boolean globalSearch) {
+        mInitialQuery = initialQuery;
+        mSelectInitialQuery = selectInitialQuery;
+        mAppSearchData = appSearchData;
+        mGlobalSearch = globalSearch;
+        
+        if (isAtTop()) {
+            showSearchDialog();
+        } else {
+            // Call up the keyboard before we actually call the search dialog so that it
+            // (hopefully) animates in at about the same time as the widget animation, and
+            // so that it becomes available as soon as possible. Only do this if a hard
+            // keyboard is not currently available.
+            if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
+                    Configuration.HARDKEYBOARDHIDDEN_YES) {
+                InputMethodManager inputManager = (InputMethodManager)
+                        getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+                inputManager.showSoftInputUnchecked(0, null);
+            }
+            
+            // Start the animation, unless it has already started.
+            if (getAnimation() != mMorphAnimation) {
+                mMorphAnimation.setDuration(getAnimationDuration());
+                startAnimation(mMorphAnimation);
+            }
+        }
+    }
+
+    /**
+     * Shows the system search dialog immediately, without any animation.
+     */
+    private void showSearchDialog() {
+        mLauncher.showSearchDialog(
+                mInitialQuery, mSelectInitialQuery, mAppSearchData, mGlobalSearch);
+    }
+
+    /**
+     * Restore the search gadget to its normal position.
+     * 
+     * @param animate Whether to animate the movement of the gadget.
+     */
+    public void stopSearch(boolean animate) {
+        setQuery("");
+        
+        // Only restore if we are not already restored.
+        if (getAnimation() == mMorphAnimation) {
+            if (animate && !isAtTop()) {
+                mUnmorphAnimation.setDuration(getAnimationDuration());
+                startAnimation(mUnmorphAnimation);
+            } else {
+                clearAnimation();
+            }
+        }
+    }
+
+    private boolean isAtTop() {
+        return getWidgetTop() == 0;
+    }
+
+    private int getAnimationDuration() {
+        return (int) (getWidgetTop() / ANIMATION_VELOCITY);
+    }
+
+    /**
+     * Modify clearAnimation() to invalidate the parent. This works around
+     * an issue where the region where the end of the animation placed the view
+     * was not redrawn after clearing the animation.
+     */
+    @Override
+    public void clearAnimation() {
+        Animation animation = getAnimation();
+        if (animation != null) {
+            super.clearAnimation();
+            if (animation.hasEnded() 
+                    && animation.getFillAfter()
+                    && animation.willChangeBounds()) {
+                View parent = (View) getParent();
+                if (parent != null) parent.invalidate();
+            } else {
+                invalidate();
+            }
+        }
+    }
+    
+    public boolean onKey(View v, int keyCode, KeyEvent event) {
+        if (!event.isSystem() && 
+                (keyCode != KeyEvent.KEYCODE_DPAD_UP) &&
+                (keyCode != KeyEvent.KEYCODE_DPAD_DOWN) &&
+                (keyCode != KeyEvent.KEYCODE_DPAD_LEFT) &&
+                (keyCode != KeyEvent.KEYCODE_DPAD_RIGHT) &&
+                (keyCode != KeyEvent.KEYCODE_DPAD_CENTER)) {
+            // Forward key events to Launcher, which will forward text 
+            // to search dialog
+            switch (event.getAction()) {
+                case KeyEvent.ACTION_DOWN:
+                    return mLauncher.onKeyDown(keyCode, event);
+                case KeyEvent.ACTION_MULTIPLE:
+                    return mLauncher.onKeyMultiple(keyCode, event.getRepeatCount(), event);
+                case KeyEvent.ACTION_UP:
+                    return mLauncher.onKeyUp(keyCode, event);
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Implements OnLongClickListener to pass long clicks on child views 
+     * to the widget. This makes it possible to pick up the widget by long
+     * clicking on the text field or a button.
+     */
+    public boolean onLongClick(View v) {
+        return performLongClick();
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        mSearchText = (TextView) findViewById(R.id.search_src_text);
+        mVoiceButton = (ImageButton) findViewById(R.id.search_voice_btn);
+        
+        mSearchText.setOnKeyListener(this);
+
+        mSearchText.setOnClickListener(this);
+        mVoiceButton.setOnClickListener(this);
+        setOnClickListener(this);        
+
+        mSearchText.setOnLongClickListener(this);
+        mVoiceButton.setOnLongClickListener(this);
+
+        // Set the placeholder text to be the Google logo within the search widget.
+        Drawable googlePlaceholder =
+                getContext().getResources().getDrawable(R.drawable.placeholder_google);
+        mSearchText.setCompoundDrawablesWithIntrinsicBounds(googlePlaceholder, null, null, null);
+
+        configureVoiceSearchButton();
+    }
+    
+    @Override
+    public void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+    }
+
+    /**
+     * If appropriate &amp; available, configure voice search
+     * 
+     * Note:  Because the home screen search widget is always web search, we only check for
+     * getVoiceSearchLaunchWebSearch() modes.  We don't support the alternate form of app-specific
+     * voice search.
+     */
+    private void configureVoiceSearchButton() {
+        // Enable the voice search button if there is an activity that can handle it
+        PackageManager pm = getContext().getPackageManager();
+        ResolveInfo ri = pm.resolveActivity(mVoiceSearchIntent,
+                PackageManager.MATCH_DEFAULT_ONLY);
+        boolean voiceSearchVisible = ri != null;
+
+        // finally, set visible state of voice search button, as appropriate
+        mVoiceButton.setVisibility(voiceSearchVisible ? View.VISIBLE : View.GONE);
+    }
+    
+    /**
+     * Sets the {@link Launcher} that this gadget will call on to display the search dialog. 
+     */
+    public void setLauncher(Launcher launcher) {
+        mLauncher = launcher;
+    }
+        
+    /** 
+     * Moves the view to the top left corner of its parent.
+     */
+    private class ToParentOriginAnimation extends Animation {
+        @Override
+        protected void applyTransformation(float interpolatedTime, Transformation t) {
+            float dx = -getLeft() * interpolatedTime;
+            float dy = -getWidgetTop() * interpolatedTime;
+            t.getMatrix().setTranslate(dx, dy);
+        }
+    }
+
+    /** 
+     * Moves the view from the top left corner of its parent.
+     */
+    private class FromParentOriginAnimation extends Animation {
+        @Override
+        protected void applyTransformation(float interpolatedTime, Transformation t) {
+            float dx = -getLeft() * (1.0f - interpolatedTime);
+            float dy = -getWidgetTop() * (1.0f - interpolatedTime);
+            t.getMatrix().setTranslate(dx, dy);
+        }
+    }
+
+    /**
+     * The widget is centered vertically within it's 4x1 slot. This is accomplished by nesting
+     * the actual widget inside another view. For animation purposes, we care about the top of the
+     * actual widget rather than it's container. This method return the top of the actual widget.
+     */
+    private int getWidgetTop() {
+        return getTop() + getChildAt(0).getTop() + mWidgetTopOffset;
+    }
+}
diff --git a/src/com/android/launcher2/SymmetricalLinearTween.java b/src/com/android/launcher2/SymmetricalLinearTween.java
new file mode 100644
index 0000000..2e0ed8f
--- /dev/null
+++ b/src/com/android/launcher2/SymmetricalLinearTween.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.os.Handler;
+import android.os.Message;
+import android.os.SystemClock;
+import android.util.Log;
+
+/**
+ * Provides an animation between 0.0f and 1.0f over a given duration.
+ */
+class SymmetricalLinearTween {
+
+    private static final int FPS = 30;
+    private static final int FRAME_TIME = 1000 / FPS;
+
+    Handler mHandler;
+    int mDuration;
+    TweenCallback mCallback;
+
+    boolean mRunning;
+    long mBase;
+    boolean mDirection;
+    float mValue;
+
+    /**
+     * @param duration milliseconds duration
+     * @param callback callbacks
+     */
+    public SymmetricalLinearTween(boolean initial, int duration, TweenCallback callback) {
+        mValue = initial ? 1.0f : 0.0f;
+        mDirection = initial;
+        mDuration = duration;
+        mCallback = callback;
+        mHandler = new Handler();
+    }
+
+    /**
+     * Starts the tweening.
+     *
+     * @param direction If direction is true, the value goes towards 1.0f.  If direction
+     *                  is false, the value goes towards 0.0f.
+     */
+    public void start(boolean direction) {
+        start(direction, SystemClock.uptimeMillis());
+    }
+
+    /**
+     * Starts the tweening.
+     *
+     * @param direction If direction is true, the value goes towards 1.0f.  If direction
+     *                  is false, the value goes towards 0.0f.
+     * @param baseTime  The time to use as zero for this animation, in the
+     *                  {@link SystemClock.uptimeMillis} time base.  This allows you to
+     *                  synchronize multiple animations.
+     */
+    public void start(boolean direction, long baseTime) {
+        if (direction != mDirection) {
+            if (!mRunning) {
+                mBase = baseTime;
+                mRunning = true;
+                mCallback.onTweenStarted();
+                long next = SystemClock.uptimeMillis() + FRAME_TIME;
+                mHandler.postAtTime(mTick, next);
+            } else {
+                // reverse direction
+                long now = SystemClock.uptimeMillis();
+                long diff = now - mBase;
+                mBase = now + diff - mDuration;
+            }
+            mDirection = direction;
+        }
+    }
+
+    Runnable mTick = new Runnable() {
+        public void run() {
+            long base = mBase;
+            long now = SystemClock.uptimeMillis();
+            long diff = now-base;
+            int duration = mDuration;
+            float val = diff/(float)duration;
+            if (!mDirection) {
+                val = 1.0f - val;
+            }
+            if (val > 1.0f) {
+                val = 1.0f;
+            } else if (val < 0.0f) {
+                val = 0.0f;
+            }
+            float old = mValue;
+            mValue = val;
+            mCallback.onTweenValueChanged(val, old);
+            int frame = (int)(diff / FRAME_TIME);
+            long next = base + ((frame+1)*FRAME_TIME);
+            if (diff < duration) {
+                mHandler.postAtTime(this, next);
+            }
+            if (diff >= duration) {
+                mCallback.onTweenFinished();
+                mRunning = false;
+            }
+        }
+    };
+}
+
diff --git a/src/com/android/launcher2/TweenCallback.java b/src/com/android/launcher2/TweenCallback.java
new file mode 100644
index 0000000..380a217
--- /dev/null
+++ b/src/com/android/launcher2/TweenCallback.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+interface TweenCallback {
+    void onTweenValueChanged(float value, float oldValue);
+    void onTweenStarted();
+    void onTweenFinished();
+}
+
diff --git a/src/com/android/launcher2/UninstallShortcutReceiver.java b/src/com/android/launcher2/UninstallShortcutReceiver.java
new file mode 100644
index 0000000..e65c6a0
--- /dev/null
+++ b/src/com/android/launcher2/UninstallShortcutReceiver.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ContentResolver;
+import android.database.Cursor;
+import android.net.Uri;
+import android.widget.Toast;
+
+import java.net.URISyntaxException;
+
+public class UninstallShortcutReceiver extends BroadcastReceiver {
+    private static final String ACTION_UNINSTALL_SHORTCUT =
+            "com.android.launcher.action.UNINSTALL_SHORTCUT";
+
+    public void onReceive(Context context, Intent data) {
+        if (!ACTION_UNINSTALL_SHORTCUT.equals(data.getAction())) {
+            return;
+        }
+
+        Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
+        String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+        boolean duplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true);
+
+        if (intent != null && name != null) {
+            final ContentResolver cr = context.getContentResolver();
+            Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
+                new String[] { LauncherSettings.Favorites._ID, LauncherSettings.Favorites.INTENT },
+                LauncherSettings.Favorites.TITLE + "=?", new String[] { name }, null);
+
+            final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
+            final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
+
+            boolean changed = false;
+
+            try {
+                while (c.moveToNext()) {
+                    try {
+                        if (intent.filterEquals(Intent.parseUri(c.getString(intentIndex), 0))) {
+                            final long id = c.getLong(idIndex);
+                            final Uri uri = LauncherSettings.Favorites.getContentUri(id, false);
+                            cr.delete(uri, null, null);
+                            changed = true;
+                            if (!duplicate) {
+                                break;
+                            }
+                        }
+                    } catch (URISyntaxException e) {
+                        // Ignore
+                    }
+                }
+            } finally {
+                c.close();
+            }
+
+            if (changed) {
+                cr.notifyChange(LauncherSettings.Favorites.CONTENT_URI, null);
+                Toast.makeText(context, context.getString(R.string.shortcut_uninstalled, name),
+                        Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+}
diff --git a/src/com/android/launcher2/UserFolder.java b/src/com/android/launcher2/UserFolder.java
new file mode 100644
index 0000000..16fe616
--- /dev/null
+++ b/src/com/android/launcher2/UserFolder.java
@@ -0,0 +1,93 @@
+package com.android.launcher2;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ArrayAdapter;
+
+/**
+ * Folder which contains applications or shortcuts chosen by the user.
+ *
+ */
+public class UserFolder extends Folder implements DropTarget {
+    private static final String TAG = "Launcher.UserFolder";
+
+    public UserFolder(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+    
+    /**
+     * Creates a new UserFolder, inflated from R.layout.user_folder.
+     *
+     * @param context The application's context.
+     *
+     * @return A new UserFolder.
+     */
+    static UserFolder fromXml(Context context) {
+        return (UserFolder) LayoutInflater.from(context).inflate(R.layout.user_folder, null);
+    }
+
+    public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        final ItemInfo item = (ItemInfo) dragInfo;
+        final int itemType = item.itemType;
+        return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
+                    itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT)
+                && item.container != mInfo.id;
+    }
+    
+    public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo, Rect recycle) {
+        return null;
+    }
+
+    public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        ApplicationInfo item = (ApplicationInfo) dragInfo;
+        if (item.container == NO_ID) {
+            // Came from all apps -- make a copy
+            item = new ApplicationInfo((ApplicationInfo)item);
+        }
+        //noinspection unchecked
+        ((ArrayAdapter<ApplicationInfo>) mContent.getAdapter()).add((ApplicationInfo) dragInfo);
+        LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, 0, 0);
+    }
+
+    public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    @Override
+    public void onDropCompleted(View target, boolean success) {
+        if (success) {
+            //noinspection unchecked
+            ArrayAdapter<ApplicationInfo> adapter =
+                    (ArrayAdapter<ApplicationInfo>) mContent.getAdapter();
+            adapter.remove(mDragItem);
+        }
+    }
+
+    void bind(FolderInfo info) {
+        super.bind(info);
+        setContentAdapter(new ApplicationsAdapter(mContext, ((UserFolderInfo) info).contents));
+    }
+
+    // When the folder opens, we need to refresh the GridView's selection by
+    // forcing a layout
+    @Override
+    void onOpen() {
+        super.onOpen();
+        requestFocus();
+    }
+}
diff --git a/src/com/android/launcher2/UserFolderInfo.java b/src/com/android/launcher2/UserFolderInfo.java
new file mode 100644
index 0000000..75b19ee
--- /dev/null
+++ b/src/com/android/launcher2/UserFolderInfo.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ContentValues;
+
+import java.util.ArrayList;
+
+/**
+ * Represents a folder containing shortcuts or apps.
+ */
+class UserFolderInfo extends FolderInfo {
+    /**
+     * The apps and shortcuts 
+     */
+    ArrayList<ApplicationInfo> contents = new ArrayList<ApplicationInfo>();
+    
+    UserFolderInfo() {
+        itemType = LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER;
+    }
+    
+    /**
+     * Add an app or shortcut
+     * 
+     * @param item
+     */
+    public void add(ApplicationInfo item) {
+        contents.add(item);
+    }
+    
+    /**
+     * Remove an app or shortcut. Does not change the DB.
+     * 
+     * @param item
+     */
+    public void remove(ApplicationInfo item) {
+        contents.remove(item);
+    }
+    
+    @Override
+    void onAddToDatabase(ContentValues values) { 
+        super.onAddToDatabase(values);
+        values.put(LauncherSettings.Favorites.TITLE, title.toString());
+    }
+}
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
new file mode 100644
index 0000000..55cb509
--- /dev/null
+++ b/src/com/android/launcher2/Utilities.java
@@ -0,0 +1,484 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.PaintDrawable;
+import android.graphics.Bitmap;
+import android.graphics.BlurMaskFilter;
+import android.graphics.Canvas;
+import android.graphics.MaskFilter;
+import android.graphics.Paint;
+import android.graphics.PaintFlagsDrawFilter;
+import android.graphics.PixelFormat;
+import android.graphics.PorterDuff;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.TableMaskFilter;
+import android.graphics.Typeface;
+import android.text.Layout.Alignment;
+import android.text.StaticLayout;
+import android.text.TextPaint;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.content.res.Resources;
+import android.content.Context;
+
+/**
+ * Various utilities shared amongst the Launcher's classes.
+ */
+final class Utilities {
+    private static final String TAG = "Launcher.Utilities";
+
+    private static final boolean TEXT_BURN = false;
+
+    private static int sIconWidth = -1;
+    private static int sIconHeight = -1;
+    private static int sIconTextureWidth = -1;
+    private static int sIconTextureHeight = -1;
+
+    private static final Paint sPaint = new Paint();
+    private static final Paint sBlurPaint = new Paint();
+    private static final Paint sGlowColorPressedPaint = new Paint();
+    private static final Paint sGlowColorFocusedPaint = new Paint();
+    private static final Paint sEmptyPaint = new Paint();
+    private static final Rect sBounds = new Rect();
+    private static final Rect sOldBounds = new Rect();
+    private static final Canvas sCanvas = new Canvas();
+
+    static {
+        sCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
+                Paint.FILTER_BITMAP_FLAG));
+    }
+
+    static Bitmap centerToFit(Bitmap bitmap, int width, int height, Context context) {
+        final int bitmapWidth = bitmap.getWidth();
+        final int bitmapHeight = bitmap.getHeight();
+
+        if (bitmapWidth < width || bitmapHeight < height) {
+            int color = context.getResources().getColor(R.color.window_background);
+
+            Bitmap centered = Bitmap.createBitmap(bitmapWidth < width ? width : bitmapWidth,
+                    bitmapHeight < height ? height : bitmapHeight, Bitmap.Config.RGB_565);
+            centered.setDensity(bitmap.getDensity());
+            Canvas canvas = new Canvas(centered);
+            canvas.drawColor(color);
+            canvas.drawBitmap(bitmap, (width - bitmapWidth) / 2.0f, (height - bitmapHeight) / 2.0f,
+                    null);
+
+            bitmap = centered;
+        }
+
+        return bitmap;
+    }
+
+    /**
+     * Returns a Drawable representing the thumbnail of the specified Drawable.
+     * The size of the thumbnail is defined by the dimension
+     * android.R.dimen.launcher_application_icon_size.
+     *
+     * @param icon The icon to get a thumbnail of.
+     * @param context The application's context.
+     *
+     * @return A thumbnail for the specified icon or the icon itself if the
+     *         thumbnail could not be created.
+     */
+    static Drawable createIconThumbnail(Drawable icon, Context context) {
+        synchronized (sCanvas) { // we share the statics :-(
+            if (sIconWidth == -1) {
+                initStatics(context);
+            }
+
+            int width = sIconWidth;
+            int height = sIconHeight;
+
+            if (icon instanceof PaintDrawable) {
+                PaintDrawable painter = (PaintDrawable) icon;
+                painter.setIntrinsicWidth(width);
+                painter.setIntrinsicHeight(height);
+            } else if (icon instanceof BitmapDrawable) {
+                // Ensure the bitmap has a density.
+                BitmapDrawable bitmapDrawable = (BitmapDrawable) icon;
+                Bitmap bitmap = bitmapDrawable.getBitmap();
+                if (bitmap.getDensity() == Bitmap.DENSITY_NONE) {
+                    bitmapDrawable.setTargetDensity(context.getResources().getDisplayMetrics());
+                }
+            }
+            int iconWidth = icon.getIntrinsicWidth();
+            int iconHeight = icon.getIntrinsicHeight();
+
+            if (iconWidth > 0 && iconHeight > 0) {
+                if (width < iconWidth || height < iconHeight) {
+                    final float ratio = (float) iconWidth / iconHeight;
+
+                    if (iconWidth > iconHeight) {
+                        height = (int) (width / ratio);
+                    } else if (iconHeight > iconWidth) {
+                        width = (int) (height * ratio);
+                    }
+
+                    final Bitmap.Config c = icon.getOpacity() != PixelFormat.OPAQUE ?
+                                Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565;
+                    final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+                    final Canvas canvas = sCanvas;
+                    canvas.setBitmap(thumb);
+                    // Copy the old bounds to restore them later
+                    // If we were to do oldBounds = icon.getBounds(),
+                    // the call to setBounds() that follows would
+                    // change the same instance and we would lose the
+                    // old bounds
+                    sOldBounds.set(icon.getBounds());
+                    final int x = (sIconWidth - width) / 2;
+                    final int y = (sIconHeight - height) / 2;
+                    icon.setBounds(x, y, x + width, y + height);
+                    icon.draw(canvas);
+                    icon.setBounds(sOldBounds);
+                    icon = new FastBitmapDrawable(thumb);
+                } else if (iconWidth < width && iconHeight < height) {
+                    final Bitmap.Config c = Bitmap.Config.ARGB_8888;
+                    final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+                    final Canvas canvas = sCanvas;
+                    canvas.setBitmap(thumb);
+                    sOldBounds.set(icon.getBounds());
+                    final int x = (width - iconWidth) / 2;
+                    final int y = (height - iconHeight) / 2;
+                    icon.setBounds(x, y, x + iconWidth, y + iconHeight);
+                    icon.draw(canvas);
+                    icon.setBounds(sOldBounds);
+                    icon = new FastBitmapDrawable(thumb);
+                }
+            }
+
+            return icon;
+        }
+    }
+
+    static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
+    static int sColorIndex = 0;
+
+    /**
+     * Returns a bitmap suitable for the all apps view.  The bitmap will be a power
+     * of two sized ARGB_8888 bitmap that can be used as a gl texture.
+     */
+    static Bitmap createAllAppsBitmap(Drawable icon, Context context) {
+        synchronized (sCanvas) { // we share the statics :-(
+            if (sIconWidth == -1) {
+                initStatics(context);
+            }
+
+            int width = sIconWidth;
+            int height = sIconHeight;
+
+            if (icon instanceof PaintDrawable) {
+                PaintDrawable painter = (PaintDrawable) icon;
+                painter.setIntrinsicWidth(width);
+                painter.setIntrinsicHeight(height);
+            } else if (icon instanceof BitmapDrawable) {
+                // Ensure the bitmap has a density.
+                BitmapDrawable bitmapDrawable = (BitmapDrawable) icon;
+                Bitmap bitmap = bitmapDrawable.getBitmap();
+                if (bitmap.getDensity() == Bitmap.DENSITY_NONE) {
+                    bitmapDrawable.setTargetDensity(context.getResources().getDisplayMetrics());
+                }
+            }
+            int sourceWidth = icon.getIntrinsicWidth();
+            int sourceHeight = icon.getIntrinsicHeight();
+
+            if (sourceWidth > 0 && sourceWidth > 0) {
+                // There are intrinsic sizes.
+                if (width < sourceWidth || height < sourceHeight) {
+                    // It's too big, scale it down.
+                    final float ratio = (float) sourceWidth / sourceHeight;
+                    if (sourceWidth > sourceHeight) {
+                        height = (int) (width / ratio);
+                    } else if (sourceHeight > sourceWidth) {
+                        width = (int) (height * ratio);
+                    }
+                } else if (sourceWidth < width && sourceHeight < height) {
+                    // It's small, use the size they gave us.
+                    width = sourceWidth;
+                    height = sourceHeight;
+                }
+            }
+
+            // no intrinsic size --> use default size
+            int textureWidth = sIconTextureWidth;
+            int textureHeight = sIconTextureHeight;
+
+            final Bitmap bitmap = Bitmap.createBitmap(textureWidth, textureHeight,
+                    Bitmap.Config.ARGB_8888);
+            final Canvas canvas = sCanvas;
+            canvas.setBitmap(bitmap);
+
+            final int left = (textureWidth-width) / 2;
+            final int top = (textureHeight-height) / 2;
+
+            if (false) {
+                // draw a big box for the icon for debugging
+                canvas.drawColor(sColors[sColorIndex]);
+                if (++sColorIndex >= sColors.length) sColorIndex = 0;
+                Paint debugPaint = new Paint();
+                debugPaint.setColor(0xffcccc00);
+                canvas.drawRect(left, top, left+width, top+height, debugPaint);
+            }
+
+            sOldBounds.set(icon.getBounds());
+            icon.setBounds(left, top, left+width, top+height);
+            icon.draw(canvas);
+            icon.setBounds(sOldBounds);
+
+            return bitmap;
+        }
+    }
+
+    static void drawSelectedAllAppsBitmap(Canvas dest, int destWidth, int destHeight,
+            boolean pressed, Bitmap src) {
+        synchronized (sCanvas) { // we share the statics :-(
+            if (sIconWidth == -1) {
+                // We can't have gotten to here without src being initialized, which
+                // comes from this file already.  So just assert.
+                //initStatics(context);
+                throw new RuntimeException("Assertion failed: Utilities not initialized");
+            }
+
+            dest.drawColor(0, PorterDuff.Mode.CLEAR);
+            
+            int[] xy = new int[2];
+            Bitmap mask = src.extractAlpha(sBlurPaint, xy);
+
+            float px = (destWidth - src.getWidth()) / 2;
+            float py = (destHeight - src.getHeight()) / 2;
+            dest.drawBitmap(mask, px + xy[0], py + xy[1],
+                    pressed ? sGlowColorPressedPaint : sGlowColorFocusedPaint);
+
+            mask.recycle();
+        }
+    }
+
+    /**
+     * Returns a Bitmap representing the thumbnail of the specified Bitmap.
+     * The size of the thumbnail is defined by the dimension
+     * android.R.dimen.launcher_application_icon_size.
+     *
+     * @param bitmap The bitmap to get a thumbnail of.
+     * @param context The application's context.
+     *
+     * @return A thumbnail for the specified bitmap or the bitmap itself if the
+     *         thumbnail could not be created.
+     */
+    static Bitmap createBitmapThumbnail(Bitmap bitmap, Context context) {
+        synchronized (sCanvas) { // we share the statics :-(
+            if (sIconWidth == -1) {
+                initStatics(context);
+            }
+
+            int width = sIconWidth;
+            int height = sIconHeight;
+
+            final int bitmapWidth = bitmap.getWidth();
+            final int bitmapHeight = bitmap.getHeight();
+
+            if (width > 0 && height > 0) {
+                if (width < bitmapWidth || height < bitmapHeight) {
+                    final float ratio = (float) bitmapWidth / bitmapHeight;
+        
+                    if (bitmapWidth > bitmapHeight) {
+                        height = (int) (width / ratio);
+                    } else if (bitmapHeight > bitmapWidth) {
+                        width = (int) (height * ratio);
+                    }
+        
+                    final Bitmap.Config c = (width == sIconWidth && height == sIconHeight) ?
+                            bitmap.getConfig() : Bitmap.Config.ARGB_8888;
+                    final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+                    final Canvas canvas = sCanvas;
+                    final Paint paint = sPaint;
+                    canvas.setBitmap(thumb);
+                    paint.setDither(false);
+                    paint.setFilterBitmap(true);
+                    sBounds.set((sIconWidth - width) / 2, (sIconHeight - height) / 2, width, height);
+                    sOldBounds.set(0, 0, bitmapWidth, bitmapHeight);
+                    canvas.drawBitmap(bitmap, sOldBounds, sBounds, paint);
+                    return thumb;
+                } else if (bitmapWidth < width || bitmapHeight < height) {
+                    final Bitmap.Config c = Bitmap.Config.ARGB_8888;
+                    final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+                    final Canvas canvas = sCanvas;
+                    final Paint paint = sPaint;
+                    canvas.setBitmap(thumb);
+                    paint.setDither(false);
+                    paint.setFilterBitmap(true);
+                    canvas.drawBitmap(bitmap, (sIconWidth - bitmapWidth) / 2,
+                            (sIconHeight - bitmapHeight) / 2, paint);
+                    return thumb;
+                }
+            }
+
+            return bitmap;
+        }
+    }
+
+    private static void initStatics(Context context) {
+        final Resources resources = context.getResources();
+        final DisplayMetrics metrics = resources.getDisplayMetrics();
+        final float density = metrics.density;
+
+        sIconWidth = sIconHeight = (int) resources.getDimension(android.R.dimen.app_icon_size);
+        sIconTextureWidth = sIconTextureHeight = roundToPow2(sIconWidth);
+
+        sBlurPaint.setMaskFilter(new BlurMaskFilter(5 * density, BlurMaskFilter.Blur.NORMAL));
+        sGlowColorPressedPaint.setColor(0xffffc300);
+        sGlowColorPressedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
+        sGlowColorFocusedPaint.setColor(0xffff8e00);
+        sGlowColorFocusedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
+    }
+
+    static class BubbleText {
+        private static final int MAX_LINES = 2;
+        private TextPaint mTextPaint;
+
+        private float mBubblePadding;
+        private RectF mBubbleRect = new RectF();
+
+        private float mTextWidth;
+        private int mLeading;
+        private int mFirstLineY;
+        private int mLineHeight;
+
+        private int mBitmapWidth;
+        private int mBitmapHeight;
+
+        BubbleText(Context context) {
+            final Resources resources = context.getResources();
+
+            final float scale = resources.getDisplayMetrics().density;
+
+            final float paddingLeft = 5.0f * scale;
+            final float paddingRight = 5.0f * scale;
+            final float cellWidth = resources.getDimension(R.dimen.workspace_cell_width);
+            final float bubbleWidth = cellWidth - paddingLeft - paddingRight;
+            mBubblePadding = 3.0f * scale;
+
+            RectF bubbleRect = mBubbleRect;
+            bubbleRect.left = 0;
+            bubbleRect.top = 0;
+            bubbleRect.right = (int)(bubbleWidth+0.5f);
+
+            mTextWidth = bubbleWidth - mBubblePadding - mBubblePadding;
+
+            Paint rectPaint = new Paint();
+            rectPaint.setColor(0xff000000);
+            rectPaint.setAntiAlias(true);
+
+            TextPaint textPaint = mTextPaint = new TextPaint();
+            textPaint.setTypeface(Typeface.DEFAULT);
+            textPaint.setTextSize(13*scale);
+            textPaint.setColor(0xffffffff);
+            textPaint.setAntiAlias(true);
+            if (TEXT_BURN) {
+                textPaint.setShadowLayer(8, 0, 0, 0xff000000);
+            }
+
+            float ascent = -textPaint.ascent();
+            float descent = textPaint.descent();
+            float leading = 0.0f;//(ascent+descent) * 0.1f;
+            mLeading = (int)(leading + 0.5f);
+            mFirstLineY = (int)(leading + ascent + 0.5f);
+            mLineHeight = (int)(leading + ascent + descent + 0.5f);
+
+            mBitmapWidth = roundToPow2((int)(mBubbleRect.width() + 0.5f));
+            mBitmapHeight = roundToPow2((int)((MAX_LINES * mLineHeight) + leading + 0.5f));
+
+            mBubbleRect.offsetTo((mBitmapWidth-mBubbleRect.width())/2, 0);
+
+            if (false) {
+                Log.d(TAG, "mBitmapWidth=" + mBitmapWidth + " mBitmapHeight="
+                        + mBitmapHeight + " w=" + ((int)(mBubbleRect.width() + 0.5f))
+                        + " h=" + ((int)((MAX_LINES * mLineHeight) + leading + 0.5f)));
+            }
+        }
+
+        /** You own the bitmap after this and you must call recycle on it. */
+        Bitmap createTextBitmap(String text) {
+            Bitmap b = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ARGB_8888);
+            Canvas c = new Canvas(b);
+
+            StaticLayout layout = new StaticLayout(text, mTextPaint, (int)mTextWidth,
+                    Alignment.ALIGN_CENTER, 1, 0, true);
+            int lineCount = layout.getLineCount();
+            if (lineCount > MAX_LINES) {
+                lineCount = MAX_LINES;
+            }
+            //if (!TEXT_BURN && lineCount > 0) {
+                //RectF bubbleRect = mBubbleRect;
+                //bubbleRect.bottom = height(lineCount);
+                //c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint);
+            //}
+            for (int i=0; i<lineCount; i++) {
+                //int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f);
+                //int y = mFirstLineY + (i * mLineHeight);
+                int x = (int)(mBubbleRect.left
+                        + ((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f));
+                int y = mFirstLineY + (i * mLineHeight);
+                c.drawText(text.substring(layout.getLineStart(i), layout.getLineEnd(i)),
+                        x, y, mTextPaint);
+            }
+
+            return b;
+        }
+
+        private int height(int lineCount) {
+            return (int)((lineCount * mLineHeight) + mLeading + mLeading + 0.0f);
+        }
+
+        int getBubbleWidth() {
+            return (int)(mBubbleRect.width() + 0.5f);
+        }
+
+        int getMaxBubbleHeight() {
+            return height(MAX_LINES);
+        }
+
+        int getBitmapWidth() {
+            return mBitmapWidth;
+        }
+
+        int getBitmapHeight() {
+            return mBitmapHeight;
+        }
+    }
+
+    /** Only works for positive numbers. */
+    static int roundToPow2(int n) {
+        int orig = n;
+        n >>= 1;
+        int mask = 0x8000000;
+        while (mask != 0 && (n & mask) == 0) {
+            mask >>= 1;
+        }
+        while (mask != 0) {
+            n |= mask;
+            mask >>= 1;
+        }
+        n += 1;
+        if (n != orig) {
+            n <<= 1;
+        }
+        return n;
+    }
+}
diff --git a/src/com/android/launcher2/WallpaperChooser.java b/src/com/android/launcher2/WallpaperChooser.java
new file mode 100644
index 0000000..8045059
--- /dev/null
+++ b/src/com/android/launcher2/WallpaperChooser.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.app.Activity;
+import android.app.WallpaperManager;
+import android.content.res.Resources;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.AsyncTask;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.Gallery;
+import android.widget.ImageView;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+public class WallpaperChooser extends Activity implements AdapterView.OnItemSelectedListener,
+        OnClickListener {
+    private static final String TAG = "Launcher.WallpaperChooser";
+
+    private Gallery mGallery;
+    private ImageView mImageView;
+    private boolean mIsWallpaperSet;
+
+    private Bitmap mBitmap;
+
+    private ArrayList<Integer> mThumbs;
+    private ArrayList<Integer> mImages;
+    private WallpaperLoader mLoader;
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        requestWindowFeature(Window.FEATURE_NO_TITLE);
+
+        findWallpapers();
+
+        setContentView(R.layout.wallpaper_chooser);
+
+        mGallery = (Gallery) findViewById(R.id.gallery);
+        mGallery.setAdapter(new ImageAdapter(this));
+        mGallery.setOnItemSelectedListener(this);
+        mGallery.setCallbackDuringFling(false);
+
+        findViewById(R.id.set).setOnClickListener(this);
+
+        mImageView = (ImageView) findViewById(R.id.wallpaper);
+    }
+
+    private void findWallpapers() {
+        mThumbs = new ArrayList<Integer>(24);
+        mImages = new ArrayList<Integer>(24);
+
+        final Resources resources = getResources();
+        final String packageName = getApplication().getPackageName();
+
+        addWallpapers(resources, packageName, R.array.wallpapers);
+        addWallpapers(resources, packageName, R.array.extra_wallpapers);
+    }
+
+    private void addWallpapers(Resources resources, String packageName, int list) {
+        final String[] extras = resources.getStringArray(list);
+        for (String extra : extras) {
+            int res = resources.getIdentifier(extra, "drawable", packageName);
+            if (res != 0) {
+                final int thumbRes = resources.getIdentifier(extra + "_small",
+                        "drawable", packageName);
+
+                if (thumbRes != 0) {
+                    mThumbs.add(thumbRes);
+                    mImages.add(res);
+                }
+            }
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        mIsWallpaperSet = false;
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        
+        if (mLoader != null && mLoader.getStatus() != WallpaperLoader.Status.FINISHED) {
+            mLoader.cancel(true);
+            mLoader = null;
+        }
+    }
+
+    public void onItemSelected(AdapterView parent, View v, int position, long id) {
+        if (mLoader != null && mLoader.getStatus() != WallpaperLoader.Status.FINISHED) {
+            mLoader.cancel();
+        }
+        mLoader = (WallpaperLoader) new WallpaperLoader().execute(position);
+    }
+
+    /*
+     * When using touch if you tap an image it triggers both the onItemClick and
+     * the onTouchEvent causing the wallpaper to be set twice. Ensure we only
+     * set the wallpaper once.
+     */
+    private void selectWallpaper(int position) {
+        if (mIsWallpaperSet) {
+            return;
+        }
+
+        mIsWallpaperSet = true;
+        try {
+            WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
+            wpm.setResource(mImages.get(position));
+            setResult(RESULT_OK);
+            finish();
+        } catch (IOException e) {
+            Log.e(TAG, "Failed to set wallpaper: " + e);
+        }
+    }
+
+    public void onNothingSelected(AdapterView parent) {
+    }
+
+    private class ImageAdapter extends BaseAdapter {
+        private LayoutInflater mLayoutInflater;
+
+        ImageAdapter(WallpaperChooser context) {
+            mLayoutInflater = context.getLayoutInflater();
+        }
+
+        public int getCount() {
+            return mThumbs.size();
+        }
+
+        public Object getItem(int position) {
+            return position;
+        }
+
+        public long getItemId(int position) {
+            return position;
+        }
+
+        public View getView(int position, View convertView, ViewGroup parent) {
+            ImageView image;
+
+            if (convertView == null) {
+                image = (ImageView) mLayoutInflater.inflate(R.layout.wallpaper_item, parent, false);
+            } else {
+                image = (ImageView) convertView;
+            }
+            
+            int thumbRes = mThumbs.get(position);
+            image.setImageResource(thumbRes);
+            Drawable thumbDrawable = image.getDrawable();
+            if (thumbDrawable != null) {
+                thumbDrawable.setDither(true);
+            } else {
+                Log.e(TAG, "Error decoding thumbnail resId=" + thumbRes + " for wallpaper #"
+                        + position);
+            }
+            return image;
+        }
+    }
+
+    public void onClick(View v) {
+        selectWallpaper(mGallery.getSelectedItemPosition());
+    }
+
+    class WallpaperLoader extends AsyncTask<Integer, Void, Bitmap> {
+        BitmapFactory.Options mOptions;
+
+        WallpaperLoader() {
+            mOptions = new BitmapFactory.Options();
+            mOptions.inDither = false;
+            mOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;            
+        }
+        
+        protected Bitmap doInBackground(Integer... params) {
+            if (isCancelled()) return null;
+            try {
+                return BitmapFactory.decodeResource(getResources(),
+                        mImages.get(params[0]), mOptions);
+            } catch (OutOfMemoryError e) {
+                return null;
+            }
+        }
+
+        @Override
+        protected void onPostExecute(Bitmap b) {
+            if (b == null) return;
+
+            if (!isCancelled() && !mOptions.mCancel) {
+                // Help the GC
+                if (mBitmap != null) {
+                    mBitmap.recycle();
+                }
+    
+                final ImageView view = mImageView;
+                view.setImageBitmap(b);
+    
+                mBitmap = b;
+    
+                final Drawable drawable = view.getDrawable();
+                drawable.setFilterBitmap(true);
+                drawable.setDither(true);
+
+                view.postInvalidate();
+
+                mLoader = null;
+            } else {
+               b.recycle(); 
+            }
+        }
+
+        void cancel() {
+            mOptions.requestCancelDecode();
+            super.cancel(true);
+        }
+    }
+}
diff --git a/src/com/android/launcher2/Widget.java b/src/com/android/launcher2/Widget.java
new file mode 100644
index 0000000..348acee
--- /dev/null
+++ b/src/com/android/launcher2/Widget.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.content.ContentValues;
+import android.graphics.Bitmap;
+
+/**
+ * Represents one instance of a Launcher widget, such as search.
+ */
+class Widget extends ItemInfo {
+    int layoutResource;
+
+    static Widget makeSearch() {
+        Widget w = new Widget();
+        w.itemType = LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH;
+        w.spanX = 4;
+        w.spanY = 1;
+        w.layoutResource = R.layout.widget_search;
+        return w;
+    }
+}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
new file mode 100644
index 0000000..374f0bf
--- /dev/null
+++ b/src/com/android/launcher2/Workspace.java
@@ -0,0 +1,1475 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher2;
+
+import android.app.WallpaperManager;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ComponentName;
+import android.content.res.TypedArray;
+import android.content.pm.PackageManager;
+import android.graphics.Canvas;
+import android.graphics.RectF;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.os.Parcelable;
+import android.os.Parcel;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.VelocityTracker;
+import android.view.View;
+import android.view.ViewConfiguration;
+import android.view.ViewGroup;
+import android.view.ViewParent;
+import android.widget.Scroller;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+/**
+ * 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.
+ * A workspace is meant to be used with a fixed width only.
+ */
+public class Workspace extends ViewGroup implements DropTarget, DragSource, DragScroller {
+    @SuppressWarnings({"UnusedDeclaration"})
+    private static final String TAG = "Launcher.Workspace";
+    private static final int INVALID_SCREEN = -1;
+    
+    /**
+     * The velocity at which a fling gesture will cause us to snap to the next screen
+     */
+    private static final int SNAP_VELOCITY = 1000;
+
+    private final WallpaperManager mWallpaperManager;
+    
+    private int mDefaultScreen;
+
+    private boolean mFirstLayout = true;
+
+    private int mCurrentScreen;
+    private int mNextScreen = INVALID_SCREEN;
+    private Scroller mScroller;
+    private VelocityTracker mVelocityTracker;
+
+    /**
+     * CellInfo for the cell that is currently being dragged
+     */
+    private CellLayout.CellInfo mDragInfo;
+    
+    /**
+     * Target drop area calculated during last acceptDrop call.
+     */
+    private int[] mTargetCell = null;
+
+    private float mLastMotionX;
+    private float mLastMotionY;
+    
+    private final static int TOUCH_STATE_REST = 0;
+    private final static int TOUCH_STATE_SCROLLING = 1;
+
+    private int mTouchState = TOUCH_STATE_REST;
+
+    private OnLongClickListener mLongClickListener;
+
+    private Launcher mLauncher;
+    private DragController mDragController;
+    
+    /**
+     * Cache of vacant cells, used during drag events and invalidated as needed.
+     */
+    private CellLayout.CellInfo mVacantCache = null;
+    
+    private int[] mTempCell = new int[2];
+    private int[] mTempEstimate = new int[2];
+
+    private boolean mAllowLongPress = true;
+
+    private int mTouchSlop;
+    private int mMaximumVelocity;
+
+    final Rect mDrawerBounds = new Rect();
+    final Rect mClipBounds = new Rect();
+    int mDrawerContentHeight;
+    int mDrawerContentWidth;
+
+    private Drawable mPreviousIndicator;
+    private Drawable mNextIndicator;
+
+    private boolean mFading = true;
+
+    /**
+     * Used to inflate the Workspace from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attribtues set containing the Workspace's customization values.
+     */
+    public Workspace(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    /**
+     * Used to inflate the Workspace from XML.
+     *
+     * @param context The application's context.
+     * @param attrs The attribtues set containing the Workspace's customization values.
+     * @param defStyle Unused.
+     */
+    public Workspace(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        mWallpaperManager = WallpaperManager.getInstance(context);
+        
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Workspace, defStyle, 0);
+        mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 1);
+        a.recycle();
+
+        setHapticFeedbackEnabled(false);
+        initWorkspace();
+    }
+
+    /**
+     * Initializes various states for this workspace.
+     */
+    private void initWorkspace() {
+        mScroller = new Scroller(getContext());
+        mCurrentScreen = mDefaultScreen;
+        Launcher.setScreen(mCurrentScreen);
+
+        final ViewConfiguration configuration = ViewConfiguration.get(getContext());
+        mTouchSlop = configuration.getScaledTouchSlop();
+        mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
+    }
+
+    @Override
+    public void addView(View child, int index, LayoutParams params) {
+        if (!(child instanceof CellLayout)) {
+            throw new IllegalArgumentException("A Workspace can only have CellLayout children.");
+        }
+        super.addView(child, index, params);
+    }
+
+    @Override
+    public void addView(View child) {
+        if (!(child instanceof CellLayout)) {
+            throw new IllegalArgumentException("A Workspace can only have CellLayout children.");
+        }
+        super.addView(child);
+    }
+
+    @Override
+    public void addView(View child, int index) {
+        if (!(child instanceof CellLayout)) {
+            throw new IllegalArgumentException("A Workspace can only have CellLayout children.");
+        }
+        super.addView(child, index);
+    }
+
+    @Override
+    public void addView(View child, int width, int height) {
+        if (!(child instanceof CellLayout)) {
+            throw new IllegalArgumentException("A Workspace can only have CellLayout children.");
+        }
+        super.addView(child, width, height);
+    }
+
+    @Override
+    public void addView(View child, LayoutParams params) {
+        if (!(child instanceof CellLayout)) {
+            throw new IllegalArgumentException("A Workspace can only have CellLayout children.");
+        }
+        super.addView(child, params);
+    }
+
+    /**
+     * @return The open folder on the current screen, or null if there is none
+     */
+    Folder getOpenFolder() {
+        CellLayout currentScreen = (CellLayout) getChildAt(mCurrentScreen);
+        int count = currentScreen.getChildCount();
+        for (int i = 0; i < count; i++) {
+            View child = currentScreen.getChildAt(i);
+            CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
+            if (lp.cellHSpan == 4 && lp.cellVSpan == 4 && child instanceof Folder) {
+                return (Folder) child;
+            }
+        }
+        return null;
+    }
+
+    ArrayList<Folder> getOpenFolders() {
+        final int screens = getChildCount();
+        ArrayList<Folder> folders = new ArrayList<Folder>(screens);
+
+        for (int screen = 0; screen < screens; screen++) {
+            CellLayout currentScreen = (CellLayout) getChildAt(screen);
+            int count = currentScreen.getChildCount();
+            for (int i = 0; i < count; i++) {
+                View child = currentScreen.getChildAt(i);
+                CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
+                if (lp.cellHSpan == 4 && lp.cellVSpan == 4 && child instanceof Folder) {
+                    folders.add((Folder) child);
+                    break;
+                }
+            }
+        }
+
+        return folders;
+    }
+
+    boolean isDefaultScreenShowing() {
+        return mCurrentScreen == mDefaultScreen;
+    }
+
+    /**
+     * Returns the index of the currently displayed screen.
+     *
+     * @return The index of the currently displayed screen.
+     */
+    int getCurrentScreen() {
+        return mCurrentScreen;
+    }
+
+    /**
+     * Returns how many screens there are.
+     */
+    int getScreenCount() {
+        return getChildCount();
+    }
+
+    /**
+     * Computes a bounding rectangle for a range of cells
+     *
+     * @param cellX X coordinate of upper left corner expressed as a cell position
+     * @param cellY Y coordinate of upper left corner expressed as a cell position
+     * @param cellHSpan Width in cells
+     * @param cellVSpan Height in cells
+     * @param rect Rectnagle into which to put the results
+     */
+    public void cellToRect(int cellX, int cellY, int cellHSpan, int cellVSpan, RectF rect) {
+        ((CellLayout)getChildAt(mCurrentScreen)).cellToRect(cellX, cellY,
+                cellHSpan, cellVSpan, rect);
+    }
+
+    /**
+     * Sets the current screen.
+     *
+     * @param currentScreen
+     */
+    void setCurrentScreen(int currentScreen) {
+        clearVacantCache();
+        mCurrentScreen = Math.max(0, Math.min(currentScreen, getChildCount() - 1));
+        scrollTo(mCurrentScreen * getWidth(), 0);
+        invalidate();
+    }
+
+    /**
+     * Adds the specified child in the current screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param x The X position of the child in the screen's grid.
+     * @param y The Y position of the child in the screen's grid.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     */
+    void addInCurrentScreen(View child, int x, int y, int spanX, int spanY) {
+        addInScreen(child, mCurrentScreen, x, y, spanX, spanY, false);
+    }
+
+    /**
+     * Adds the specified child in the current screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param x The X position of the child in the screen's grid.
+     * @param y The Y position of the child in the screen's grid.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     * @param insert When true, the child is inserted at the beginning of the children list.
+     */
+    void addInCurrentScreen(View child, int x, int y, int spanX, int spanY, boolean insert) {
+        addInScreen(child, mCurrentScreen, x, y, spanX, spanY, insert);
+    }
+
+    /**
+     * Adds the specified child in the specified screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param screen The screen in which to add the child.
+     * @param x The X position of the child in the screen's grid.
+     * @param y The Y position of the child in the screen's grid.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     */
+    void addInScreen(View child, int screen, int x, int y, int spanX, int spanY) {
+        addInScreen(child, screen, x, y, spanX, spanY, false);
+    }
+
+    /**
+     * Adds the specified child in the specified screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param screen The screen in which to add the child.
+     * @param x The X position of the child in the screen's grid.
+     * @param y The Y position of the child in the screen's grid.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     * @param insert When true, the child is inserted at the beginning of the children list.
+     */
+    void addInScreen(View child, int screen, int x, int y, int spanX, int spanY, boolean insert) {
+        if (screen < 0 || screen >= getChildCount()) {
+            throw new IllegalStateException("The screen must be >= 0 and < " + getChildCount());
+        }
+
+        clearVacantCache();
+
+        final CellLayout group = (CellLayout) getChildAt(screen);
+        CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
+        if (lp == null) {
+            lp = new CellLayout.LayoutParams(x, y, spanX, spanY);
+        } else {
+            lp.cellX = x;
+            lp.cellY = y;
+            lp.cellHSpan = spanX;
+            lp.cellVSpan = spanY;
+        }
+        group.addView(child, insert ? 0 : -1, lp);
+        if (!(child instanceof Folder)) {
+            child.setHapticFeedbackEnabled(false);
+            child.setOnLongClickListener(mLongClickListener);
+        }
+        if (child instanceof DropTarget) {
+            mDragController.addDropTarget((DropTarget)child);
+        }
+    }
+
+    void addWidget(View view, Widget widget) {
+        addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
+                widget.spanY, false);
+    }
+
+    void addWidget(View view, Widget widget, boolean insert) {
+        addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
+                widget.spanY, insert);
+    }
+
+    CellLayout.CellInfo findAllVacantCells(boolean[] occupied) {
+        CellLayout group = (CellLayout) getChildAt(mCurrentScreen);
+        if (group != null) {
+            return group.findAllVacantCells(occupied, null);
+        }
+        return null;
+    }
+
+    private void clearVacantCache() {
+        if (mVacantCache != null) {
+            mVacantCache.clearVacantCells();
+            mVacantCache = null;
+        }
+    }
+    
+    /**
+     * Returns the coordinate of a vacant cell for the current screen.
+     */
+    boolean getVacantCell(int[] vacant, int spanX, int spanY) {
+        CellLayout group = (CellLayout) getChildAt(mCurrentScreen);
+        if (group != null) {
+            return group.getVacantCell(vacant, spanX, spanY);
+        }
+        return false;
+    }
+
+    /**
+     * Adds the specified child in the current screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     */
+    void fitInCurrentScreen(View child, int spanX, int spanY) {
+        fitInScreen(child, mCurrentScreen, spanX, spanY);
+    }
+
+    /**
+     * Adds the specified child in the specified screen. The position and dimension of
+     * the child are defined by x, y, spanX and spanY.
+     *
+     * @param child The child to add in one of the workspace's screens.
+     * @param screen The screen in which to add the child.
+     * @param spanX The number of cells spanned horizontally by the child.
+     * @param spanY The number of cells spanned vertically by the child.
+     */
+    void fitInScreen(View child, int screen, int spanX, int spanY) {
+        if (screen < 0 || screen >= getChildCount()) {
+            throw new IllegalStateException("The screen must be >= 0 and < " + getChildCount());
+        }
+
+        final CellLayout group = (CellLayout) getChildAt(screen);
+        boolean vacant = group.getVacantCell(mTempCell, spanX, spanY);
+        if (vacant) {
+            group.addView(child,
+                    new CellLayout.LayoutParams(mTempCell[0], mTempCell[1], spanX, spanY));
+            child.setHapticFeedbackEnabled(false);
+            child.setOnLongClickListener(mLongClickListener);
+            if (child instanceof DropTarget) {
+                mDragController.addDropTarget((DropTarget)child);
+            }
+        }
+    }
+
+    /**
+     * Registers the specified listener on each screen contained in this workspace.
+     *
+     * @param l The listener used to respond to long clicks.
+     */
+    @Override
+    public void setOnLongClickListener(OnLongClickListener l) {
+        mLongClickListener = l;
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            getChildAt(i).setOnLongClickListener(l);
+        }
+    }
+
+    private void updateWallpaperOffset() {
+        updateWallpaperOffset(getChildAt(getChildCount() - 1).getRight() - (mRight - mLeft));
+    }
+
+    private void updateWallpaperOffset(int scrollRange) {
+        mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0 );
+        mWallpaperManager.setWallpaperOffsets(getWindowToken(), mScrollX / (float) scrollRange, 0);
+    }
+    
+    @Override
+    public void computeScroll() {
+        if (mScroller.computeScrollOffset()) {
+            mScrollX = mScroller.getCurrX();
+            mScrollY = mScroller.getCurrY();
+            updateWallpaperOffset();
+            postInvalidate();
+        } else if (mNextScreen != INVALID_SCREEN) {
+            mCurrentScreen = Math.max(0, Math.min(mNextScreen, getChildCount() - 1));
+            mPreviousIndicator.setLevel(mCurrentScreen);
+            mNextIndicator.setLevel(mCurrentScreen);
+            Launcher.setScreen(mCurrentScreen);
+            mNextScreen = INVALID_SCREEN;
+            clearChildrenCache();
+        }
+    }
+
+    public void startFading(boolean dest) {
+        mFading = dest;
+        invalidate();
+    }
+
+    @Override
+    protected void dispatchDraw(Canvas canvas) {
+        /*
+        final boolean allAppsOpaque = mLauncher.isAllAppsOpaque();
+        if (mFading == allAppsOpaque) {
+            invalidate();
+        } else {
+            mFading = !allAppsOpaque;
+        }
+        if (allAppsOpaque) {
+            // If the launcher is up, draw black.
+            canvas.drawARGB(0xff, 0, 0, 0);
+            return;
+        }
+        */
+
+        boolean restore = false;
+        int restoreCount = 0;
+
+        // For the fade.  If view gets setAlpha(), use that instead.
+        float scale = mScale;
+        if (scale < 0.999f) {
+            int sx = mScrollX;
+
+            int alpha = (scale < 0.5f) ? (int)(255 * 2 * scale) : 255;
+
+            restoreCount = canvas.saveLayerAlpha(sx, 0, sx+getWidth(), getHeight(), alpha,
+                    Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG);
+            restore = true;
+
+            if (scale < 0.999f) {
+                int w = getWidth();
+                w += 2 * mCurrentScreen * w;
+                int dx = w/2;
+                int h = getHeight();
+                int dy = (h/2) - (h/4);
+                canvas.translate(dx, dy);
+                canvas.scale(scale, scale);
+                canvas.translate(-dx, -dy);
+            }
+        }
+
+        // ViewGroup.dispatchDraw() supports many features we don't need:
+        // clip to padding, layout animation, animation listener, disappearing
+        // children, etc. The following implementation attempts to fast-track
+        // the drawing dispatch by drawing only what we know needs to be drawn.
+
+        boolean fastDraw = mTouchState != TOUCH_STATE_SCROLLING && mNextScreen == INVALID_SCREEN
+                && scale > 0.999f;
+        // If we are not scrolling or flinging, draw only the current screen
+        if (fastDraw) {
+            drawChild(canvas, getChildAt(mCurrentScreen), getDrawingTime());
+        } else {
+            final long drawingTime = getDrawingTime();
+            // If we are flinging, draw only the current screen and the target screen
+            if (mNextScreen >= 0 && mNextScreen < getChildCount() &&
+                    Math.abs(mCurrentScreen - mNextScreen) == 1) {
+                drawChild(canvas, getChildAt(mCurrentScreen), drawingTime);
+                drawChild(canvas, getChildAt(mNextScreen), drawingTime);
+            } else {
+                // If we are scrolling, draw all of our children
+                final int count = getChildCount();
+                for (int i = 0; i < count; i++) {
+                    drawChild(canvas, getChildAt(i), drawingTime);
+                }
+            }
+        }
+
+        if (restore) {
+            canvas.restoreToCount(restoreCount);
+        }
+    }
+
+    private float mScale = 1.0f;
+    public void setScale(float scale) {
+        mScale = scale;
+        invalidate();
+    }
+
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        mDragController.setWindowToken(getWindowToken());
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+
+        final int width = MeasureSpec.getSize(widthMeasureSpec);
+        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+        if (widthMode != MeasureSpec.EXACTLY) {
+            throw new IllegalStateException("Workspace can only be used in EXACTLY mode.");
+        }
+
+        final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+        if (heightMode != MeasureSpec.EXACTLY) {
+            throw new IllegalStateException("Workspace can only be used in EXACTLY mode.");
+        }
+
+        // The children are given the same width and height as the workspace
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);
+        }
+
+
+        if (mFirstLayout) {
+            setHorizontalScrollBarEnabled(false);
+            scrollTo(mCurrentScreen * width, 0);
+            setHorizontalScrollBarEnabled(true);
+            updateWallpaperOffset(width * (getChildCount() - 1));
+            mFirstLayout = false;
+        }
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        int childLeft = 0;
+
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            final View child = getChildAt(i);
+            if (child.getVisibility() != View.GONE) {
+                final int childWidth = child.getMeasuredWidth();
+                child.layout(childLeft, 0, childLeft + childWidth, child.getMeasuredHeight());
+                childLeft += childWidth;
+            }
+        }
+    }
+
+    @Override
+    public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
+        int screen = indexOfChild(child);
+        if (screen != mCurrentScreen || !mScroller.isFinished()) {
+            if (!mLauncher.isWorkspaceLocked()) {
+                snapToScreen(screen);
+            }
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
+        if (!mLauncher.isAllAppsVisible()) {
+            final Folder openFolder = getOpenFolder();
+            if (openFolder != null) {
+                return openFolder.requestFocus(direction, previouslyFocusedRect);
+            } else {
+                int focusableScreen;
+                if (mNextScreen != INVALID_SCREEN) {
+                    focusableScreen = mNextScreen;
+                } else {
+                    focusableScreen = mCurrentScreen;
+                }
+                getChildAt(focusableScreen).requestFocus(direction, previouslyFocusedRect);
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean dispatchUnhandledMove(View focused, int direction) {
+        if (direction == View.FOCUS_LEFT) {
+            if (getCurrentScreen() > 0) {
+                snapToScreen(getCurrentScreen() - 1);
+                return true;
+            }
+        } else if (direction == View.FOCUS_RIGHT) {
+            if (getCurrentScreen() < getChildCount() - 1) {
+                snapToScreen(getCurrentScreen() + 1);
+                return true;
+            }
+        }
+        return super.dispatchUnhandledMove(focused, direction);
+    }
+
+    @Override
+    public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
+        if (!mLauncher.isAllAppsVisible()) {
+            final Folder openFolder = getOpenFolder();
+            if (openFolder == null) {
+                getChildAt(mCurrentScreen).addFocusables(views, direction);
+                if (direction == View.FOCUS_LEFT) {
+                    if (mCurrentScreen > 0) {
+                        getChildAt(mCurrentScreen - 1).addFocusables(views, direction);
+                    }
+                } else if (direction == View.FOCUS_RIGHT){
+                    if (mCurrentScreen < getChildCount() - 1) {
+                        getChildAt(mCurrentScreen + 1).addFocusables(views, direction);
+                    }
+                }
+            } else {
+                openFolder.addFocusables(views, direction);
+            }
+        }
+    }
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+            if (mLauncher.isWorkspaceLocked() || mLauncher.isAllAppsVisible()) {
+                return false;
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        final boolean workspaceLocked = mLauncher.isWorkspaceLocked();
+        final boolean allAppsVisible = mLauncher.isAllAppsVisible();
+        if (workspaceLocked || allAppsVisible) {
+            return false; // We don't want the events.  Let them fall through to the all apps view.
+        }
+
+        /*
+         * This method JUST determines whether we want to intercept the motion.
+         * If we return true, onTouchEvent will be called and we do the actual
+         * scrolling there.
+         */
+
+        /*
+         * Shortcut the most recurring case: the user is in the dragging
+         * state and he is moving his finger.  We want to intercept this
+         * motion.
+         */
+        final int action = ev.getAction();
+        if ((action == MotionEvent.ACTION_MOVE) && (mTouchState != TOUCH_STATE_REST)) {
+            return true;
+        }
+
+        final float x = ev.getX();
+        final float y = ev.getY();
+
+        switch (action) {
+            case MotionEvent.ACTION_MOVE:
+                /*
+                 * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check
+                 * whether the user has moved far enough from his original down touch.
+                 */
+
+                /*
+                 * Locally do absolute value. mLastMotionX is set to the y value
+                 * of the down event.
+                 */
+                final int xDiff = (int) Math.abs(x - mLastMotionX);
+                final int yDiff = (int) Math.abs(y - mLastMotionY);
+
+                final int touchSlop = mTouchSlop;
+                boolean xMoved = xDiff > touchSlop;
+                boolean yMoved = yDiff > touchSlop;
+                
+                if (xMoved || yMoved) {
+                    
+                    if (xMoved) {
+                        // Scroll if the user moved far enough along the X axis
+                        mTouchState = TOUCH_STATE_SCROLLING;
+                        enableChildrenCache(mCurrentScreen - 1, mCurrentScreen + 1);
+                    }
+                    // Either way, cancel any pending longpress
+                    if (mAllowLongPress) {
+                        mAllowLongPress = false;
+                        // Try canceling the long press. It could also have been scheduled
+                        // by a distant descendant, so use the mAllowLongPress flag to block
+                        // everything
+                        final View currentScreen = getChildAt(mCurrentScreen);
+                        currentScreen.cancelLongPress();
+                    }
+                }
+                break;
+
+            case MotionEvent.ACTION_DOWN:
+                // Remember location of down touch
+                mLastMotionX = x;
+                mLastMotionY = y;
+                mAllowLongPress = true;
+
+                /*
+                 * If being flinged and user touches the screen, initiate drag;
+                 * otherwise don't.  mScroller.isFinished should be false when
+                 * being flinged.
+                 */
+                mTouchState = mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING;
+                break;
+
+            case MotionEvent.ACTION_CANCEL:
+            case MotionEvent.ACTION_UP:
+                
+                if (mTouchState != TOUCH_STATE_SCROLLING) {
+                    
+                    final CellLayout currentScreen = (CellLayout)getChildAt(mCurrentScreen);
+                    if (!currentScreen.lastDownOnOccupiedCell()) {
+                        // Send a tap to the wallpaper if the last down was on empty space
+                        mWallpaperManager.sendWallpaperCommand(getWindowToken(), 
+                                "android.wallpaper.tap", (int) ev.getX(), (int) ev.getY(), 0, null);
+                    }
+                }
+                
+                // Release the drag
+                clearChildrenCache();
+                mTouchState = TOUCH_STATE_REST;
+                mAllowLongPress = false;
+
+                break;
+        }
+
+        /*
+         * The only time we want to intercept motion events is if we are in the
+         * drag mode.
+         */
+        return mTouchState != TOUCH_STATE_REST;
+    }
+
+    /**
+     * If one of our descendant views decides that it could be focused now, only
+     * pass that along if it's on the current screen.
+     *
+     * This happens when live folders requery, and if they're off screen, they
+     * end up calling requestFocus, which pulls it on screen.
+     */
+    @Override
+    public void focusableViewAvailable(View focused) {
+        View current = getChildAt(mCurrentScreen);
+        View v = focused;
+        while (true) {
+            if (v == current) {
+                super.focusableViewAvailable(focused);
+                return;
+            }
+            if (v == this) {
+                return;
+            }
+            ViewParent parent = v.getParent();
+            if (parent instanceof View) {
+                v = (View)v.getParent();
+            } else {
+                return;
+            }
+        }
+    }
+
+    void enableChildrenCache(int fromScreen, int toScreen) {
+        if (fromScreen > toScreen) {
+            fromScreen = toScreen;
+            toScreen = fromScreen;
+        }
+        
+        final int count = getChildCount();
+        
+        fromScreen = Math.max(fromScreen, 0);
+        toScreen = Math.min(toScreen, count - 1);
+        
+        for (int i = fromScreen; i <= toScreen; i++) {
+            final CellLayout layout = (CellLayout) getChildAt(i);
+            layout.setChildrenDrawnWithCacheEnabled(true);
+            layout.setChildrenDrawingCacheEnabled(true);
+        }
+    }
+
+    void clearChildrenCache() {
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            final CellLayout layout = (CellLayout) getChildAt(i);
+            layout.setChildrenDrawnWithCacheEnabled(false);
+        }
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent ev) {
+        
+        if (mLauncher.isWorkspaceLocked()) {
+            return false; // We don't want the events.  Let them fall through to the all apps view.
+        }
+        if (mLauncher.isAllAppsVisible()) {
+            // Cancel any scrolling that is in progress.
+            if (!mScroller.isFinished()) {
+                mScroller.abortAnimation();
+            }
+            snapToScreen(mCurrentScreen);
+            return false; // We don't want the events.  Let them fall through to the all apps view.
+        }
+
+        if (mVelocityTracker == null) {
+            mVelocityTracker = VelocityTracker.obtain();
+        }
+        mVelocityTracker.addMovement(ev);
+
+        final int action = ev.getAction();
+        final float x = ev.getX();
+
+        switch (action) {
+        case MotionEvent.ACTION_DOWN:
+            /*
+             * If being flinged and user touches, stop the fling. isFinished
+             * will be false if being flinged.
+             */
+            if (!mScroller.isFinished()) {
+                mScroller.abortAnimation();
+            }
+
+            // Remember where the motion event started
+            mLastMotionX = x;
+            break;
+        case MotionEvent.ACTION_MOVE:
+            if (mTouchState == TOUCH_STATE_SCROLLING) {
+                // Scroll to follow the motion event
+                final int deltaX = (int) (mLastMotionX - x);
+                mLastMotionX = x;
+
+                if (deltaX < 0) {
+                    if (mScrollX > 0) {
+                        scrollBy(Math.max(-mScrollX, deltaX), 0);
+                        updateWallpaperOffset();
+                    }
+                } else if (deltaX > 0) {
+                    final int availableToScroll = getChildAt(getChildCount() - 1).getRight() -
+                            mScrollX - getWidth();
+                    if (availableToScroll > 0) {
+                        scrollBy(Math.min(availableToScroll, deltaX), 0);
+                        updateWallpaperOffset();
+                    }
+                } else {
+                    awakenScrollBars();
+                }
+            }
+            break;
+        case MotionEvent.ACTION_UP:
+            if (mTouchState == TOUCH_STATE_SCROLLING) {
+                final VelocityTracker velocityTracker = mVelocityTracker;
+                velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
+                int velocityX = (int) velocityTracker.getXVelocity();
+
+                if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {
+                    // Fling hard enough to move left
+                    snapToScreen(mCurrentScreen - 1);
+                } else if (velocityX < -SNAP_VELOCITY && mCurrentScreen < getChildCount() - 1) {
+                    // Fling hard enough to move right
+                    snapToScreen(mCurrentScreen + 1);
+                } else {
+                    snapToDestination();
+                }
+
+                if (mVelocityTracker != null) {
+                    mVelocityTracker.recycle();
+                    mVelocityTracker = null;
+                }
+            }
+            mTouchState = TOUCH_STATE_REST;
+            break;
+        case MotionEvent.ACTION_CANCEL:
+            mTouchState = TOUCH_STATE_REST;
+        }
+
+        return true;
+    }
+
+    private void snapToDestination() {
+        final int screenWidth = getWidth();
+        final int whichScreen = (mScrollX + (screenWidth / 2)) / screenWidth;
+
+        snapToScreen(whichScreen);
+    }
+
+    void snapToScreen(int whichScreen) {
+        snapToScreen(whichScreen, true);
+    }
+
+    void snapToScreen(int whichScreen, boolean animate) {
+        //if (!mScroller.isFinished()) return;
+
+        whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1));
+        
+        clearVacantCache();
+        enableChildrenCache(mCurrentScreen, whichScreen);
+
+        final int screenDelta = Math.abs(whichScreen - mCurrentScreen);
+        
+        mNextScreen = whichScreen;
+
+        mPreviousIndicator.setLevel(mNextScreen);
+        mNextIndicator.setLevel(mNextScreen);
+        
+        View focusedChild = getFocusedChild();
+        if (focusedChild != null && screenDelta != 0 && focusedChild == getChildAt(mCurrentScreen)) {
+            focusedChild.clearFocus();
+        }
+        
+        final int newX = whichScreen * getWidth();
+        final int delta = newX - mScrollX;
+        final int duration = screenDelta * 300;
+        awakenScrollBars(duration);
+        // 1ms is close to don't animate
+        mScroller.startScroll(mScrollX, 0, delta, 0, animate ? duration : 1);
+        invalidate();
+    }
+
+    void startDrag(CellLayout.CellInfo cellInfo) {
+        View child = cellInfo.cell;
+        
+        // Make sure the drag was started by a long press as opposed to a long click.
+        // Note that Search takes focus when clicked rather than entering touch mode
+        if (!child.isInTouchMode() && !(child instanceof Search)) {
+            return;
+        }
+        
+        mDragInfo = cellInfo;
+        mDragInfo.screen = mCurrentScreen;
+        
+        CellLayout current = ((CellLayout) getChildAt(mCurrentScreen));
+
+        current.onDragChild(child);
+        mDragController.startDrag(child, this, child.getTag(), DragController.DRAG_ACTION_MOVE);
+        invalidate();
+    }
+
+    @Override
+    protected Parcelable onSaveInstanceState() {
+        final SavedState state = new SavedState(super.onSaveInstanceState());
+        state.currentScreen = mCurrentScreen;
+        return state;
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Parcelable state) {
+        SavedState savedState = (SavedState) state;
+        super.onRestoreInstanceState(savedState.getSuperState());
+        if (savedState.currentScreen != -1) {
+            mCurrentScreen = savedState.currentScreen;
+            Launcher.setScreen(mCurrentScreen);
+        }
+    }
+
+    void addApplicationShortcut(ApplicationInfo info, CellLayout.CellInfo cellInfo) {
+        addApplicationShortcut(info, cellInfo, false);
+    }
+
+    void addApplicationShortcut(ApplicationInfo info, CellLayout.CellInfo cellInfo,
+            boolean insertAtFirst) {
+        final CellLayout layout = (CellLayout) getChildAt(cellInfo.screen);
+        final int[] result = new int[2];
+
+        layout.cellToPoint(cellInfo.cellX, cellInfo.cellY, result);
+        onDropExternal(result[0], result[1], info, layout, insertAtFirst);
+    }
+
+    public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        final CellLayout cellLayout = getCurrentDropLayout();
+        if (source != this) {
+            onDropExternal(x - xOffset, y - yOffset, dragInfo, cellLayout);
+        } else {
+            // Move internally
+            if (mDragInfo != null) {
+                final View cell = mDragInfo.cell;
+                int index = mScroller.isFinished() ? mCurrentScreen : mNextScreen;                
+                if (index != mDragInfo.screen) {
+                    final CellLayout originalCellLayout = (CellLayout) getChildAt(mDragInfo.screen);
+                    originalCellLayout.removeView(cell);
+                    cellLayout.addView(cell);
+                }
+                mTargetCell = estimateDropCell(x - xOffset, y - yOffset,
+                        mDragInfo.spanX, mDragInfo.spanY, cell, cellLayout, mTargetCell);
+                cellLayout.onDropChild(cell, mTargetCell);
+
+                final ItemInfo info = (ItemInfo) cell.getTag();
+                CellLayout.LayoutParams lp = (CellLayout.LayoutParams) cell.getLayoutParams();
+                LauncherModel.moveItemInDatabase(mLauncher, info,
+                        LauncherSettings.Favorites.CONTAINER_DESKTOP, index, lp.cellX, lp.cellY);
+            }
+        }
+    }
+
+    public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        clearVacantCache();
+    }
+
+    public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+    }
+
+    public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+            DragView dragView, Object dragInfo) {
+        clearVacantCache();
+    }
+
+    private void onDropExternal(int x, int y, Object dragInfo, CellLayout cellLayout) {
+        onDropExternal(x, y, dragInfo, cellLayout, false);
+    }
+    
+    private void onDropExternal(int x, int y, Object dragInfo, CellLayout cellLayout,
+            boolean insertAtFirst) {
+        // Drag from somewhere else
+        ItemInfo info = (ItemInfo) dragInfo;
+
+        View view;
+
+        switch (info.itemType) {
+        case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
+        case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+            if (info.container == NO_ID) {
+                // Came from all apps -- make a copy
+                info = new ApplicationInfo((ApplicationInfo) info);
+            }
+            view = mLauncher.createShortcut(R.layout.application, cellLayout,
+                    (ApplicationInfo) info);
+            break;
+        case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
+            view = FolderIcon.fromXml(R.layout.folder_icon, mLauncher,
+                    (ViewGroup) getChildAt(mCurrentScreen), ((UserFolderInfo) info));
+            break;
+        default:
+            throw new IllegalStateException("Unknown item type: " + info.itemType);
+        }
+
+        cellLayout.addView(view, insertAtFirst ? 0 : -1);
+        view.setHapticFeedbackEnabled(false);
+        view.setOnLongClickListener(mLongClickListener);
+        if (view instanceof DropTarget) {
+            mDragController.addDropTarget((DropTarget) view);
+        }
+
+        mTargetCell = estimateDropCell(x, y, 1, 1, view, cellLayout, mTargetCell);
+        cellLayout.onDropChild(view, mTargetCell);
+        CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
+
+        LauncherModel.addOrMoveItemInDatabase(mLauncher, info,
+                LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentScreen, lp.cellX, lp.cellY);
+    }
+    
+    /**
+     * Return the current {@link CellLayout}, correctly picking the destination
+     * screen while a scroll is in progress.
+     */
+    private CellLayout getCurrentDropLayout() {
+        int index = mScroller.isFinished() ? mCurrentScreen : mNextScreen;
+        return (CellLayout) getChildAt(index);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean acceptDrop(DragSource source, int x, int y,
+            int xOffset, int yOffset, DragView dragView, Object dragInfo) {
+        final CellLayout layout = getCurrentDropLayout();
+        final CellLayout.CellInfo cellInfo = mDragInfo;
+        final int spanX = cellInfo == null ? 1 : cellInfo.spanX;
+        final int spanY = cellInfo == null ? 1 : cellInfo.spanY;
+
+        if (mVacantCache == null) {
+            final View ignoreView = cellInfo == null ? null : cellInfo.cell;
+            mVacantCache = layout.findAllVacantCells(null, ignoreView);
+        }
+
+        return mVacantCache.findCellForSpan(mTempEstimate, spanX, spanY, false);
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Rect estimateDropLocation(DragSource source, int x, int y,
+            int xOffset, int yOffset, DragView dragView, Object dragInfo, Rect recycle) {
+        final CellLayout layout = getCurrentDropLayout();
+        
+        final CellLayout.CellInfo cellInfo = mDragInfo;
+        final int spanX = cellInfo == null ? 1 : cellInfo.spanX;
+        final int spanY = cellInfo == null ? 1 : cellInfo.spanY;
+        final View ignoreView = cellInfo == null ? null : cellInfo.cell;
+        
+        final Rect location = recycle != null ? recycle : new Rect();
+        
+        // Find drop cell and convert into rectangle
+        int[] dropCell = estimateDropCell(x - xOffset, y - yOffset,
+                spanX, spanY, ignoreView, layout, mTempCell);
+        
+        if (dropCell == null) {
+            return null;
+        }
+        
+        layout.cellToPoint(dropCell[0], dropCell[1], mTempEstimate);
+        location.left = mTempEstimate[0];
+        location.top = mTempEstimate[1];
+        
+        layout.cellToPoint(dropCell[0] + spanX, dropCell[1] + spanY, mTempEstimate);
+        location.right = mTempEstimate[0];
+        location.bottom = mTempEstimate[1];
+        
+        return location;
+    }
+
+    /**
+     * Calculate the nearest cell where the given object would be dropped.
+     */
+    private int[] estimateDropCell(int pixelX, int pixelY,
+            int spanX, int spanY, View ignoreView, CellLayout layout, int[] recycle) {
+        // Create vacant cell cache if none exists
+        if (mVacantCache == null) {
+            mVacantCache = layout.findAllVacantCells(null, ignoreView);
+        }
+
+        // Find the best target drop location
+        return layout.findNearestVacantArea(pixelX, pixelY,
+                spanX, spanY, mVacantCache, recycle);
+    }
+    
+    void setLauncher(Launcher launcher) {
+        mLauncher = launcher;
+    }
+
+    public void setDragController(DragController dragController) {
+        mDragController = dragController;
+    }
+
+    public void onDropCompleted(View target, boolean success) {
+        clearVacantCache();
+
+        if (success){
+            if (target != this && mDragInfo != null) {
+                final CellLayout cellLayout = (CellLayout) getChildAt(mDragInfo.screen);
+                cellLayout.removeView(mDragInfo.cell);
+                if (mDragInfo.cell instanceof DropTarget) {
+                    mDragController.removeDropTarget((DropTarget)mDragInfo.cell);
+                }
+                //final Object tag = mDragInfo.cell.getTag();
+            }
+        } else {
+            if (mDragInfo != null) {
+                final CellLayout cellLayout = (CellLayout) getChildAt(mDragInfo.screen);
+                cellLayout.onDropAborted(mDragInfo.cell);
+            }
+        }
+
+        mDragInfo = null;
+    }
+
+    public void scrollLeft() {
+        clearVacantCache();
+        if (mNextScreen == INVALID_SCREEN && mCurrentScreen > 0 && mScroller.isFinished()) {
+            snapToScreen(mCurrentScreen - 1);
+        }
+    }
+
+    public void scrollRight() {
+        clearVacantCache();
+        if (mNextScreen == INVALID_SCREEN && mCurrentScreen < getChildCount() -1 &&
+                mScroller.isFinished()) {
+            snapToScreen(mCurrentScreen + 1);
+        }
+    }
+
+    public int getScreenForView(View v) {
+        int result = -1;
+        if (v != null) {
+            ViewParent vp = v.getParent();
+            int count = getChildCount();
+            for (int i = 0; i < count; i++) {
+                if (vp == getChildAt(i)) {
+                    return i;
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Find a search widget on the given screen
+     */
+    private Search findSearchWidget(CellLayout screen) {
+        final int count = screen.getChildCount();
+        for (int i = 0; i < count; i++) {
+            View v = screen.getChildAt(i);
+            if (v instanceof Search) {
+                return (Search) v;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets the first search widget on the current screen, if there is one.
+     * Returns <code>null</code> otherwise.
+     */
+    public Search findSearchWidgetOnCurrentScreen() {
+        CellLayout currentScreen = (CellLayout)getChildAt(mCurrentScreen);
+        return findSearchWidget(currentScreen);
+    }
+
+    public Folder getFolderForTag(Object tag) {
+        int screenCount = getChildCount();
+        for (int screen = 0; screen < screenCount; screen++) {
+            CellLayout currentScreen = ((CellLayout) getChildAt(screen));
+            int count = currentScreen.getChildCount();
+            for (int i = 0; i < count; i++) {
+                View child = currentScreen.getChildAt(i);
+                CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
+                if (lp.cellHSpan == 4 && lp.cellVSpan == 4 && child instanceof Folder) {
+                    Folder f = (Folder) child;
+                    if (f.getInfo() == tag) {
+                        return f;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    public View getViewForTag(Object tag) {
+        int screenCount = getChildCount();
+        for (int screen = 0; screen < screenCount; screen++) {
+            CellLayout currentScreen = ((CellLayout) getChildAt(screen));
+            int count = currentScreen.getChildCount();
+            for (int i = 0; i < count; i++) {
+                View child = currentScreen.getChildAt(i);
+                if (child.getTag() == tag) {
+                    return child;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @return True is long presses are still allowed for the current touch
+     */
+    public boolean allowLongPress() {
+        return mAllowLongPress;
+    }
+    
+    /**
+     * Set true to allow long-press events to be triggered, usually checked by
+     * {@link Launcher} to accept or block dpad-initiated long-presses.
+     */
+    public void setAllowLongPress(boolean allowLongPress) {
+        mAllowLongPress = allowLongPress;
+    }
+
+    void removeShortcutsForPackage(String packageName) {
+        final ArrayList<View> childrenToRemove = new ArrayList<View>();
+        final int count = getChildCount();
+
+        for (int i = 0; i < count; i++) {
+            final CellLayout layout = (CellLayout) getChildAt(i);
+            int childCount = layout.getChildCount();
+
+            childrenToRemove.clear();
+
+            for (int j = 0; j < childCount; j++) {
+                final View view = layout.getChildAt(j);
+                Object tag = view.getTag();
+
+                if (tag instanceof ApplicationInfo) {
+                    final ApplicationInfo info = (ApplicationInfo) tag;
+                    // We need to check for ACTION_MAIN otherwise getComponent() might
+                    // return null for some shortcuts (for instance, for shortcuts to
+                    // web pages.)
+                    final Intent intent = info.intent;
+                    final ComponentName name = intent.getComponent();
+
+                    if (Intent.ACTION_MAIN.equals(intent.getAction()) &&
+                            name != null && packageName.equals(name.getPackageName())) {
+                        LauncherModel.deleteItemFromDatabase(mLauncher, info);
+                        childrenToRemove.add(view);
+                    }
+                } else if (tag instanceof UserFolderInfo) {
+                    final UserFolderInfo info = (UserFolderInfo) tag;
+                    final ArrayList<ApplicationInfo> contents = info.contents;
+                    final ArrayList<ApplicationInfo> toRemove = new ArrayList<ApplicationInfo>(1);
+                    final int contentsCount = contents.size();
+                    boolean removedFromFolder = false;
+
+                    for (int k = 0; k < contentsCount; k++) {
+                        final ApplicationInfo appInfo = contents.get(k);
+                        final Intent intent = appInfo.intent;
+                        final ComponentName name = intent.getComponent();
+
+                        if (Intent.ACTION_MAIN.equals(intent.getAction()) &&
+                                name != null && packageName.equals(name.getPackageName())) {
+                            toRemove.add(appInfo);
+                            LauncherModel.deleteItemFromDatabase(mLauncher, appInfo);
+                            removedFromFolder = true;
+                        }
+                    }
+
+                    contents.removeAll(toRemove);
+                    if (removedFromFolder) {
+                        final Folder folder = getOpenFolder();
+                        if (folder != null) folder.notifyDataSetChanged();
+                    }
+                }
+            }
+
+            childCount = childrenToRemove.size();
+            for (int j = 0; j < childCount; j++) {
+                View child = childrenToRemove.get(j);
+                layout.removeViewInLayout(child);
+                if (child instanceof DropTarget) {
+                    mDragController.removeDropTarget((DropTarget)child);
+                }
+            }
+
+            if (childCount > 0) {
+                layout.requestLayout();
+                layout.invalidate();
+            }
+        }
+    }
+
+    void updateShortcutsForPackage(String packageName) {
+        final PackageManager pm = mLauncher.getPackageManager();
+
+        final int count = getChildCount();
+        for (int i = 0; i < count; i++) {
+            final CellLayout layout = (CellLayout) getChildAt(i);
+            int childCount = layout.getChildCount();
+            for (int j = 0; j < childCount; j++) {
+                final View view = layout.getChildAt(j);
+                Object tag = view.getTag();
+                if (tag instanceof ApplicationInfo) {
+                    ApplicationInfo info = (ApplicationInfo) tag;
+                    // We need to check for ACTION_MAIN otherwise getComponent() might
+                    // return null for some shortcuts (for instance, for shortcuts to
+                    // web pages.)
+                    final Intent intent = info.intent;
+                    final ComponentName name = intent.getComponent();
+                    if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION &&
+                            Intent.ACTION_MAIN.equals(intent.getAction()) && name != null &&
+                            packageName.equals(name.getPackageName())) {
+
+                        final Drawable icon = AppInfoCache.getIconDrawable(pm, info);
+                        if (icon != null && icon != info.icon) {
+                            info.icon.setCallback(null);
+                            info.icon = Utilities.createIconThumbnail(icon, mContext);
+                            info.filtered = true;
+                            ((TextView) view).setCompoundDrawablesWithIntrinsicBounds(null,
+                                    info.icon, null, null);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    void moveToDefaultScreen(boolean animate) {
+        snapToScreen(mDefaultScreen, animate);
+        getChildAt(mDefaultScreen).requestFocus();
+    }
+
+    void setIndicators(Drawable previous, Drawable next) {
+        mPreviousIndicator = previous;
+        mNextIndicator = next;
+        previous.setLevel(mCurrentScreen);
+        next.setLevel(mCurrentScreen);
+    }
+
+    public static class SavedState extends BaseSavedState {
+        int currentScreen = -1;
+
+        SavedState(Parcelable superState) {
+            super(superState);
+        }
+
+        private SavedState(Parcel in) {
+            super(in);
+            currentScreen = in.readInt();
+        }
+
+        @Override
+        public void writeToParcel(Parcel out, int flags) {
+            super.writeToParcel(out, flags);
+            out.writeInt(currentScreen);
+        }
+
+        public static final Parcelable.Creator<SavedState> CREATOR =
+                new Parcelable.Creator<SavedState>() {
+            public SavedState createFromParcel(Parcel in) {
+                return new SavedState(in);
+            }
+
+            public SavedState[] newArray(int size) {
+                return new SavedState[size];
+            }
+        };
+    }
+
+    void show() {
+        setVisibility(VISIBLE);
+    }
+
+    void hide() {
+    }
+}
