merge in ics-factoryrom-release history after reset to ics-factoryrom
diff --git a/res/drawable-hdpi/bg_cling1.png b/res/drawable-hdpi/bg_cling1.png
deleted file mode 100644
index 0e15532..0000000
--- a/res/drawable-hdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/bg_cling2.png b/res/drawable-hdpi/bg_cling2.png
deleted file mode 100644
index e65d9a2..0000000
--- a/res/drawable-hdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/bg_cling3.png b/res/drawable-hdpi/bg_cling3.png
deleted file mode 100644
index ea71fbd..0000000
--- a/res/drawable-hdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_cling_normal.9.png b/res/drawable-hdpi/btn_cling_normal.9.png
deleted file mode 100644
index aea8beb..0000000
--- a/res/drawable-hdpi/btn_cling_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_cling_pressed.9.png b/res/drawable-hdpi/btn_cling_pressed.9.png
deleted file mode 100644
index ebefd20..0000000
--- a/res/drawable-hdpi/btn_cling_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/hand.png b/res/drawable-hdpi/hand.png
deleted file mode 100644
index 4a73f2b..0000000
--- a/res/drawable-hdpi/hand.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/hotseat_bg_panel.9.png b/res/drawable-hdpi/hotseat_bg_panel.9.png
index 3c25e0e..955b0e8 100644
--- a/res/drawable-hdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-hdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-hdpi/search_bg_panel.9.png b/res/drawable-hdpi/search_bg_panel.9.png
index c868b2f..af5066f 100644
--- a/res/drawable-hdpi/search_bg_panel.9.png
+++ b/res/drawable-hdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-hdpi/hotseat_bg_panel.9.png b/res/drawable-land-hdpi/hotseat_bg_panel.9.png
index 90177f8..318234f 100644
--- a/res/drawable-land-hdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-land-hdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-hdpi/search_bg_panel.9.png b/res/drawable-land-hdpi/search_bg_panel.9.png
index 3642ea5..f574e27 100644
--- a/res/drawable-land-hdpi/search_bg_panel.9.png
+++ b/res/drawable-land-hdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-mdpi/hotseat_bg_panel.9.png b/res/drawable-land-mdpi/hotseat_bg_panel.9.png
index 83c4a55..3dbb386 100644
--- a/res/drawable-land-mdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-land-mdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-mdpi/search_bg_panel.9.png b/res/drawable-land-mdpi/search_bg_panel.9.png
index ce3a7e4..e6da309 100644
--- a/res/drawable-land-mdpi/search_bg_panel.9.png
+++ b/res/drawable-land-mdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-xhdpi/hotseat_bg_panel.9.png b/res/drawable-land-xhdpi/hotseat_bg_panel.9.png
index 8718040..5824aa5 100644
--- a/res/drawable-land-xhdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-land-xhdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-land-xhdpi/search_bg_panel.9.png b/res/drawable-land-xhdpi/search_bg_panel.9.png
index ca2b365..fdda3cf 100644
--- a/res/drawable-land-xhdpi/search_bg_panel.9.png
+++ b/res/drawable-land-xhdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling1.png b/res/drawable-mdpi/bg_cling1.png
deleted file mode 100644
index f284412..0000000
--- a/res/drawable-mdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling2.png b/res/drawable-mdpi/bg_cling2.png
deleted file mode 100644
index 0052dc2..0000000
--- a/res/drawable-mdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling3.png b/res/drawable-mdpi/bg_cling3.png
deleted file mode 100644
index fabdf7a..0000000
--- a/res/drawable-mdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_cling_normal.9.png b/res/drawable-mdpi/btn_cling_normal.9.png
deleted file mode 100644
index 43a407e..0000000
--- a/res/drawable-mdpi/btn_cling_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_cling_pressed.9.png b/res/drawable-mdpi/btn_cling_pressed.9.png
deleted file mode 100644
index bf0c8cb..0000000
--- a/res/drawable-mdpi/btn_cling_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/hand.png b/res/drawable-mdpi/hand.png
deleted file mode 100644
index eb280e3..0000000
--- a/res/drawable-mdpi/hand.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/hotseat_bg_panel.9.png b/res/drawable-mdpi/hotseat_bg_panel.9.png
index 338db2c..7c31ee2 100644
--- a/res/drawable-mdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-mdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-mdpi/search_bg_panel.9.png b/res/drawable-mdpi/search_bg_panel.9.png
index 81f01ce..277d2ce 100644
--- a/res/drawable-mdpi/search_bg_panel.9.png
+++ b/res/drawable-mdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling1.png b/res/drawable-xhdpi/bg_cling1.png
deleted file mode 100644
index b71351a..0000000
--- a/res/drawable-xhdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling2.png b/res/drawable-xhdpi/bg_cling2.png
deleted file mode 100644
index ad78dfe..0000000
--- a/res/drawable-xhdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling3.png b/res/drawable-xhdpi/bg_cling3.png
deleted file mode 100644
index ae04195..0000000
--- a/res/drawable-xhdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_cling_normal.9.png b/res/drawable-xhdpi/btn_cling_normal.9.png
deleted file mode 100644
index 35511d6..0000000
--- a/res/drawable-xhdpi/btn_cling_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_cling_pressed.9.png b/res/drawable-xhdpi/btn_cling_pressed.9.png
deleted file mode 100644
index a38b40f..0000000
--- a/res/drawable-xhdpi/btn_cling_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/hand.png b/res/drawable-xhdpi/hand.png
deleted file mode 100644
index aaaad37..0000000
--- a/res/drawable-xhdpi/hand.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/hotseat_bg_panel.9.png b/res/drawable-xhdpi/hotseat_bg_panel.9.png
index cc3d0bc..570d929 100644
--- a/res/drawable-xhdpi/hotseat_bg_panel.9.png
+++ b/res/drawable-xhdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/search_bg_panel.9.png b/res/drawable-xhdpi/search_bg_panel.9.png
index 3cd534f..5f007c9 100644
--- a/res/drawable-xhdpi/search_bg_panel.9.png
+++ b/res/drawable-xhdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable/cling_button_bg.xml b/res/drawable/cling_button_bg.xml
index 3809cde..791250b 100644
--- a/res/drawable/cling_button_bg.xml
+++ b/res/drawable/cling_button_bg.xml
@@ -15,6 +15,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" android:drawable="@drawable/btn_cling_pressed" />
- <item android:drawable="@drawable/btn_cling_normal" />
+ <item android:state_pressed="true" android:drawable="@color/cling_button_pressed" />
+ <item android:drawable="@color/cling_button" />
</selector>
diff --git a/res/layout-land/all_apps_cling.xml b/res/layout-land/all_apps_cling.xml
index e89d4c1..95d88b0 100644
--- a/res/layout-land/all_apps_cling.xml
+++ b/res/layout-land/all_apps_cling.xml
@@ -16,33 +16,29 @@
<com.android.launcher2.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="all_apps_landscape">
+ launcher:drawIdentifier="all_apps_landscape"
+ android:background="#CA000000">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginLeft="40dp"
- android:layout_marginTop="40dp">
- <LinearLayout
- android:layout_width="match_parent"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="50dp">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/all_apps_cling_title"
+ android:layout_marginTop="0dp"
+ android:text="@string/all_apps_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/all_apps_cling_add_item"
+ android:layout_width="280dp"
android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/all_apps_cling_title"
- android:text="@string/all_apps_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/all_apps_cling_add_item"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/all_apps_cling_add_item" />
- </LinearLayout>
+ android:layout_marginTop="45dp"
+ android:text="@string/all_apps_cling_add_item" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="100dp"
+ android:onClick="dismissAllAppsCling" />
</FrameLayout>
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissAllAppsCling" />
</com.android.launcher2.Cling>
diff --git a/res/layout-land/folder_cling.xml b/res/layout-land/folder_cling.xml
deleted file mode 100644
index 91d34ad..0000000
--- a/res/layout-land/folder_cling.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- 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.Cling
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="folder_landscape">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="40dp"
- android:layout_marginTop="40dp">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/folder_cling_title"
- android:text="@string/folder_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/folder_cling_move_item"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/folder_cling_move_item" />
- </LinearLayout>
- </FrameLayout>
- <TextView
- style="@style/ClingText"
- android:id="@+id/folder_cling_create_folder"
- android:layout_width="340dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="40dp"
- android:layout_marginBottom="40dp"
- android:layout_gravity="bottom"
- android:text="@string/folder_cling_create_folder" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissFolderCling" />
-</com.android.launcher2.Cling>
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 084b163..2b25bbb 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -87,10 +87,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
-
- <include layout="@layout/folder_cling"
- android:id="@+id/folder_cling"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
</com.android.launcher2.DragLayer>
diff --git a/res/layout-land/workspace_cling.xml b/res/layout-land/workspace_cling.xml
index dca3937..fa85507 100644
--- a/res/layout-land/workspace_cling.xml
+++ b/res/layout-land/workspace_cling.xml
@@ -16,42 +16,36 @@
<com.android.launcher2.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="workspace_landscape">
+ launcher:drawIdentifier="workspace_landscape"
+ android:background="#AA000000">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginLeft="40dp"
- android:layout_marginTop="40dp">
- <LinearLayout
- android:layout_width="match_parent"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="20dp">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/workspace_cling_title"
+ android:layout_marginTop="0dp"
+ android:text="@string/workspace_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/workspace_cling_move_item"
+ android:layout_width="285dp"
android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/workspace_cling_title"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_move_item"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/workspace_cling_move_item" />
- </LinearLayout>
+ android:layout_marginTop="50dp"
+ android:text="@string/workspace_cling_move_item" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/workspace_cling_open_all_apps"
+ android:layout_width="200dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="100dp"
+ android:text="@string/workspace_cling_open_all_apps" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="160dp"
+ android:onClick="dismissWorkspaceCling" />
</FrameLayout>
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_open_all_apps"
- android:layout_width="180dp"
- android:layout_height="wrap_content"
- android:layout_marginRight="130dp"
- android:layout_gravity="right|center_vertical"
- android:gravity="right"
- android:text="@string/workspace_cling_open_all_apps" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissWorkspaceCling" />
</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout-port/all_apps_cling.xml b/res/layout-port/all_apps_cling.xml
index e0dcf81..cd702ed 100644
--- a/res/layout-port/all_apps_cling.xml
+++ b/res/layout-port/all_apps_cling.xml
@@ -16,33 +16,30 @@
<com.android.launcher2.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="all_apps_portrait">
+ launcher:drawIdentifier="all_apps_portrait"
+ android:background="#CA000000">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
- android:layout_marginTop="90dp">
- <LinearLayout
- android:layout_width="match_parent"
+ android:layout_marginTop="50dp">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/all_apps_cling_title"
+ android:layout_marginTop="0dp"
+ android:text="@string/all_apps_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/all_apps_cling_add_item"
+ android:layout_width="280dp"
android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/all_apps_cling_title"
- android:text="@string/all_apps_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/all_apps_cling_add_item"
- android:layout_width="285dp"
- android:layout_height="wrap_content"
- android:text="@string/all_apps_cling_add_item" />
- </LinearLayout>
+ android:layout_marginTop="45dp"
+ android:text="@string/all_apps_cling_add_item" />
</FrameLayout>
<Button
style="@style/ClingButton"
android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
+ android:layout_marginBottom="40dp"
+ android:layout_gravity="center_horizontal|bottom"
android:onClick="dismissAllAppsCling" />
</com.android.launcher2.Cling>
diff --git a/res/layout-port/folder_cling.xml b/res/layout-port/folder_cling.xml
deleted file mode 100644
index d2374bf..0000000
--- a/res/layout-port/folder_cling.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- 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.Cling
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="folder_portrait">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="20dp"
- android:layout_marginTop="100dp">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/folder_cling_title"
- android:text="@string/folder_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/folder_cling_move_item"
- android:layout_width="285dp"
- android:layout_height="wrap_content"
- android:text="@string/folder_cling_move_item" />
- </LinearLayout>
- </FrameLayout>
- <TextView
- style="@style/ClingText"
- android:id="@+id/folder_cling_create_folder"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:layout_marginBottom="65dp"
- android:layout_gravity="bottom"
- android:text="@string/folder_cling_create_folder" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissFolderCling" />
-</com.android.launcher2.Cling>
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 061d8e3..9637700 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -81,10 +81,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
-
- <include layout="@layout/folder_cling"
- android:id="@+id/folder_cling"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
</com.android.launcher2.DragLayer>
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
index d5aff8a..8c4a0b3 100644
--- a/res/layout-port/workspace_cling.xml
+++ b/res/layout-port/workspace_cling.xml
@@ -16,42 +16,36 @@
<com.android.launcher2.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:drawIdentifier="workspace_portrait">
+ launcher:drawIdentifier="workspace_portrait"
+ android:background="#AA000000">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginTop="90dp">
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/workspace_cling_title"
+ android:layout_marginTop="0dp"
+ android:text="@string/workspace_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/workspace_cling_move_item"
+ android:layout_width="285dp"
android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/workspace_cling_title"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_move_item"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/workspace_cling_move_item" />
- </LinearLayout>
+ android:layout_marginTop="50dp"
+ android:text="@string/workspace_cling_move_item" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/workspace_cling_open_all_apps"
+ android:layout_width="200dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="100dp"
+ android:text="@string/workspace_cling_open_all_apps" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="160dp"
+ android:onClick="dismissWorkspaceCling" />
</FrameLayout>
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_open_all_apps"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="130dp"
- android:layout_gravity="bottom"
- android:gravity="center"
- android:text="@string/workspace_cling_open_all_apps" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="10dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissWorkspaceCling" />
</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index 27f2efe..75b0e7b 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -62,8 +62,6 @@
launcher:widgetCellHeightGap="@dimen/apps_customize_widget_cell_height_gap"
launcher:widgetCountX="@integer/apps_customize_widget_cell_count_x"
launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y"
- launcher:clingFocusedX="@integer/apps_customize_cling_focused_x"
- launcher:clingFocusedY="@integer/apps_customize_cling_focused_y"
launcher:maxGap="@dimen/workspace_max_gap" />
<ImageView
android:id="@+id/animation_buffer"
diff --git a/res/values-land/config.xml b/res/values-land/config.xml
index 121bb0c..cbc0a6e 100644
--- a/res/values-land/config.xml
+++ b/res/values-land/config.xml
@@ -20,4 +20,8 @@
<bool name="config_useDropTargetDownTransition">false</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">false</bool>
+
+ <!-- Padding applied to AppWidgets -->
+ <dimen name="app_widget_padding_top">8dp</dimen>
+ <dimen name="app_widget_padding_bottom">8dp</dimen>
</resources>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 4bb64f7..52c52f1 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -64,12 +64,6 @@
<dimen name="apps_customize_widget_cell_height_gap">5dp</dimen>
<integer name="apps_customize_widget_cell_count_x">3</integer>
<integer name="apps_customize_widget_cell_count_y">2</integer>
- <integer name="apps_customize_cling_focused_x">2</integer>
- <integer name="apps_customize_cling_focused_y">1</integer>
-
- <!-- Padding applied to AppWidgets -->
- <dimen name="app_widget_padding_top">8dp</dimen>
- <dimen name="app_widget_padding_bottom">8dp</dimen>
<!-- Folders -->
<!-- The size of the image which sits behind the preview of the folder contents -->
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
index 1c8282d..5632fcd 100644
--- a/res/values-port/dimens.xml
+++ b/res/values-port/dimens.xml
@@ -32,8 +32,6 @@
<dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">5dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">5dp</dimen>
- <integer name="apps_customize_cling_focused_x">1</integer>
- <integer name="apps_customize_cling_focused_y">2</integer>
<dimen name="apps_customize_widget_cell_width_gap">20dp</dimen>
<dimen name="apps_customize_widget_cell_height_gap">10dp</dimen>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 800aeaa..6c0bc14 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -131,10 +131,6 @@
<attr name="widgetCountX" format="integer" />
<!-- Number of widgets vertically -->
<attr name="widgetCountY" format="integer" />
- <!-- The x index of the item to be focused in the cling -->
- <attr name="clingFocusedX" format="integer" />
- <!-- The y index of the item to be focused in the cling -->
- <attr name="clingFocusedY" format="integer" />
</declare-styleable>
<!-- HandleView specific attributes. These attributes are used to customize
diff --git a/res/values/colors.xml b/res/values/colors.xml
index ece0fd8..2389f8e 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -32,4 +32,7 @@
<color name="workspace_all_apps_and_delete_zone_text_color">#CCFFFFFF</color>
<color name="workspace_all_apps_and_delete_zone_text_shadow_color">#A0000000</color>
+
+ <color name="cling_button">#BA49C0EC</color>
+ <color name="cling_button_pressed">#FF49C0EC</color>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2ade5c8..78c4b29 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -234,21 +234,16 @@
<!-- Clings -->
<!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
- <string name="workspace_cling_title">Make yourself at home</string>
- <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
- <string name="workspace_cling_move_item">You can put your favourite apps here.</string>
+ <string name="workspace_cling_title">Welcome Home!</string>
+ <!-- The description of how to pick up and move an item on the workspace [CHAR_LIMIT=none] -->
+ <string name="workspace_cling_move_item">To move an app or widget, touch & hold, then reposition it.</string>
<!-- The description of how to open all apps from the workspace [CHAR_LIMIT=none] -->
- <string name="workspace_cling_open_all_apps">To see all your apps, touch the circle.</string>
+ <string name="workspace_cling_open_all_apps">To see all your apps, touch the All Apps button.</string>
<!-- The title text for the All Apps cling [CHAR_LIMIT=none] -->
- <string name="all_apps_cling_title">Choose some apps</string>
+ <string name="all_apps_cling_title">Here are all your apps</string>
<!-- The description of how to pick up and add an item to the workspace [CHAR_LIMIT=none] -->
- <string name="all_apps_cling_add_item">To add an app to your home screen, touch & hold it.</string>
- <!-- The title text for the Folder cling [CHAR_LIMIT=none] -->
- <string name="folder_cling_title">Organize your apps with folders</string>
- <!-- The description of how to move an app [CHAR_LIMIT=none] -->
- <string name="folder_cling_move_item">To move an app, touch & hold it.</string>
- <!-- The description of how to create a folder [CHAR_LIMIT=none] -->
- <string name="folder_cling_create_folder">To make a new folder on your home screen, stack one app on top of another.</string>
+ <string name="all_apps_cling_add_item">To add an app or widget to your home screen, touch & hold, then position it.</string>
+
<!-- The text on the button to dismiss a cling [CHAR_LIMIT=none] -->
<string name="cling_dismiss">OK</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 19a05a0..9372dbe 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -28,10 +28,10 @@
<style name="ClingButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:paddingTop">10dp</item>
- <item name="android:paddingBottom">15dp</item>
- <item name="android:paddingLeft">35dp</item>
- <item name="android:paddingRight">35dp</item>
+ <item name="android:paddingTop">14dp</item>
+ <item name="android:paddingBottom">14dp</item>
+ <item name="android:paddingLeft">58dp</item>
+ <item name="android:paddingRight">58dp</item>
<item name="android:text">@string/cling_dismiss</item>
<item name="android:textStyle">bold</item>
<item name="android:background">@drawable/cling_button_bg</item>
@@ -39,8 +39,7 @@
<style name="ClingTitleText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginBottom">5dp</item>
- <item name="android:textSize">23sp</item>
+ <item name="android:textSize">28sp</item>
<item name="android:textColor">#49C0EC</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDy">2</item>
@@ -146,7 +145,7 @@
<item name="android:paddingRight">25dp</item>
<item name="android:textColor">#FFFFFFFF</item>
<item name="android:textSize">16sp</item>
- <item name="android:shadowColor">#FF000000</item>
+ <item name="android:shadowColor">#DD000000</item>
<item name="android:shadowDx">0.0</item>
<item name="android:shadowDy">1.0</item>
<item name="android:shadowRadius">4.0</item>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 96859d3..b208e88 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -174,10 +174,6 @@
private ArrayList<ApplicationInfo> mApps;
private ArrayList<Object> mWidgets;
- // Cling
- private int mClingFocusedX;
- private int mClingFocusedY;
-
// Caching
private Canvas mCanvas;
private Drawable mDefaultWidgetBackground;
@@ -238,8 +234,6 @@
a.getDimensionPixelSize(R.styleable.AppsCustomizePagedView_widgetCellHeightGap, 0);
mWidgetCountX = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountX, 2);
mWidgetCountY = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountY, 2);
- mClingFocusedX = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedX, 0);
- mClingFocusedY = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedY, 0);
a.recycle();
mWidgetSpacingLayout = new PagedViewCellLayout(getContext());
@@ -381,14 +375,6 @@
mContentWidth = mWidgetSpacingLayout.getContentWidth();
invalidatePageData(Math.max(0, mRestorePage));
mRestorePage = -1;
-
- int[] offset = new int[2];
- int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
- mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
- pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + offset[0];
- pos[1] += (getMeasuredHeight() - mWidgetSpacingLayout.getMeasuredHeight()) / 2 + offset[1];
- mLauncher.showFirstRunAllAppsCling(pos);
-
}
@Override
@@ -547,9 +533,6 @@
}
@Override
protected boolean beginDragging(View v) {
- // Dismiss the cling
- mLauncher.dismissAllAppsCling(null);
-
if (!super.beginDragging(v)) return false;
// Go into spring loaded mode (must happen before we startDrag())
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 8b7b956..124cf73 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -271,7 +271,7 @@
/* LauncherTransitionable overrides */
@Override
- public void onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) {
+ public void onLauncherTransitionStart(Animator animation, boolean toWorkspace) {
mInTransition = true;
// isHardwareAccelerated() checks if we're attached to a window and if that
// window is HW accelerated-- we were sometimes not attached to a window
@@ -294,19 +294,14 @@
}
@Override
- public void onLauncherTransitionEnd(Launcher l, Animator animation, boolean toWorkspace) {
+ public void onLauncherTransitionEnd(Animator animation, boolean toWorkspace) {
mInTransition = false;
if (animation != null) {
setLayerType(LAYER_TYPE_NONE, null);
}
- if (!toWorkspace) {
- // Dismiss the cling if necessary
- l.dismissWorkspaceCling(null);
-
- if (!LauncherApplication.isScreenLarge()) {
- mAppsCustomizePane.hideScrollingIndicator(false);
- }
+ if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
+ mAppsCustomizePane.hideScrollingIndicator(false);
}
}
diff --git a/src/com/android/launcher2/Cling.java b/src/com/android/launcher2/Cling.java
index 4f37cb9..ae8dd43 100644
--- a/src/com/android/launcher2/Cling.java
+++ b/src/com/android/launcher2/Cling.java
@@ -19,12 +19,9 @@
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
-import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
-import android.graphics.Rect;
+import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
@@ -35,36 +32,23 @@
public class Cling extends FrameLayout {
- static final String WORKSPACE_CLING_DISMISSED_KEY = "cling.workspace.dismissed";
- static final String ALLAPPS_CLING_DISMISSED_KEY = "cling.allapps.dismissed";
- static final String FOLDER_CLING_DISMISSED_KEY = "cling.folder.dismissed";
-
private static String WORKSPACE_PORTRAIT = "workspace_portrait";
private static String WORKSPACE_LANDSCAPE = "workspace_landscape";
private static String ALLAPPS_PORTRAIT = "all_apps_portrait";
private static String ALLAPPS_LANDSCAPE = "all_apps_landscape";
- private static String FOLDER_PORTRAIT = "folder_portrait";
- private static String FOLDER_LANDSCAPE = "folder_landscape";
private Launcher mLauncher;
private boolean mIsInitialized;
private String mDrawIdentifier;
- private Drawable mBackground;
private Drawable mPunchThroughGraphic;
- private Drawable mHandTouchGraphic;
private int mPunchThroughGraphicCenterRadius;
private int mAppIconSize;
private int mTabBarHeight;
private int mTabBarHorizontalPadding;
- private int mButtonBarHeight;
- private float mRevealRadius;
- private int[] mPositionData;
- private Paint mErasePaint;
-
- private View mWorkspaceDesc1;
- private View mWorkspaceDesc2;
- private View mAllAppsDesc;
+ View mWorkspaceDesc1;
+ View mWorkspaceDesc2;
+ View mAllAppsDesc;
public Cling(Context context) {
this(context, null, 0);
@@ -82,148 +66,238 @@
a.recycle();
}
- void init(Launcher l, int[] positionData) {
+ void init(Launcher l) {
if (!mIsInitialized) {
mLauncher = l;
- mPositionData = positionData;
Resources r = getContext().getResources();
mPunchThroughGraphic = r.getDrawable(R.drawable.cling);
mPunchThroughGraphicCenterRadius =
r.getDimensionPixelSize(R.dimen.clingPunchThroughGraphicCenterRadius);
mAppIconSize = r.getDimensionPixelSize(R.dimen.app_icon_size);
- mRevealRadius = mAppIconSize * 1f;
mTabBarHeight = r.getDimensionPixelSize(R.dimen.apps_customize_tab_bar_height);
mTabBarHorizontalPadding =
r.getDimensionPixelSize(R.dimen.toolbar_button_horizontal_padding);
- mButtonBarHeight = r.getDimensionPixelSize(R.dimen.button_bar_height);
mWorkspaceDesc1 = findViewById(R.id.workspace_cling_move_item);
mWorkspaceDesc2 = findViewById(R.id.workspace_cling_open_all_apps);
mAllAppsDesc = findViewById(R.id.all_apps_cling_add_item);
-
- mErasePaint = new Paint();
- mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
- mErasePaint.setColor(0xFFFFFF);
- mErasePaint.setAlpha(0);
-
mIsInitialized = true;
}
}
void cleanup() {
- mBackground = null;
mPunchThroughGraphic = null;
- mHandTouchGraphic = null;
- mIsInitialized = false;
- }
-
- private int[] getPunchThroughPosition() {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)) {
- return new int[]{getMeasuredWidth() / 2, getMeasuredHeight() - (mButtonBarHeight / 2)};
- } else if (mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)) {
- return new int[]{getMeasuredWidth() - (mButtonBarHeight / 2), getMeasuredHeight() / 2};
- } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
- return mPositionData;
- }
- return new int[]{-1, -1};
}
@Override
public boolean onTouchEvent(android.view.MotionEvent event) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
- mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
- int[] pos = getPunchThroughPosition();
- double diff = Math.sqrt(Math.pow(event.getX() - pos[0], 2) +
- Math.pow(event.getY() - pos[1], 2));
- if (diff < mRevealRadius) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)) {
- // Do nothing
- } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT)) {
- // Do nothing
- }
- return false;
- }
- } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
- mDrawIdentifier.equals(FOLDER_LANDSCAPE)) {
- Folder f = mLauncher.getWorkspace().getOpenFolder();
- if (f != null) {
- Rect r = new Rect();
- f.getHitRect(r);
- if (r.contains((int) event.getX(), (int) event.getY())) {
- return false;
- }
- }
- }
+ // Do nothing
return true;
};
@Override
protected void dispatchDraw(Canvas canvas) {
+ // Draw the rest of the cling
+ super.dispatchDraw(canvas);
+
if (mIsInitialized) {
DisplayMetrics metrics = new DisplayMetrics();
mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ int dotRadius = (int) (6f * metrics.density);
+ Paint p = new Paint();
+ p.setAntiAlias(true);
+ p.setColor(0xFF49C0EC);
+
+ if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)) {
+ /* Draw the all apps line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mWorkspaceDesc2.getLayoutParams();
+ int[] loc = new int[2];
+ mWorkspaceDesc2.getLocationInWindow(loc);
+ int x = loc[0];
+ int xOffset = (int) (10f * metrics.density);
+ int y = loc[1];
+ int yOffset = (int) (30f * metrics.density);
+ int w = mWorkspaceDesc2.getWidth();
+ int h = mWorkspaceDesc2.getHeight();
+
+ Point p1 = new Point(x + w + xOffset, y - (2 * dotRadius));
+ Point p2 = new Point(getMeasuredWidth() / 2, getMeasuredHeight() -
+ mAppIconSize / 2 - yOffset);
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+
+ Point p3 = new Point(p1.x, (int) (p1.y + (p2.y - p1.y) * 0.30f));
+ Point p4 = new Point(p2.x, (int) (p1.y + (p2.y - p1.y) * 0.55f));
+ canvas.drawLine(p1.x, p1.y, p3.x, p3.y, p);
+ canvas.drawLine(p3.x, p3.y, p4.x, p4.y, p);
+ canvas.drawLine(p4.x, p4.y, p2.x, p2.y, p);
+ }
+
+ /* Draw the move line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mWorkspaceDesc1.getLayoutParams();
+ int[] loc = new int[2];
+ mWorkspaceDesc1.getLocationInWindow(loc);
+ int x = loc[0];
+ int y = loc[1];
+ int w = mWorkspaceDesc1.getWidth();
+ int h = mWorkspaceDesc1.getHeight();
+
+ Point p1 = new Point(x + w, y - (2 * dotRadius));
+ Point p2 = new Point(x + w, getMeasuredHeight() - (4 * mAppIconSize));
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+ canvas.drawLine(p1.x, p1.y, p2.x, p2.y, p);
+ }
+ } else if (mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)) {
+ int xOffset = (int) (1.5f * mAppIconSize);
+ /* Draw the all apps line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mWorkspaceDesc2.getLayoutParams();
+ int[] loc = new int[2];
+ mWorkspaceDesc2.getLocationInWindow(loc);
+ int x = loc[0];
+ int y = loc[1];
+ int w = mWorkspaceDesc2.getWidth();
+ int h = mWorkspaceDesc2.getHeight();
+
+ Point p1 = new Point(x + w, y - (2 * dotRadius));
+ Point p2 = new Point(getMeasuredWidth() - xOffset,
+ getMeasuredHeight() / 2);
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+
+ Point p3 = new Point((int) (p1.x + (p2.x - p1.x) * 0.6f), p1.y);
+ Point p4 = new Point((int) (p1.x + (p2.x - p1.x) * 0.75f), p2.y);
+ canvas.drawLine(p1.x, p1.y, p3.x, p3.y, p);
+ canvas.drawLine(p3.x, p3.y, p4.x, p4.y, p);
+ canvas.drawLine(p4.x, p4.y, p2.x, p2.y, p);
+ }
+
+ /* Draw the move line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mWorkspaceDesc1.getLayoutParams();
+ int[] loc = new int[2];
+ mWorkspaceDesc1.getLocationInWindow(loc);
+ int x = loc[0];
+ int y = loc[1];
+ int w = mWorkspaceDesc1.getWidth();
+ int h = mWorkspaceDesc1.getHeight();
+
+ Point p1 = new Point(x + w, y - (2 * dotRadius));
+ Point p2 = new Point(getMeasuredWidth() - xOffset, y - (2 * dotRadius));
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+ canvas.drawLine(p1.x, p1.y, p2.x, p2.y, p);
+ }
+ } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT)) {
+ float r = mAppIconSize * 1.1f;
+ float scale = r / mPunchThroughGraphicCenterRadius;
+ int dw = (int) (scale * mPunchThroughGraphic.getIntrinsicWidth());
+ int dh = (int) (scale * mPunchThroughGraphic.getIntrinsicHeight());
+ int cx = getMeasuredWidth() / 2;
+ int cy = mTabBarHeight + ((getMeasuredHeight() - mTabBarHeight) / 2);
+ mPunchThroughGraphic.setBounds(cx - dw/2, cy - dh/2, cx + dw/2, cy + dh/2);
+ mPunchThroughGraphic.draw(canvas);
+
+ /* Draw the line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mAllAppsDesc.getLayoutParams();
+ int[] loc = new int[2];
+ mAllAppsDesc.getLocationInWindow(loc);
+ int x = loc[0];
+ int y = loc[1];
+ int yOffset = (int) (2.5f * metrics.density);
+ int w = mAllAppsDesc.getWidth();
+ int h = mAllAppsDesc.getHeight();
+
+ Point p1 = new Point(getMeasuredWidth() / 2, y + h + yOffset);
+ Point p2 = new Point(cx, cy);
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+ canvas.drawLine(p1.x, p1.y, p2.x, p2.y, p);
+ }
+ } else if (mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
+ float r = mAppIconSize * 1.1f;
+ float scale = r / mPunchThroughGraphicCenterRadius;
+ int dw = (int) (scale * mPunchThroughGraphic.getIntrinsicWidth());
+ int dh = (int) (scale * mPunchThroughGraphic.getIntrinsicHeight());
+ int cx = getMeasuredWidth() / 2 + getMeasuredWidth() / 4;
+ int cy = mTabBarHeight + ((getMeasuredHeight() - mTabBarHeight) / 2);
+ mPunchThroughGraphic.setBounds(cx - dw/2, cy - dh/2, cx + dw/2, cy + dh/2);
+ mPunchThroughGraphic.draw(canvas);
+
+ /* Draw the line */ {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)
+ mAllAppsDesc.getLayoutParams();
+ int[] loc = new int[2];
+ mAllAppsDesc.getLocationInWindow(loc);
+ int x = loc[0];
+ int y = loc[1];
+ int w = mAllAppsDesc.getWidth();
+ int h = mAllAppsDesc.getHeight();
+
+ Point p1 = new Point(x + w, y);
+ Point p2 = new Point(cx, cy);
+ canvas.drawCircle(p1.x, p1.y, dotRadius, p);
+ canvas.drawCircle(p2.x, p2.y, dotRadius, p);
+ canvas.drawLine(p1.x, p1.y, p2.x, p2.y, p);
+ }
+ }
+
+ /*
// Draw the background
Bitmap b = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(),
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
-
- // Draw the background
- if (mBackground == null) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)) {
- mBackground = getResources().getDrawable(R.drawable.bg_cling1);
- } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT)) {
- mBackground = getResources().getDrawable(R.drawable.bg_cling2);
- } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT)) {
- mBackground = getResources().getDrawable(R.drawable.bg_cling3);
- }
- }
- if (mBackground != null) {
- mBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
- mBackground.draw(c);
- } else {
- c.drawColor(0x99000000);
- }
+ c.drawColor(0xD4000000);
+ Paint p = new Paint();
+ p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
+ p.setColor(0xFFFFFF);
+ p.setAlpha(0);
int cx = -1;
int cy = -1;
- float scale = mRevealRadius / mPunchThroughGraphicCenterRadius;
+ float r = mAppIconSize * 1.4f;
+ float scale = r / mPunchThroughGraphicCenterRadius;
int dw = (int) (scale * mPunchThroughGraphic.getIntrinsicWidth());
int dh = (int) (scale * mPunchThroughGraphic.getIntrinsicHeight());
- // Determine where to draw the punch through graphic
- int[] pos = getPunchThroughPosition();
- cx = pos[0];
- cy = pos[1];
+ if (mDrawIdentifier.equals("workspace_portrait")) {
+ cx = getMeasuredWidth() / 2;
+ cy = getMeasuredHeight() - mAppIconSize / 2;
+ } else if (mDrawIdentifier.equals("workspace_landscape")) {
+ cx = getMeasuredWidth() - mAppIconSize / 2;
+ cy = getMeasuredHeight() / 2;
+ } else if (mDrawIdentifier.equals("large_workspace_landscape") ||
+ mDrawIdentifier.equals("large_workspace_portrait")) {
+ cx = getMeasuredWidth() - mTabBarHorizontalPadding;
+ cy = 0;
+ } else if (mDrawIdentifier.equals("all_apps_portrait")) {
+ cx = getMeasuredWidth() / 2;
+ cy = mTabBarHeight + ((getMeasuredHeight() - mTabBarHeight) / 2);
+ } else if (mDrawIdentifier.equals("all_apps_landscape")) {
+ cx = getMeasuredWidth() / 2 + getMeasuredWidth() / 4;
+ cy = mTabBarHeight + ((getMeasuredHeight() - mTabBarHeight) / 2);
+ } else if (mDrawIdentifier.equals("large_all_apps_portrait")) {
+ cx = getMeasuredWidth() / 2;
+ cy = mTabBarHeight + (int) ((getMeasuredHeight() - mTabBarHeight) * 2f / 5f);
+ } else if (mDrawIdentifier.equals("large_all_apps_landscape")) {
+ cx = getMeasuredWidth() / 2 + getMeasuredWidth() / 6;
+ cy = mTabBarHeight + (int) ((getMeasuredHeight() - mTabBarHeight) * 2f / 5f);
+ }
if (cx > -1 && cy > -1) {
- c.drawCircle(cx, cy, mRevealRadius, mErasePaint);
+ c.drawCircle(cx, cy, r, p);
mPunchThroughGraphic.setBounds(cx - dw/2, cy - dh/2, cx + dw/2, cy + dh/2);
mPunchThroughGraphic.draw(c);
}
-
- // Draw the hand graphic in All Apps
- if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
- if (mHandTouchGraphic == null) {
- mHandTouchGraphic = getResources().getDrawable(R.drawable.hand);
- }
- int offset = -mAppIconSize / 4;
- mHandTouchGraphic.setBounds(cx + offset, cy + offset,
- cx + mHandTouchGraphic.getIntrinsicWidth() + offset,
- cy + mHandTouchGraphic.getIntrinsicHeight() + offset);
- mHandTouchGraphic.draw(c);
- }
-
canvas.drawBitmap(b, 0, 0, null);
c.setBitmap(null);
b = null;
+ */
}
-
- // Draw the rest of the cling
- super.dispatchDraw(canvas);
};
}
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index 28ef6a5..d0d4bad 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -108,7 +108,7 @@
}
Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
- if (currentFolder != null && !mLauncher.isFolderClingVisible() && intercept) {
+ if (currentFolder != null && intercept) {
if (currentFolder.isEditingName()) {
getDescendantRectRelativeToSelf(currentFolder.getEditTextRegion(), hitRect);
if (!hitRect.contains(x, y)) {
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index a1aa670..a0342cf 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -208,8 +208,6 @@
return false;
}
- mLauncher.dismissFolderCling(null);
-
mLauncher.getWorkspace().onDragStartedWithItem(v);
mLauncher.getWorkspace().beginDragShared(v, this);
mIconDrawable = ((TextView) v).getCompoundDrawables()[1];
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 318601d..29f3f25 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -75,12 +75,11 @@
import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
-import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
+import android.view.View.OnLongClickListener;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.AccelerateDecelerateInterpolator;
-import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.Advanceable;
@@ -162,8 +161,7 @@
static final int APPWIDGET_HOST_ID = 1024;
private static final int EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT = 300;
private static final int EXIT_SPRINGLOADED_MODE_LONG_TIMEOUT = 600;
- private static final int SHOW_CLING_DURATION = 250;
- private static final int DISMISS_CLING_DURATION = 250;
+ private static final int DISMISS_CLING_DURATION = 300;
private static final Object sLock = new Object();
private static int sScreen = DEFAULT_SCREEN;
@@ -273,7 +271,7 @@
checkForLocaleChange();
setContentView(R.layout.launcher);
setupViews();
- showFirstRunWorkspaceCling();
+ enableClingsIfNecessary();
registerContentObservers();
@@ -874,7 +872,9 @@
return p;
}
- if (appInfo.targetSdkVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ // TODO: This should be ICE_CREAM_SANDWICH, but since the unbundled apps
+ // may not have updated their targetSdkVersion yet, we've bumped it down for now.
+ if (appInfo.targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB_MR2) {
Resources r = getResources();
p.left = r.getDimensionPixelSize(R.dimen.app_widget_padding_left);
p.right = r.getDimensionPixelSize(R.dimen.app_widget_padding_right);
@@ -1770,8 +1770,6 @@
final FolderInfo info = folderIcon.mInfo;
Folder openFolder = mWorkspace.getFolderForTag(info);
- Cling cling = showFirstRunFoldersCling();
-
// If the folder info reports that the associated folder is open, then verify that
// it is actually opened. There have been a few instances where this gets out of sync.
if (info.opened && openFolder == null) {
@@ -1800,10 +1798,6 @@
}
}
}
-
- if (cling != null) {
- cling.bringToFront();
- }
}
private void growAndFadeOutFolderIcon(FolderIcon fi) {
@@ -1880,9 +1874,6 @@
Folder folder = mWorkspace.getOpenFolder();
if (folder != null) {
closeFolder(folder);
-
- // Dismiss the folder cling
- dismissFolderCling(null);
}
}
@@ -2128,7 +2119,6 @@
*/
private void cameraZoomOut(State toState, boolean animated, final boolean springLoaded) {
final Resources res = getResources();
- final Launcher instance = this;
final int duration = res.getInteger(R.integer.config_appsCustomizeZoomInTime);
final int fadeDuration = res.getInteger(R.integer.config_appsCustomizeFadeInTime);
@@ -2169,8 +2159,7 @@
alphaAnim.start();
if (toView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) toView).onLauncherTransitionStart(instance, scaleAnim,
- false);
+ ((LauncherTransitionable) toView).onLauncherTransitionStart(scaleAnim, false);
}
scaleAnim.addListener(new AnimatorListenerAdapter() {
boolean animationCancelled = false;
@@ -2192,8 +2181,7 @@
toView.setScaleX(1.0f);
toView.setScaleY(1.0f);
if (toView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) toView).onLauncherTransitionEnd(instance,
- scaleAnim, false);
+ ((LauncherTransitionable) toView).onLauncherTransitionEnd(scaleAnim, false);
}
if (!springLoaded && !LauncherApplication.isScreenLarge()) {
@@ -2226,8 +2214,8 @@
toView.setVisibility(View.VISIBLE);
toView.bringToFront();
if (toView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) toView).onLauncherTransitionStart(instance, null, false);
- ((LauncherTransitionable) toView).onLauncherTransitionEnd(instance, null, false);
+ ((LauncherTransitionable) toView).onLauncherTransitionStart(null, false);
+ ((LauncherTransitionable) toView).onLauncherTransitionEnd(null, false);
if (!springLoaded && !LauncherApplication.isScreenLarge()) {
// Hide the workspace scrollbar
@@ -2247,7 +2235,6 @@
*/
private void cameraZoomIn(State fromState, boolean animated, final boolean springLoaded) {
Resources res = getResources();
- final Launcher instance = this;
final int duration = res.getInteger(R.integer.config_appsCustomizeZoomOutTime);
final float scaleFactor = (float)
@@ -2283,8 +2270,7 @@
}
});
if (fromView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) fromView).onLauncherTransitionStart(instance, alphaAnim,
- true);
+ ((LauncherTransitionable) fromView).onLauncherTransitionStart(alphaAnim, true);
}
alphaAnim.addListener(new AnimatorListenerAdapter() {
@Override
@@ -2292,8 +2278,7 @@
updateWallpaperVisibility(true);
fromView.setVisibility(View.GONE);
if (fromView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) fromView).onLauncherTransitionEnd(instance,
- alphaAnim, true);
+ ((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim,true);
}
mWorkspace.hideScrollingIndicator(false);
}
@@ -2304,8 +2289,8 @@
} else {
fromView.setVisibility(View.GONE);
if (fromView instanceof LauncherTransitionable) {
- ((LauncherTransitionable) fromView).onLauncherTransitionStart(instance, null, true);
- ((LauncherTransitionable) fromView).onLauncherTransitionEnd(instance, null, true);
+ ((LauncherTransitionable) fromView).onLauncherTransitionStart(null, true);
+ ((LauncherTransitionable) fromView).onLauncherTransitionEnd(null, true);
}
}
}
@@ -3082,40 +3067,33 @@
}
/* Cling related */
- private static final String PREFS_KEY = "com.android.launcher2.prefs";
- private boolean isClingsEnabled() {
+ private static final String WORKSPACE_CLING_DISMISSED_KEY = "cling.workspace.dismissed";
+ private static final String ALLAPPS_CLING_DISMISSED_KEY = "cling.allapps.dismissed";
+ private void enableClingsIfNecessary() {
// TEMPORARY: DISABLE CLINGS ON LARGE UI
- if (LauncherApplication.isScreenLarge()) return false;
- // disable clings when running in a test harness
- if(ActivityManager.isRunningInTestHarness()) return false;
+ if (LauncherApplication.isScreenLarge()) return;
- return true;
- }
- private Cling initCling(int clingId, int[] positionData, boolean animate, int delay) {
- Cling cling = (Cling) findViewById(clingId);
- if (cling != null) {
- cling.init(this, positionData);
+ // disable clings when running in a test harness
+ if(ActivityManager.isRunningInTestHarness()) return;
+
+ // Enable the clings only if they have not been dismissed before
+ SharedPreferences prefs =
+ getSharedPreferences("com.android.launcher2.prefs", Context.MODE_PRIVATE);
+ if (!prefs.getBoolean(WORKSPACE_CLING_DISMISSED_KEY, false)) {
+ Cling cling = (Cling) findViewById(R.id.workspace_cling);
+ cling.init(this);
cling.setVisibility(View.VISIBLE);
- cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
- if (animate) {
- cling.buildLayer();
- cling.setAlpha(0f);
- cling.animate()
- .alpha(1f)
- .setInterpolator(new DecelerateInterpolator())
- .setDuration(SHOW_CLING_DURATION)
- .setStartDelay(delay)
- .start();
- } else {
- cling.setAlpha(1f);
- }
}
- return cling;
+ if (!prefs.getBoolean(ALLAPPS_CLING_DISMISSED_KEY, false)) {
+ Cling cling = (Cling) findViewById(R.id.all_apps_cling);
+ cling.init(this);
+ cling.setVisibility(View.VISIBLE);
+ }
}
- private void dismissCling(final Cling cling, final String flag, int duration) {
+ private void dismissCling(final Cling cling, final String flag) {
if (cling != null) {
ObjectAnimator anim = ObjectAnimator.ofFloat(cling, "alpha", 0f);
- anim.setDuration(duration);
+ anim.setDuration(DISMISS_CLING_DURATION);
anim.addListener(new AnimatorListenerAdapter() {
public void onAnimationEnd(Animator animation) {
cling.setVisibility(View.GONE);
@@ -3130,53 +3108,13 @@
anim.start();
}
}
- public void showFirstRunWorkspaceCling() {
- if (!isClingsEnabled()) return;
-
- // Enable the clings only if they have not been dismissed before
- SharedPreferences prefs =
- getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
- if (!prefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false)) {
- initCling(R.id.workspace_cling, null, false, 0);
- }
- }
- public void showFirstRunAllAppsCling(int[] position) {
- if (!isClingsEnabled()) return;
-
- // Enable the clings only if they have not been dismissed before
- SharedPreferences prefs =
- getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
- if (!prefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {
- initCling(R.id.all_apps_cling, position, true, 0);
- }
- }
- public Cling showFirstRunFoldersCling() {
- if (!isClingsEnabled()) return null;
-
- // Enable the clings only if they have not been dismissed before
- SharedPreferences prefs =
- getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
- Cling cling = null;
- if (!prefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {
- cling = initCling(R.id.folder_cling, null, true, 0);
- }
- return cling;
- }
- public boolean isFolderClingVisible() {
- Cling cling = (Cling) findViewById(R.id.folder_cling);
- return cling.getVisibility() == View.VISIBLE;
- }
public void dismissWorkspaceCling(View v) {
Cling cling = (Cling) findViewById(R.id.workspace_cling);
- dismissCling(cling, Cling.WORKSPACE_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ dismissCling(cling, WORKSPACE_CLING_DISMISSED_KEY);
}
public void dismissAllAppsCling(View v) {
Cling cling = (Cling) findViewById(R.id.all_apps_cling);
- dismissCling(cling, Cling.ALLAPPS_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
- }
- public void dismissFolderCling(View v) {
- Cling cling = (Cling) findViewById(R.id.folder_cling);
- dismissCling(cling, Cling.FOLDER_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ dismissCling(cling, ALLAPPS_CLING_DISMISSED_KEY);
}
/**
@@ -3200,6 +3138,6 @@
}
interface LauncherTransitionable {
- void onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace);
- void onLauncherTransitionEnd(Launcher l, Animator animation, boolean toWorkspace);
+ void onLauncherTransitionStart(Animator animation, boolean toWorkspace);
+ void onLauncherTransitionEnd(Animator animation, boolean toWorkspace);
}
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index d7e9e06..9a105d1 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -204,9 +204,9 @@
mPageLayoutPaddingRight = a.getDimensionPixelSize(
R.styleable.PagedView_pageLayoutPaddingRight, 0);
mPageLayoutWidthGap = a.getDimensionPixelSize(
- R.styleable.PagedView_pageLayoutWidthGap, 0);
+ R.styleable.PagedView_pageLayoutWidthGap, -1);
mPageLayoutHeightGap = a.getDimensionPixelSize(
- R.styleable.PagedView_pageLayoutHeightGap, 0);
+ R.styleable.PagedView_pageLayoutHeightGap, -1);
mScrollIndicatorPaddingLeft =
a.getDimensionPixelSize(R.styleable.PagedView_scrollIndicatorPaddingLeft, 0);
mScrollIndicatorPaddingRight =
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 5e87b46..29dc352 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -352,14 +352,6 @@
return n;
}
- /** Returns an estimated center position of the cell at the specified index */
- public int[] estimateCellPosition(int x, int y) {
- return new int[] {
- mPaddingLeft + (x * mCellWidth) + (x * mWidthGap) + (mCellWidth / 2),
- mPaddingTop + (y * mCellHeight) + (y * mHeightGap) + (mCellHeight / 2)
- };
- }
-
public void calculateCellCount(int width, int height, int maxCellCountX, int maxCellCountY) {
mCellCountX = Math.min(maxCellCountX, estimateCellHSpan(width));
mCellCountY = Math.min(maxCellCountY, estimateCellVSpan(height));