Merge "Potential fix for out-of-date hardware layers" into ics-mr1
diff --git a/res/drawable-hdpi/bg_cling4.png b/res/drawable-hdpi/bg_cling4.png
new file mode 100644
index 0000000..9403667
--- /dev/null
+++ b/res/drawable-hdpi/bg_cling4.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_home_all_apps_holo_dark.png b/res/drawable-hdpi/ic_home_all_apps_holo_dark.png
index 1533a15..be2a880 100644
--- a/res/drawable-hdpi/ic_home_all_apps_holo_dark.png
+++ b/res/drawable-hdpi/ic_home_all_apps_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling4.png b/res/drawable-mdpi/bg_cling4.png
new file mode 100644
index 0000000..2f152f4d
--- /dev/null
+++ b/res/drawable-mdpi/bg_cling4.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_home_all_apps_holo_dark.png b/res/drawable-mdpi/ic_home_all_apps_holo_dark.png
index ebbc792..3efe18e 100644
--- a/res/drawable-mdpi/ic_home_all_apps_holo_dark.png
+++ b/res/drawable-mdpi/ic_home_all_apps_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling4.png b/res/drawable-xhdpi/bg_cling4.png
new file mode 100644
index 0000000..f4bb83e
--- /dev/null
+++ b/res/drawable-xhdpi/bg_cling4.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_home_all_apps_holo_dark.png b/res/drawable-xhdpi/ic_home_all_apps_holo_dark.png
index 61d9b55..18c5a0a 100644
--- a/res/drawable-xhdpi/ic_home_all_apps_holo_dark.png
+++ b/res/drawable-xhdpi/ic_home_all_apps_holo_dark.png
Binary files differ
diff --git a/res/drawable/tab_widget_indicator_selector.xml b/res/drawable/tab_widget_indicator_selector.xml
index ff92b40..d06f757 100644
--- a/res/drawable/tab_widget_indicator_selector.xml
+++ b/res/drawable/tab_widget_indicator_selector.xml
@@ -16,7 +16,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
- <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected_holo" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_holo" />
<!-- Focused states -->
diff --git a/res/layout-sw600dp-land/all_apps_cling.xml b/res/layout-sw600dp-land/all_apps_cling.xml
deleted file mode 100644
index bca7baf..0000000
--- a/res/layout-sw600dp-land/all_apps_cling.xml
+++ /dev/null
@@ -1,43 +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="large_all_apps_landscape">
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="160dp"
- android:layout_marginLeft="200dp">
- <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="340dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="45dp"
- android:text="@string/all_apps_cling_add_item" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginTop="120dp"
- android:onClick="dismissAllAppsCling" />
- </FrameLayout>
-</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout-sw600dp-land/workspace_cling.xml b/res/layout-sw600dp-land/workspace_cling.xml
deleted file mode 100644
index 7175297..0000000
--- a/res/layout-sw600dp-land/workspace_cling.xml
+++ /dev/null
@@ -1,54 +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="large_workspace_landscape">
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="260dp"
- android:layout_marginTop="30dp"
- android:layout_gravity="left|center_vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/workspace_cling_title"
- android:layout_marginTop="20dp"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_move_item"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="65dp"
- android:text="@string/workspace_cling_move_item" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginTop="95dp"
- android:onClick="dismissWorkspaceCling" />
- </FrameLayout>
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_open_all_apps"
- android:layout_width="200dp"
- android:layout_height="wrap_content"
- android:layout_gravity="right|top"
- android:layout_marginRight="160dp"
- android:layout_marginTop="30dp"
- android:gravity="left"
- android:text="@string/workspace_cling_open_all_apps" />
-</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout-sw600dp-port/all_apps_cling.xml b/res/layout-sw600dp-port/all_apps_cling.xml
deleted file mode 100644
index 507af51..0000000
--- a/res/layout-sw600dp-port/all_apps_cling.xml
+++ /dev/null
@@ -1,44 +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="large_all_apps_portrait">
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="100dp"
- android:layout_marginLeft="0dp">
- <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="340dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="45dp"
- android:text="@string/all_apps_cling_add_item" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginTop="95dp"
- android:onClick="dismissAllAppsCling" />
- </FrameLayout>
-</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout-sw600dp-port/folder_cling.xml b/res/layout-sw600dp-port/folder_cling.xml
new file mode 100644
index 0000000..017d0fd
--- /dev/null
+++ b/res/layout-sw600dp-port/folder_cling.xml
@@ -0,0 +1,46 @@
+<?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_large">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <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_create_folder"
+ android:layout_width="480dp"
+ android:layout_height="wrap_content"
+ android:text="@string/folder_cling_create_folder" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissFolderCling" />
+ </LinearLayout>
+ </FrameLayout>
+</com.android.launcher2.Cling>
diff --git a/res/layout-sw600dp-port/workspace_cling.xml b/res/layout-sw600dp-port/workspace_cling.xml
index 0b9477c..2eae0fc 100644
--- a/res/layout-sw600dp-port/workspace_cling.xml
+++ b/res/layout-sw600dp-port/workspace_cling.xml
@@ -16,39 +16,41 @@
<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="large_workspace_portrait">
+ launcher:drawIdentifier="workspace_large">
<FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="60dp"
- android:layout_marginTop="30dp"
- android:layout_gravity="left|center_vertical">
- <TextView
- style="@style/ClingTitleText"
- android:id="@+id/workspace_cling_title"
- android:layout_marginTop="20dp"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
- android:id="@+id/workspace_cling_move_item"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="65dp"
- android:text="@string/workspace_cling_move_item" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginTop="95dp"
- android:onClick="dismissWorkspaceCling" />
+ 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" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissWorkspaceCling" />
+ </LinearLayout>
</FrameLayout>
<TextView
style="@style/ClingText"
android:id="@+id/workspace_cling_open_all_apps"
- android:layout_width="200dp"
+ android:layout_width="180dp"
android:layout_height="wrap_content"
- android:layout_gravity="right|top"
- android:layout_marginRight="160dp"
- android:layout_marginTop="30dp"
- android:gravity="left"
+ android:layout_marginTop="15dp"
+ android:layout_marginRight="150dp"
+ android:layout_gravity="right"
+ android:gravity="right"
android:text="@string/workspace_cling_open_all_apps" />
</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout-sw600dp/all_apps_cling.xml b/res/layout-sw600dp/all_apps_cling.xml
new file mode 100644
index 0000000..7079b21
--- /dev/null
+++ b/res/layout-sw600dp/all_apps_cling.xml
@@ -0,0 +1,46 @@
+<?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="all_apps_large">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <LinearLayout
+ android:layout_width="match_parent"
+ 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" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissAllAppsCling" />
+ </LinearLayout>
+ </FrameLayout>
+</com.android.launcher2.Cling>
diff --git a/res/layout-sw600dp/folder_cling.xml b/res/layout-sw600dp/folder_cling.xml
new file mode 100644
index 0000000..4188804
--- /dev/null
+++ b/res/layout-sw600dp/folder_cling.xml
@@ -0,0 +1,46 @@
+<?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_large">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <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_create_folder"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/folder_cling_create_folder" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissFolderCling" />
+ </LinearLayout>
+ </FrameLayout>
+</com.android.launcher2.Cling>
diff --git a/res/layout-sw600dp/launcher.xml b/res/layout-sw600dp/launcher.xml
index bfa6f3e..94c69a6 100644
--- a/res/layout-sw600dp/launcher.xml
+++ b/res/layout-sw600dp/launcher.xml
@@ -45,4 +45,10 @@
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-sw600dp/market_button.xml b/res/layout-sw600dp/market_button.xml
index 3f31319..4ccecd9 100644
--- a/res/layout-sw600dp/market_button.xml
+++ b/res/layout-sw600dp/market_button.xml
@@ -19,8 +19,8 @@
style="@style/MarketButton"
android:onClick="onClickAppMarketButton"
android:gravity="center"
- android:paddingLeft="10dp"
- android:paddingRight="10dp"
+ android:paddingLeft="32dp"
+ android:paddingRight="32dp"
android:drawablePadding="10dp"
android:text="@string/market"
android:contentDescription="@string/market"
@@ -32,6 +32,5 @@
android:shadowDx="0.0"
android:shadowDy="0.0"
android:shadowRadius="2.0"
- android:background="@drawable/tab_widget_indicator_selector"
android:focusable="true"
android:clickable="true" />
diff --git a/res/layout-sw600dp/workspace_cling.xml b/res/layout-sw600dp/workspace_cling.xml
new file mode 100644
index 0000000..264b1e0
--- /dev/null
+++ b/res/layout-sw600dp/workspace_cling.xml
@@ -0,0 +1,56 @@
+<?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="workspace_large">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <LinearLayout
+ android:layout_width="match_parent"
+ 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" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissWorkspaceCling" />
+ </LinearLayout>
+ </FrameLayout>
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/workspace_cling_open_all_apps"
+ android:layout_width="180dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="90dp"
+ android:layout_marginRight="130dp"
+ android:layout_gravity="right"
+ android:gravity="right"
+ android:text="@string/workspace_cling_open_all_apps" />
+</com.android.launcher2.Cling>
\ No newline at end of file
diff --git a/res/layout/market_button.xml b/res/layout/market_button.xml
index 2d840d7..5e10156 100644
--- a/res/layout/market_button.xml
+++ b/res/layout/market_button.xml
@@ -19,13 +19,12 @@
style="@style/MarketButton"
android:onClick="onClickAppMarketButton"
android:gravity="center"
- android:paddingLeft="@dimen/toolbar_button_horizontal_padding"
- android:paddingRight="@dimen/toolbar_button_horizontal_padding"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
android:contentDescription="@string/market"
android:shadowColor="@color/workspace_all_apps_and_delete_zone_text_shadow_color"
android:shadowDx="0.0"
android:shadowDy="0.0"
android:shadowRadius="2.0"
- android:background="@drawable/tab_widget_indicator_selector"
android:focusable="true"
android:clickable="true" />
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
index bb155bd..7949d2d 100644
--- a/res/values-land/styles.xml
+++ b/res/values-land/styles.xml
@@ -65,10 +65,5 @@
<item name="android:shadowDy">1.0</item>
<item name="android:shadowRadius">4.0</item>
</style>
-
- <style name="TabIndicator.AppsCustomize">
- <item name="android:paddingTop">5dp</item>
- <item name="android:paddingBottom">10dp</item>
- </style>
</resources>
diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml
new file mode 100644
index 0000000..69d6e58
--- /dev/null
+++ b/res/values-sw340dp/dimens.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+
+<resources>
+ <!-- Drag padding to add to the bottom of drop targets -->
+ <dimen name="drop_target_drag_padding">20dp</dimen>
+</resources>
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
index f51f6f9..42c4353 100644
--- a/res/values-sw600dp-land/dimens.xml
+++ b/res/values-sw600dp-land/dimens.xml
@@ -37,4 +37,11 @@
<dimen name="apps_customize_pageLayoutPaddingRight">30dp</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">4</integer>
+ <integer name="apps_customize_cling_focused_y">2</integer>
+
+<!-- Cling -->
+ <!-- The offset for the text in the cling -->
+ <dimen name="cling_text_block_offset_x">140dp</dimen>
+ <dimen name="cling_text_block_offset_y">80dp</dimen>
</resources>
diff --git a/res/values-sw600dp-port/dimens.xml b/res/values-sw600dp-port/dimens.xml
index 6753cbf..5de73b6 100644
--- a/res/values-sw600dp-port/dimens.xml
+++ b/res/values-sw600dp-port/dimens.xml
@@ -40,4 +40,11 @@
<dimen name="apps_customize_pageLayoutPaddingRight">30dp</dimen>
<integer name="apps_customize_widget_cell_count_x">2</integer>
<integer name="apps_customize_widget_cell_count_y">3</integer>
+ <integer name="apps_customize_cling_focused_x">2</integer>
+ <integer name="apps_customize_cling_focused_y">2</integer>
+
+<!-- Cling -->
+ <!-- The offset for the text in the cling -->
+ <dimen name="cling_text_block_offset_x">80dp</dimen>
+ <dimen name="cling_text_block_offset_y">160dp</dimen>
</resources>
\ No newline at end of file
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 70e24be..e0542ba 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -18,6 +18,38 @@
-->
<resources>
+<!-- Clings -->
+ <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:text">@string/cling_dismiss</item>
+ <item name="android:textSize">20sp</item>
+ <item name="android:textStyle">bold</item>
+ <item name="android:background">@drawable/cling_button_bg</item>
+ </style>
+ <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">32sp</item>
+ <item name="android:textColor">#49C0EC</item>
+ <item name="android:shadowColor">#000000</item>
+ <item name="android:shadowDy">2</item>
+ <item name="android:shadowRadius">2.0</item>
+ </style>
+ <style name="ClingText">
+ <item name="android:textSize">22sp</item>
+ <item name="android:textColor">#FFFFFF</item>
+ <item name="android:shadowColor">#000000</item>
+ <item name="android:shadowDy">2</item>
+ <item name="android:shadowRadius">2.0</item>
+ <item name="android:lineSpacingMultiplier">1.1</item>
+ </style>
+
<!-- Workspace -->
<style name="WorkspaceIcon.Portrait">
<item name="android:drawablePadding">0dp</item>
@@ -79,10 +111,8 @@
<item name="android:textSize">13sp</item>
</style>
<style name="TabIndicator.AppsCustomize">
- <item name="android:paddingTop">16dp</item>
- <item name="android:paddingBottom">20dp</item>
- <item name="android:paddingLeft">48dp</item>
- <item name="android:paddingRight">48dp</item>
+ <item name="android:paddingLeft">32dp</item>
+ <item name="android:paddingRight">32dp</item>
<item name="android:textSize">14sp</item>
</style>
@@ -124,8 +154,8 @@
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical</item>
<item name="android:drawablePadding">7.5dp</item>
- <item name="android:paddingLeft">25dp</item>
- <item name="android:paddingRight">25dp</item>
+ <item name="android:paddingLeft">60dp</item>
+ <item name="android:paddingRight">60dp</item>
<item name="android:textColor">#FFFFFFFF</item>
<item name="android:textSize">16sp</item>
<item name="android:shadowColor">#393939</item>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 87c9be8..fe0cb00 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -18,6 +18,9 @@
<!-- Cling -->
<dimen name="clingPunchThroughGraphicCenterRadius">94dp</dimen>
<dimen name="folderClingMarginTop">20dp</dimen>
+ <!-- The offset for the text in the cling -->
+ <dimen name="cling_text_block_offset_x">0dp</dimen>
+ <dimen name="cling_text_block_offset_y">0dp</dimen>
<!-- Workspace -->
<!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
@@ -79,9 +82,6 @@
<dimen name="button_bar_width_right_padding">0dp</dimen>
<dimen name="button_bar_height_plus_padding">70dp</dimen>
- <!-- Drag padding to add to the drop targets -->
- <dimen name="drop_target_drag_padding">40dp</dimen>
-
<!-- extra horizontal spacing between mini screen thumbnails ie. in all
apps and in customization mode -->
<dimen name="smallScreenExtraSpacing">0dip</dimen>
@@ -91,6 +91,9 @@
<dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
<dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
+ <!-- Drag padding to add to the bottom of drop targets -->
+ <dimen name="drop_target_drag_padding">14dp</dimen>
+
<!-- padding between the delete zone drawable and text -->
<dimen name="delete_zone_drawable_padding">8dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ddbdb34..502a836 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -161,8 +161,8 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:gravity">center</item>
- <item name="android:paddingLeft">30dp</item>
- <item name="android:paddingRight">30dp</item>
+ <item name="android:paddingLeft">24dp</item>
+ <item name="android:paddingRight">24dp</item>
<item name="android:background">@drawable/tab_widget_indicator_selector</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">12sp</item>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 2cdd16a..0189d6c 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -193,6 +193,7 @@
private ArrayList<Object> mWidgets;
// Cling
+ private boolean mHasShownAllAppsCling;
private int mClingFocusedX;
private int mClingFocusedY;
@@ -396,14 +397,33 @@
int page = getPageForComponent(mSaveInstanceStateItemIndex);
invalidatePageData(Math.max(0, page));
- // Calculate the position for the cling punch through
- 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);
+ // Show All Apps cling if we are finished transitioning, otherwise, we will try again when
+ // the transition completes in AppsCustomizeTabHost (otherwise the wrong offsets will be
+ // returned while animating)
+ AppsCustomizeTabHost host = (AppsCustomizeTabHost) getTabHost();
+ if (!host.isTransitioning()) {
+ post(new Runnable() {
+ @Override
+ public void run() {
+ showAllAppsCling();
+ }
+ });
+ }
+ }
+ void showAllAppsCling() {
+ if (!mHasShownAllAppsCling && isDataReady() && testDataReady()) {
+ mHasShownAllAppsCling = true;
+ // Calculate the position for the cling punch through
+ int[] offset = new int[2];
+ int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
+ mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
+ // PagedViews are centered horizontally but top aligned
+ pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
+ offset[0];
+ pos[1] += offset[1];
+ mLauncher.showFirstRunAllAppsCling(pos);
+ }
}
@Override
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 897a7fb..778d6bc 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -388,8 +388,9 @@
}
if (!toWorkspace) {
- // Dismiss the cling if necessary
+ // Dismiss the workspace cling and show the all apps cling (if not already shown)
l.dismissWorkspaceCling(null);
+ mAppsCustomizePane.showAllAppsCling();
if (!LauncherApplication.isScreenLarge()) {
mAppsCustomizePane.hideScrollingIndicator(false);
diff --git a/src/com/android/launcher2/Cling.java b/src/com/android/launcher2/Cling.java
index 32b1de4..f9a0681 100644
--- a/src/com/android/launcher2/Cling.java
+++ b/src/com/android/launcher2/Cling.java
@@ -44,6 +44,9 @@
private static String ALLAPPS_LANDSCAPE = "all_apps_landscape";
private static String FOLDER_PORTRAIT = "folder_portrait";
private static String FOLDER_LANDSCAPE = "folder_landscape";
+ private static String WORKSPACE_LARGE = "workspace_large";
+ private static String FOLDER_LARGE = "folder_large";
+ private static String ALLAPPS_LARGE = "all_apps_large";
private Launcher mLauncher;
private boolean mIsInitialized;
@@ -109,8 +112,14 @@
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(WORKSPACE_LARGE)) {
+ final float scale = LauncherApplication.getScreenDensity();
+ final int cornerXOffset = (int) (scale * 15);
+ final int cornerYOffset = (int) (scale * 10);
+ return new int[]{getMeasuredWidth() - cornerXOffset, cornerYOffset};
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
+ mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_LARGE)) {
return mPositionData;
}
return new int[]{-1, -1};
@@ -120,8 +129,10 @@
public boolean onTouchEvent(android.view.MotionEvent event) {
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE) ||
mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
+ mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_LARGE)) {
int[] pos = getPunchThroughPosition();
double diff = Math.sqrt(Math.pow(event.getX() - pos[0], 2) +
Math.pow(event.getY() - pos[1], 2));
@@ -129,7 +140,8 @@
return false;
}
} else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
- mDrawIdentifier.equals(FOLDER_LANDSCAPE)) {
+ mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
+ mDrawIdentifier.equals(FOLDER_LARGE)) {
Folder f = mLauncher.getWorkspace().getOpenFolder();
if (f != null) {
Rect r = new Rect();
@@ -156,14 +168,18 @@
// Draw the background
if (mBackground == null) {
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)) {
+ mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE)) {
mBackground = getResources().getDrawable(R.drawable.bg_cling1);
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
+ mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_LARGE)) {
mBackground = getResources().getDrawable(R.drawable.bg_cling2);
} else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
mDrawIdentifier.equals(FOLDER_LANDSCAPE)) {
mBackground = getResources().getDrawable(R.drawable.bg_cling3);
+ } else if (mDrawIdentifier.equals(FOLDER_LARGE)) {
+ mBackground = getResources().getDrawable(R.drawable.bg_cling4);
}
}
if (mBackground != null) {
@@ -191,7 +207,8 @@
// Draw the hand graphic in All Apps
if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)) {
+ mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_LARGE)) {
if (mHandTouchGraphic == null) {
mHandTouchGraphic = getResources().getDrawable(R.drawable.hand);
}
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index ee054ab..286e2fe 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -101,7 +101,6 @@
private int mScrollState = SCROLL_OUTSIDE_ZONE;
private ScrollRunnable mScrollRunnable = new ScrollRunnable();
- private RectF mDeleteRegion;
private DropTarget mLastDropTarget;
private InputMethodManager mInputMethodManager;
@@ -486,12 +485,6 @@
}
mLastDropTarget = dropTarget;
- // Scroll, maybe, but not if we're in the delete region.
- boolean inDeleteRegion = false;
- if (mDeleteRegion != null) {
- inDeleteRegion = mDeleteRegion.contains(x, y);
- }
-
// After a scroll, the touch point will still be in the scroll region.
// Rather than scrolling immediately, require a bit of twiddling to scroll again
final int slop = ViewConfiguration.get(mLauncher).getScaledWindowTouchSlop();
@@ -500,7 +493,7 @@
mLastTouch[0] = x;
mLastTouch[1] = y;
- if (!inDeleteRegion && x < mScrollZone) {
+ if (x < mScrollZone) {
if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, SCROLL_LEFT)) {
@@ -508,7 +501,7 @@
mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
}
}
- } else if (!inDeleteRegion && x > mScrollView.getWidth() - mScrollZone) {
+ } else if (x > mScrollView.getWidth() - mScrollZone) {
if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, SCROLL_RIGHT)) {
@@ -669,15 +662,6 @@
mScrollView = v;
}
- /**
- * Specifies the delete region. We won't scroll on touch events over the delete region.
- *
- * @param region The rectangle in DragLayer coordinates of the delete region.
- */
- void setDeleteRegion(RectF region) {
- mDeleteRegion = region;
- }
-
DragView getDragView() {
return mDragObject.dragView;
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 43510c2..6ea14db 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3168,8 +3168,6 @@
/* Cling related */
private static final String PREFS_KEY = "com.android.launcher2.prefs";
private boolean isClingsEnabled() {
- // TEMPORARY: DISABLE CLINGS ON LARGE UI
- if (LauncherApplication.isScreenLarge()) return false;
// disable clings when running in a test harness
if(ActivityManager.isRunningInTestHarness()) return false;
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index fd5a3fc..88f7954 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2976,7 +2976,8 @@
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(cellLayout, loc);
resetTransitionTransform(cellLayout);
- float dragViewScale = r.width() / d.dragView.getMeasuredWidth();
+ float dragViewScale = Math.min(r.width() / d.dragView.getMeasuredWidth(),
+ r.height() / d.dragView.getMeasuredHeight());
// The animation will scale the dragView about its center, so we need to center about
// the final location.
loc[0] -= (d.dragView.getMeasuredWidth() - cellLayoutScale * r.width()) / 2;