Merge "Fix issue where you could page to -1 during spring loaded drag (issue 10640529)" into jb-ub-now-indigo-rose
diff --git a/proguard.flags b/proguard.flags
index 806105f..9b59b21 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -7,6 +7,7 @@
public void onClickConfigureButton(android.view.View);
public void onClickAllAppsButton(android.view.View);
public void onClickAppMarketButton(android.view.View);
+ public void dismissFirstRunCling(android.view.View);
public void dismissWorkspaceCling(android.view.View);
public void dismissAllAppsCling(android.view.View);
}
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/cling.9.png b/res/drawable-hdpi/cling.9.png
new file mode 100644
index 0000000..42a889f
--- /dev/null
+++ b/res/drawable-hdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-hdpi/cling.png b/res/drawable-hdpi/cling.png
deleted file mode 100644
index d605799..0000000
--- a/res/drawable-hdpi/cling.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_down.png b/res/drawable-hdpi/cling_arrow_down.png
new file mode 100644
index 0000000..4f521ea
--- /dev/null
+++ b/res/drawable-hdpi/cling_arrow_down.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_left.png b/res/drawable-hdpi/cling_arrow_left.png
new file mode 100644
index 0000000..13764c9
--- /dev/null
+++ b/res/drawable-hdpi/cling_arrow_left.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_right.png b/res/drawable-hdpi/cling_arrow_right.png
new file mode 100644
index 0000000..be52244
--- /dev/null
+++ b/res/drawable-hdpi/cling_arrow_right.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_up.png b/res/drawable-hdpi/cling_arrow_up.png
new file mode 100644
index 0000000..83b5b37
--- /dev/null
+++ b/res/drawable-hdpi/cling_arrow_up.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_button.9.png b/res/drawable-hdpi/cling_button.9.png
new file mode 100644
index 0000000..4dbe564
--- /dev/null
+++ b/res/drawable-hdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_button_pressed.9.png b/res/drawable-hdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..2a85cab
--- /dev/null
+++ b/res/drawable-hdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_container_holo.9.png b/res/drawable-hdpi/portal_container_holo.9.png
index 557ee5a..ba8a4a8 100644
--- a/res/drawable-hdpi/portal_container_holo.9.png
+++ b/res/drawable-hdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_inner_holo.png b/res/drawable-hdpi/portal_ring_inner_holo.png
index e953221..857a01e 100644
--- a/res/drawable-hdpi/portal_ring_inner_holo.png
+++ b/res/drawable-hdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_inner_nolip_holo.png b/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
index 257fc69..53df36a 100644
--- a/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
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/cling.9.png b/res/drawable-mdpi/cling.9.png
new file mode 100644
index 0000000..f6f730d
--- /dev/null
+++ b/res/drawable-mdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling.png b/res/drawable-mdpi/cling.png
deleted file mode 100644
index fba3a07..0000000
--- a/res/drawable-mdpi/cling.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_down.png b/res/drawable-mdpi/cling_arrow_down.png
new file mode 100644
index 0000000..58e66fb
--- /dev/null
+++ b/res/drawable-mdpi/cling_arrow_down.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_left.png b/res/drawable-mdpi/cling_arrow_left.png
new file mode 100644
index 0000000..023c717
--- /dev/null
+++ b/res/drawable-mdpi/cling_arrow_left.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_right.png b/res/drawable-mdpi/cling_arrow_right.png
new file mode 100644
index 0000000..cf0eb10
--- /dev/null
+++ b/res/drawable-mdpi/cling_arrow_right.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_up.png b/res/drawable-mdpi/cling_arrow_up.png
new file mode 100644
index 0000000..9b0e6b7
--- /dev/null
+++ b/res/drawable-mdpi/cling_arrow_up.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_button.9.png b/res/drawable-mdpi/cling_button.9.png
new file mode 100644
index 0000000..38de60a
--- /dev/null
+++ b/res/drawable-mdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_button_pressed.9.png b/res/drawable-mdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..c60837d
--- /dev/null
+++ b/res/drawable-mdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_container_holo.9.png b/res/drawable-mdpi/portal_container_holo.9.png
index 9a47517..1e4afae 100644
--- a/res/drawable-mdpi/portal_container_holo.9.png
+++ b/res/drawable-mdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_inner_holo.png b/res/drawable-mdpi/portal_ring_inner_holo.png
index 3d704af..72e0af8 100644
--- a/res/drawable-mdpi/portal_ring_inner_holo.png
+++ b/res/drawable-mdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_inner_nolip_holo.png b/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
index 1dbdbe8..483f0eb 100644
--- a/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
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/cling.9.png b/res/drawable-xhdpi/cling.9.png
new file mode 100644
index 0000000..9cc03c9
--- /dev/null
+++ b/res/drawable-xhdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling.png b/res/drawable-xhdpi/cling.png
deleted file mode 100644
index 1cee1de..0000000
--- a/res/drawable-xhdpi/cling.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_down.png b/res/drawable-xhdpi/cling_arrow_down.png
new file mode 100644
index 0000000..ee10933
--- /dev/null
+++ b/res/drawable-xhdpi/cling_arrow_down.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_left.png b/res/drawable-xhdpi/cling_arrow_left.png
new file mode 100644
index 0000000..cffbcf3
--- /dev/null
+++ b/res/drawable-xhdpi/cling_arrow_left.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_right.png b/res/drawable-xhdpi/cling_arrow_right.png
new file mode 100644
index 0000000..d880d67
--- /dev/null
+++ b/res/drawable-xhdpi/cling_arrow_right.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_up.png b/res/drawable-xhdpi/cling_arrow_up.png
new file mode 100644
index 0000000..fd2c60c
--- /dev/null
+++ b/res/drawable-xhdpi/cling_arrow_up.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button.9.png b/res/drawable-xhdpi/cling_button.9.png
new file mode 100644
index 0000000..1c93bc4
--- /dev/null
+++ b/res/drawable-xhdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button_pressed.9.png b/res/drawable-xhdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..b5d4aae
--- /dev/null
+++ b/res/drawable-xhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_container_holo.9.png b/res/drawable-xhdpi/portal_container_holo.9.png
index 4ae8d22..cedbdc4 100644
--- a/res/drawable-xhdpi/portal_container_holo.9.png
+++ b/res/drawable-xhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_inner_holo.png b/res/drawable-xhdpi/portal_ring_inner_holo.png
index b9867c0..f9acfa2 100644
--- a/res/drawable-xhdpi/portal_ring_inner_holo.png
+++ b/res/drawable-xhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
index e218713..eb2cf5f 100644
--- a/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_outer_holo.png b/res/drawable-xhdpi/portal_ring_outer_holo.png
index 286bee0..281e9b5 100644
--- a/res/drawable-xhdpi/portal_ring_outer_holo.png
+++ b/res/drawable-xhdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/btn_cling_normal.9.png b/res/drawable-xxhdpi/btn_cling_normal.9.png
deleted file mode 100644
index f5e8032..0000000
--- a/res/drawable-xxhdpi/btn_cling_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/btn_cling_pressed.9.png b/res/drawable-xxhdpi/btn_cling_pressed.9.png
deleted file mode 100644
index c507dd7..0000000
--- a/res/drawable-xxhdpi/btn_cling_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling.9.png b/res/drawable-xxhdpi/cling.9.png
new file mode 100644
index 0000000..3dcf121
--- /dev/null
+++ b/res/drawable-xxhdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling.png b/res/drawable-xxhdpi/cling.png
deleted file mode 100644
index 9446ea4..0000000
--- a/res/drawable-xxhdpi/cling.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_down.png b/res/drawable-xxhdpi/cling_arrow_down.png
new file mode 100644
index 0000000..48c4f06
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_arrow_down.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_left.png b/res/drawable-xxhdpi/cling_arrow_left.png
new file mode 100644
index 0000000..8760d05
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_arrow_left.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_right.png b/res/drawable-xxhdpi/cling_arrow_right.png
new file mode 100644
index 0000000..356ba17
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_arrow_right.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_up.png b/res/drawable-xxhdpi/cling_arrow_up.png
new file mode 100644
index 0000000..4cb805f
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_arrow_up.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button.9.png b/res/drawable-xxhdpi/cling_button.9.png
new file mode 100644
index 0000000..4f68a03
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button_pressed.9.png b/res/drawable-xxhdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..4bc0337
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_container_holo.9.png b/res/drawable-xxhdpi/portal_container_holo.9.png
index 2a28f4a..599a076 100644
--- a/res/drawable-xxhdpi/portal_container_holo.9.png
+++ b/res/drawable-xxhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_holo.png b/res/drawable-xxhdpi/portal_ring_inner_holo.png
index 3b93f83..8cd6a59 100644
--- a/res/drawable-xxhdpi/portal_ring_inner_holo.png
+++ b/res/drawable-xxhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
index 01f330c..0fad656 100644
--- a/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable/cling_button_bg.xml b/res/drawable/cling_button_bg.xml
index 3809cde..7bf6ce7 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="@drawable/cling_button_pressed" />
+ <item android:drawable="@drawable/cling_button" />
</selector>
diff --git a/res/layout-land/first_run_cling.xml b/res/layout-land/first_run_cling.xml
new file mode 100644
index 0000000..f827380
--- /dev/null
+++ b/res/layout-land/first_run_cling.xml
@@ -0,0 +1,84 @@
+<?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.launcher3.Cling
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ launcher:drawIdentifier="first_run_portrait">
+ <FrameLayout
+ android:id="@+id/content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:id="@+id/bubble_content"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical">
+ <TextView
+ style="@style/ClingAltTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:text="@string/first_run_cling_title"
+ android:textColor="#49C0EC"
+ android:textSize="32sp" />
+ <TextView
+ style="@style/ClingAltTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/first_run_cling_description"
+ android:textColor="#80000000"
+ android:textSize="16sp" />
+ </LinearLayout>
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|end"
+ android:layout_marginEnd="10dp"
+ android:layout_marginTop="80dp"
+ android:text="@string/first_run_cling_search_bar_hint"
+ android:visibility="gone" />
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="100dp"
+ android:text="@string/first_run_cling_custom_content_hint"
+ android:visibility="gone" />
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="10dp"
+ android:layout_marginBottom="100dp"
+ android:text="@string/first_run_cling_create_screens_hint"
+ android:visibility="gone" />
+ </FrameLayout>
+ <Button
+ style="@style/ClingButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="15dp"
+ android:layout_marginEnd="20dp"
+ android:layout_gravity="bottom|end"
+ android:onClick="dismissFirstRunCling" />
+</com.android.launcher3.Cling>
diff --git a/res/layout-land/folder_cling.xml b/res/layout-land/folder_cling.xml
index 275edee..171e395 100644
--- a/res/layout-land/folder_cling.xml
+++ b/res/layout-land/folder_cling.xml
@@ -16,33 +16,50 @@
<com.android.launcher3.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
- launcher:drawIdentifier="folder_landscape">
+ launcher:drawIdentifier="folder_portrait">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginStart="20dp"
- android:layout_marginTop="20dp">
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_marginTop="40dp"
+ android:layout_marginBottom="20dp">
<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"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/folder_cling_create_folder" />
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
+ android:orientation="vertical"
+ android:background="@drawable/cling">
+ <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" />
+ </LinearLayout>
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/cling_arrow_down" />
</LinearLayout>
</FrameLayout>
<Button
style="@style/ClingButton"
android:id="@+id/cling_dismiss"
android:layout_marginBottom="15dp"
- android:layout_marginEnd="10dp"
+ android:layout_marginEnd="20dp"
android:layout_gravity="bottom|end"
android:onClick="dismissFolderCling" />
</com.android.launcher3.Cling>
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index faf410b..2b9a9f3 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -57,6 +57,11 @@
<!-- The Workspace cling must appear under the AppsCustomizePagedView below to ensure
that it is still visible during the transition to AllApps and doesn't overlay on
top of that view. -->
+ <include layout="@layout/first_run_cling"
+ android:id="@+id/first_run_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
<include layout="@layout/workspace_cling"
android:id="@+id/workspace_cling"
android:layout_width="match_parent"
diff --git a/res/layout-land/workspace_cling.xml b/res/layout-land/workspace_cling.xml
index 8bd9e35..08fb8cf 100644
--- a/res/layout-land/workspace_cling.xml
+++ b/res/layout-land/workspace_cling.xml
@@ -18,42 +18,54 @@
xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
android:layout_width="match_parent"
android:layout_height="match_parent"
- launcher:drawIdentifier="workspace_landscape">
+ launcher:drawIdentifier="workspace_portrait">
<FrameLayout
+ android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginStart="40dp"
- android:layout_marginTop="40dp">
+ android:layout_marginStart="25dp"
+ android:layout_marginEnd="25dp"
+ android:layout_marginTop="20dp"
+ android:layout_marginBottom="100dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="40dp"
android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
+ <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/cling_arrow_up" />
+ <LinearLayout
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/workspace_cling_move_item" />
+ android:orientation="vertical"
+ android:background="@drawable/cling">
+ <TextView
+ style="@style/ClingTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/workspace_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/workspace_cling_move_item" />
+ </LinearLayout>
</LinearLayout>
</FrameLayout>
- <TextView
- style="@style/ClingText"
- android:layout_width="180dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="130dp"
- android:layout_gravity="end|center_vertical"
- android:gravity="end"
- android:text="@string/workspace_cling_open_all_apps" />
<Button
style="@style/ClingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
- android:layout_marginEnd="10dp"
+ android:layout_marginEnd="20dp"
android:layout_gravity="bottom|end"
android:onClick="dismissWorkspaceCling" />
</com.android.launcher3.Cling>
diff --git a/res/layout-port/first_run_cling.xml b/res/layout-port/first_run_cling.xml
new file mode 100644
index 0000000..cdc49b9
--- /dev/null
+++ b/res/layout-port/first_run_cling.xml
@@ -0,0 +1,83 @@
+<?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.launcher3.Cling
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ launcher:drawIdentifier="first_run_portrait">
+ <FrameLayout
+ android:id="@+id/content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:id="@+id/bubble_content"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical">
+ <TextView
+ style="@style/ClingAltTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="10dp"
+ android:text="@string/first_run_cling_title"
+ android:textColor="#49C0EC"
+ android:textSize="30sp" />
+ <TextView
+ style="@style/ClingAltTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/first_run_cling_description"
+ android:textColor="#80000000"
+ android:textSize="16sp" />
+ </LinearLayout>
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|end"
+ android:layout_marginEnd="10dp"
+ android:layout_marginTop="80dp"
+ android:text="@string/first_run_cling_search_bar_hint" />
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="100dp"
+ android:text="@string/first_run_cling_custom_content_hint" />
+ <TextView
+ style="@style/ClingHintText"
+ android:layout_width="160dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="10dp"
+ android:layout_marginBottom="100dp"
+ android:drawableEnd="@drawable/cling_arrow_right"
+ android:text="@string/first_run_cling_create_screens_hint" />
+ </FrameLayout>
+ <Button
+ style="@style/ClingButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="15dp"
+ android:layout_marginEnd="20dp"
+ android:layout_gravity="bottom|end"
+ android:onClick="dismissFirstRunCling" />
+</com.android.launcher3.Cling>
diff --git a/res/layout-port/folder_cling.xml b/res/layout-port/folder_cling.xml
index b91578f..bd4b5e2 100644
--- a/res/layout-port/folder_cling.xml
+++ b/res/layout-port/folder_cling.xml
@@ -21,29 +21,45 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
- android:layout_marginEnd="10dp"
- android:layout_marginTop="@dimen/folderClingMarginTop">
+ android:layout_marginEnd="20dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp">
<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"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/folder_cling_create_folder" />
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
+ android:orientation="vertical"
+ android:background="@drawable/cling">
+ <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" />
+ </LinearLayout>
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/cling_arrow_down" />
</LinearLayout>
</FrameLayout>
<Button
style="@style/ClingButton"
android:id="@+id/cling_dismiss"
android:layout_marginBottom="15dp"
- android:layout_marginEnd="10dp"
+ android:layout_marginEnd="20dp"
android:layout_gravity="bottom|end"
android:onClick="dismissFolderCling" />
</com.android.launcher3.Cling>
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 9844a37..faef7a5 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -64,6 +64,11 @@
<!-- The Workspace cling must appear under the AppsCustomizePagedView below to ensure
that it is still visible during the transition to AllApps and doesn't overlay on
top of that view. -->
+ <include layout="@layout/first_run_cling"
+ android:id="@+id/first_run_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
<include layout="@layout/workspace_cling"
android:id="@+id/workspace_cling"
android:layout_width="match_parent"
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
index 052e1a0..38d3858 100644
--- a/res/layout-port/workspace_cling.xml
+++ b/res/layout-port/workspace_cling.xml
@@ -20,43 +20,51 @@
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_portrait">
<FrameLayout
+ android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginStart="20dp"
- android:layout_marginEnd="20dp"
- android:layout_marginTop="90dp">
+ android:layout_marginStart="25dp"
+ android:layout_marginEnd="25dp"
+ android:layout_marginTop="20dp"
+ android:layout_marginBottom="120dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
+ <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
+ android:layout_gravity="center_horizontal"
+ android:src="@drawable/cling_arrow_up" />
+ <LinearLayout
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/workspace_cling_move_item" />
+ android:orientation="vertical"
+ android:background="@drawable/cling">
+ <TextView
+ style="@style/ClingTitleText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/workspace_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/workspace_cling_move_item" />
+ </LinearLayout>
</LinearLayout>
</FrameLayout>
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="20dp"
- android:layout_marginEnd="20dp"
- android:layout_marginBottom="130dp"
- android:layout_gravity="bottom"
- android:gravity="center"
- android:text="@string/workspace_cling_open_all_apps" />
<Button
style="@style/ClingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
- android:layout_marginEnd="10dp"
+ android:layout_marginEnd="20dp"
android:layout_gravity="bottom|end"
android:onClick="dismissWorkspaceCling" />
</com.android.launcher3.Cling>
diff --git a/res/layout-sw720dp/folder_cling.xml b/res/layout-sw720dp/folder_cling.xml
deleted file mode 100644
index 4193838..0000000
--- a/res/layout-sw720dp/folder_cling.xml
+++ /dev/null
@@ -1,46 +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.launcher3.Cling
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
- launcher:drawIdentifier="folder_large">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="@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.launcher3.Cling>
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index fee0198..951e63a 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -65,6 +65,11 @@
<!-- The Workspace cling must appear under the AppsCustomizePagedView below to ensure
that it is still visible during the transition to AllApps and doesn't overlay on
top of that view. -->
+ <include layout="@layout/first_run_cling"
+ android:id="@+id/first_run_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
<include layout="@layout/workspace_cling"
android:id="@+id/workspace_cling"
android:layout_width="match_parent"
diff --git a/res/layout-sw720dp/workspace_cling.xml b/res/layout-sw720dp/workspace_cling.xml
deleted file mode 100644
index 052e1a0..0000000
--- a/res/layout-sw720dp/workspace_cling.xml
+++ /dev/null
@@ -1,62 +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.launcher3.Cling
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- launcher:drawIdentifier="workspace_portrait">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="20dp"
- android:layout_marginEnd="20dp"
- android:layout_marginTop="90dp">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/workspace_cling_title" />
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/workspace_cling_move_item" />
- </LinearLayout>
- </FrameLayout>
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="20dp"
- android:layout_marginEnd="20dp"
- android:layout_marginBottom="130dp"
- android:layout_gravity="bottom"
- android:gravity="center"
- android:text="@string/workspace_cling_open_all_apps" />
- <Button
- style="@style/ClingButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="15dp"
- android:layout_marginEnd="10dp"
- android:layout_gravity="bottom|end"
- android:onClick="dismissWorkspaceCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout/folder_icon.xml b/res/layout/folder_icon.xml
index 9c5c46b..4405682 100644
--- a/res/layout/folder_icon.xml
+++ b/res/layout/folder_icon.xml
@@ -26,6 +26,7 @@
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:antialias="true"
android:src="@drawable/portal_ring_inner_holo"/>
<com.android.launcher3.BubbleTextView
style="@style/WorkspaceIcon"
diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml
index 45986e5..d01e2eb 100644
--- a/res/layout/user_folder.xml
+++ b/res/layout/user_folder.xml
@@ -44,8 +44,9 @@
android:background="#00000000"
android:hint="@string/folder_hint_text"
android:textSize="14sp"
- android:textColor="#ff33b5e5"
+ android:textColor="#ff777777"
android:textColorHighlight="#ff333333"
+ android:textCursorDrawable="@null"
android:gravity="center_horizontal"
android:singleLine="true"
android:imeOptions="flagNoExtractUi"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 01fd64c..6b9221c 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -33,4 +33,5 @@
<color name="apps_customize_icon_text_color">#FFF</color>
<color name="wallpaper_picker_translucent_gray">#66000000</color>
+ <color name="folder_items_text_color">#FF333333</color>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6b9b070..8406302 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -226,21 +226,27 @@
<!-- Clings -->
<!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
- <string name="workspace_cling_title">Make yourself at home</string>
+ <string name="first_run_cling_title">Welcome!</string>
<!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
- <string name="workspace_cling_move_item">You can put your favorite apps here.</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="first_run_cling_description">Make yourself at Home</string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+ <string name="first_run_cling_custom_content_hint"></string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+ <string name="first_run_cling_search_bar_hint"></string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+ <string name="first_run_cling_create_screens_hint">Create more screens for apps and folders</string>
+ <!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
+ <string name="workspace_cling_title">Organize your space</string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+ <string name="workspace_cling_move_item">Touch & hold background to manage wallpaper, widgets and settings</string>
<!-- The title text for the All Apps cling [CHAR_LIMIT=none] -->
<string name="all_apps_cling_title">Choose some 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>
+ <string name="folder_cling_title">Create new folders for your apps</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="folder_cling_create_folder">Touch & hold an app, then move it on top of another app icon</string>
<!-- The text on the button to dismiss a cling [CHAR_LIMIT=none] -->
<string name="cling_dismiss">OK</string>
<!-- Error message on dummy custom cling layout [DO NOT TRANSLATE] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 48b9dbc..e6bb935 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -35,34 +35,45 @@
<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:paddingTop">15dp</item>
<item name="android:paddingBottom">15dp</item>
- <item name="android:paddingStart">35dp</item>
- <item name="android:paddingEnd">35dp</item>
+ <item name="android:paddingStart">50dp</item>
+ <item name="android:paddingEnd">50dp</item>
<item name="android:text">@string/cling_dismiss</item>
+ <item name="android:textColor">#ffffff</item>
<item name="android:textStyle">bold</item>
+ <item name="android:textSize">16sp</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">23sp</item>
+ <item name="android:textSize">22sp</item>
+ <item name="android:textColor">#ffffff</item>
+ <item name="android:fontFamily">sans-serif-condensed</item>
+ </style>
+ <style name="ClingAltTitleText">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textSize">24sp</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>
+ <item name="android:fontFamily">sans-serif-condensed</item>
</style>
<style name="ClingText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:textSize">15sp</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:textSize">16sp</item>
+ <item name="android:textColor">#80000000</item>
<item name="android:lineSpacingMultiplier">1.1</item>
</style>
+ <style name="ClingHintText">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textSize">18sp</item>
+ <item name="android:textColor">#80ffffff</item>
+ <item name="android:fontFamily">sans-serif-condensed</item>
+ </style>
<style name="WorkspaceIcon">
<item name="android:layout_width">match_parent</item>
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index a36f444..213e50a 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -411,7 +411,6 @@
pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
offset[0];
pos[1] += offset[1] - mLauncher.getDragLayer().getPaddingTop();
- mLauncher.showFirstRunAllAppsCling(pos);
}
}
@@ -792,9 +791,6 @@
public void run() {
// We don't enter spring-loaded mode if the drag has been cancelled
if (mLauncher.getDragController().isDragging()) {
- // Dismiss the cling
- mLauncher.dismissAllAppsCling(null);
-
// Reset the alpha on the dragged icon before we drag
resetDrawableState();
diff --git a/src/com/android/launcher3/AppsCustomizeTabHost.java b/src/com/android/launcher3/AppsCustomizeTabHost.java
index 8aef864..89e74b2 100644
--- a/src/com/android/launcher3/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher3/AppsCustomizeTabHost.java
@@ -403,6 +403,9 @@
if (animated) {
enableAndBuildHardwareLayer();
}
+
+ // Dismiss the workspace cling
+ l.dismissWorkspaceCling(null);
}
@Override
@@ -419,8 +422,6 @@
}
if (!toWorkspace) {
- // Dismiss the workspace cling
- l.dismissWorkspaceCling(null);
// Show the all apps cling (if not already shown)
mAppsCustomizePane.showAllAppsCling();
// Make sure adjacent pages are loaded (we wait until after the transition to
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7a7a3b6..54f8846 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -20,6 +20,7 @@
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region.Op;
@@ -55,6 +56,8 @@
private int mPressedOutlineColor;
private int mPressedGlowColor;
+ private int mTextColor;
+ private boolean mShadowsEnabled = true;
private boolean mIsTextVisible;
private boolean mBackgroundSizeChanged;
@@ -85,6 +88,7 @@
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize);
+ setTextColor(getResources().getColor(R.color.workspace_icon_text_color));
}
private void init() {
@@ -290,6 +294,11 @@
@Override
public void draw(Canvas canvas) {
+ if (!mShadowsEnabled) {
+ super.draw(canvas);
+ return;
+ }
+
final Drawable background = mBackground;
if (background != null) {
final int scrollX = getScrollX();
@@ -340,12 +349,24 @@
if (mBackground != null) mBackground.setCallback(null);
}
+ @Override
+ public void setTextColor(int color) {
+ mTextColor = color;
+ super.setTextColor(color);
+ }
+
+ public void setShadowsEnabled(boolean enabled) {
+ mShadowsEnabled = enabled;
+ getPaint().clearShadowLayer();
+ invalidate();
+ }
+
public void setTextVisibility(boolean visible) {
Resources res = getResources();
if (visible) {
- setTextColor(res.getColor(R.color.workspace_icon_text_color));
+ super.setTextColor(mTextColor);
} else {
- setTextColor(res.getColor(android.R.color.transparent));
+ super.setTextColor(res.getColor(android.R.color.transparent));
}
mIsTextVisible = visible;
}
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 901f42b..661685b 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -491,31 +491,30 @@
for (int i = 0; i < mFolderOuterRings.size(); i++) {
FolderRingAnimator fra = mFolderOuterRings.get(i);
- // Draw outer ring
- Drawable d = FolderRingAnimator.sSharedOuterRingDrawable;
- int width = (int) (fra.getOuterRingSize() * getChildrenScale());
- int height = width;
+ Drawable d;
+ int width, height;
cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
View child = getChildAt(fra.mCellX, fra.mCellY);
+ int centerX = mTempLocation[0] + mCellWidth / 2;
+ int centerY = mTempLocation[1] + previewOffset / 2 +
+ child.getPaddingTop() + grid.folderBackgroundOffset;
if (child != null) {
- int centerX = mTempLocation[0] + mCellWidth / 2;
- int centerY = mTempLocation[1] + previewOffset / 2 +
- child.getPaddingTop() + grid.folderBackgroundOffset;
-
- canvas.save();
- canvas.translate(centerX - width / 2, centerY - height / 2);
- d.setBounds(0, 0, width, height);
- d.draw(canvas);
- canvas.restore();
+ // Draw outer ring, if it exists
+ if (FolderIcon.HAS_OUTER_RING) {
+ d = FolderRingAnimator.sSharedOuterRingDrawable;
+ width = (int) (fra.getOuterRingSize() * getChildrenScale());
+ height = width;
+ canvas.save();
+ canvas.translate(centerX - width / 2, centerY - height / 2);
+ d.setBounds(0, 0, width, height);
+ d.draw(canvas);
+ canvas.restore();
+ }
// Draw inner ring
d = FolderRingAnimator.sSharedInnerRingDrawable;
width = (int) (fra.getInnerRingSize() * getChildrenScale());
height = width;
-
- centerX = mTempLocation[0] + mCellWidth / 2;
- centerY = mTempLocation[1] + previewOffset / 2 +
- child.getPaddingTop() + grid.folderBackgroundOffset;
canvas.save();
canvas.translate(centerX - width / 2, centerY - width / 2);
d.setBounds(0, 0, width, height);
diff --git a/src/com/android/launcher3/Cling.java b/src/com/android/launcher3/Cling.java
index add6da5..963702a 100644
--- a/src/com/android/launcher3/Cling.java
+++ b/src/com/android/launcher3/Cling.java
@@ -16,6 +16,9 @@
package com.android.launcher3;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -31,40 +34,42 @@
import android.view.FocusFinder;
import android.view.MotionEvent;
import android.view.View;
+import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
-public class Cling extends FrameLayout {
+public class Cling extends FrameLayout implements Insettable, View.OnLongClickListener {
- 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";
+ static final String FIRST_RUN_CLING_DISMISSED_KEY = "cling_gel.first_run.dismissed";
+ static final String WORKSPACE_CLING_DISMISSED_KEY = "cling_gel.workspace.dismissed";
+ static final String FOLDER_CLING_DISMISSED_KEY = "cling_gel.folder.dismissed";
+
+ private static String FIRST_RUN_PORTRAIT = "first_run_portrait";
+ private static String FIRST_RUN_LANDSCAPE = "first_run_landscape";
private static String WORKSPACE_PORTRAIT = "workspace_portrait";
private static String WORKSPACE_LANDSCAPE = "workspace_landscape";
private static String WORKSPACE_LARGE = "workspace_large";
private static String WORKSPACE_CUSTOM = "workspace_custom";
- private static String ALLAPPS_PORTRAIT = "all_apps_portrait";
- private static String ALLAPPS_LANDSCAPE = "all_apps_landscape";
- private static String ALLAPPS_LARGE = "all_apps_large";
-
private static String FOLDER_PORTRAIT = "folder_portrait";
private static String FOLDER_LANDSCAPE = "folder_landscape";
private static String FOLDER_LARGE = "folder_large";
+ private static float FIRST_RUN_CIRCLE_BUFFER_DPS = 40;
+ private static float WORKSPACE_INNER_CIRCLE_RADIUS_DPS = 50;
+ private static float WORKSPACE_OUTER_CIRCLE_RADIUS_DPS = 60;
+ private static float WORKSPACE_CIRCLE_Y_OFFSET_DPS = 30;
+
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 mButtonBarHeight;
- private float mRevealRadius;
- private int[] mPositionData;
private Paint mErasePaint;
+ private Paint mBubblePaint;
+ private Paint mDotPaint;
+
+ private final Rect mInsets = new Rect();
public Cling(Context context) {
this(context, null, 0);
@@ -82,60 +87,116 @@
a.recycle();
setClickable(true);
+
}
void init(Launcher l, int[] positionData) {
if (!mIsInitialized) {
mLauncher = l;
- mPositionData = positionData;
-
- Resources r = getContext().getResources();
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
-
- mPunchThroughGraphic = r.getDrawable(R.drawable.cling);
- mPunchThroughGraphicCenterRadius =
- r.getDimensionPixelSize(R.dimen.clingPunchThroughGraphicCenterRadius);
- mAppIconSize = grid.iconSizePx;
- mRevealRadius = grid.iconSizePx * 1f;
- mButtonBarHeight = grid.hotseatBarHeightPx;
+ setOnLongClickListener(this);
mErasePaint = new Paint();
mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
mErasePaint.setColor(0xFFFFFF);
mErasePaint.setAlpha(0);
+ mErasePaint.setAntiAlias(true);
+
+ mBubblePaint = new Paint();
+ mBubblePaint.setColor(0xFFFFFF);
+ mBubblePaint.setAntiAlias(true);
+
+ mDotPaint = new Paint();
+ mDotPaint.setColor(0x72BBED);
+ mDotPaint.setAntiAlias(true);
mIsInitialized = true;
}
}
+ void show(boolean animate, int duration) {
+ setVisibility(View.VISIBLE);
+ setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
+ mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE) ||
+ mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
+ View content = getContent();
+ content.setAlpha(0f);
+ content.animate()
+ .alpha(1f)
+ .setDuration(duration)
+ .setListener(new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animation) {
+ };
+ })
+ .start();
+ setAlpha(1f);
+ } else {
+ if (animate) {
+ buildLayer();
+ setAlpha(0f);
+ animate()
+ .alpha(1f)
+ .setInterpolator(new AccelerateInterpolator())
+ .setDuration(duration)
+ .start();
+ } else {
+ setAlpha(1f);
+ }
+ }
+ setFocusableInTouchMode(true);
+ post(new Runnable() {
+ public void run() {
+ setFocusable(true);
+ requestFocus();
+ }
+ });
+ }
+
+ void hide(final int duration, final Runnable postCb) {
+ if (mDrawIdentifier.equals(FIRST_RUN_PORTRAIT) ||
+ mDrawIdentifier.equals(FIRST_RUN_LANDSCAPE)) {
+ View content = getContent();
+ ObjectAnimator anim = LauncherAnimUtils.ofFloat(content, "alpha", 0f);
+ anim.setDuration(duration);
+ anim.addListener(new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animation) {
+ // We are about to trigger the workspace cling, so don't do anything else
+ setVisibility(View.GONE);
+ postCb.run();
+ };
+ });
+ anim.start();
+ } else {
+ ObjectAnimator anim = LauncherAnimUtils.ofFloat(this, "alpha", 0f);
+ anim.setDuration(duration);
+ anim.addListener(new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animation) {
+ setVisibility(View.GONE);
+ postCb.run();
+ };
+ });
+ anim.start();
+ }
+ }
+
void cleanup() {
mBackground = null;
- mPunchThroughGraphic = null;
- mHandTouchGraphic = null;
mIsInitialized = false;
}
- public String getDrawIdentifier() {
- return mDrawIdentifier;
+ @Override
+ public void setInsets(Rect insets) {
+ mInsets.set(insets);
+ setPadding(insets.left, insets.top, insets.right, insets.bottom);
}
- private int[] getPunchThroughPositions() {
- 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(WORKSPACE_LARGE)) {
- final float scale = LauncherAppState.getInstance().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_LARGE)) {
- return mPositionData;
- }
- return new int[]{-1, -1};
+ View getContent() {
+ return findViewById(R.id.content);
+ }
+
+ String getDrawIdentifier() {
+ return mDrawIdentifier;
}
@Override
@@ -153,30 +214,12 @@
return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)
|| mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)
|| mDrawIdentifier.equals(WORKSPACE_LARGE)
- || mDrawIdentifier.equals(ALLAPPS_PORTRAIT)
- || mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)
- || mDrawIdentifier.equals(ALLAPPS_LARGE)
|| mDrawIdentifier.equals(WORKSPACE_CUSTOM));
}
@Override
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_LARGE)) {
-
- int[] positions = getPunchThroughPositions();
- for (int i = 0; i < positions.length; i += 2) {
- double diff = Math.sqrt(Math.pow(event.getX() - positions[i], 2) +
- Math.pow(event.getY() - positions[i + 1], 2));
- if (diff < mRevealRadius) {
- return false;
- }
- }
- } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
+ if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
mDrawIdentifier.equals(FOLDER_LARGE)) {
Folder f = mLauncher.getWorkspace().getOpenFolder();
@@ -188,81 +231,94 @@
}
}
}
- return true;
+ return super.onTouchEvent(event);
};
@Override
+ public boolean onLongClick(View v) {
+ if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
+ mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE)) {
+ mLauncher.dismissWorkspaceCling(null);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
protected void dispatchDraw(Canvas canvas) {
if (mIsInitialized) {
- DisplayMetrics metrics = new DisplayMetrics();
- mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ canvas.save();
- // Initialize the draw buffer (to allow punching through)
- Bitmap b = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(),
- Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
-
- // Draw the background
+ // Get the background override if there is one
if (mBackground == null) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- 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_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);
- } else if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
+ if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
mBackground = getResources().getDrawable(R.drawable.bg_cling5);
}
}
+ // Draw the background
+ Bitmap eraseBg = null;
+ Canvas eraseCanvas = null;
if (mBackground != null) {
mBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
- mBackground.draw(c);
+ mBackground.draw(canvas);
+ } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
+ mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
+ mDrawIdentifier.equals(FOLDER_LARGE)) {
+ canvas.drawColor(0xcc000000);
+ } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
+ mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE)) {
+ // Initialize the draw buffer (to allow punching through)
+ eraseBg = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(),
+ Bitmap.Config.ARGB_8888);
+ eraseCanvas = new Canvas(eraseBg);
+ eraseCanvas.drawColor(0xdd000000);
} else {
- c.drawColor(0x99000000);
+ canvas.drawColor(0xdd000000);
}
- int cx = -1;
- int cy = -1;
- float scale = mRevealRadius / mPunchThroughGraphicCenterRadius;
- int dw = (int) (scale * mPunchThroughGraphic.getIntrinsicWidth());
- int dh = (int) (scale * mPunchThroughGraphic.getIntrinsicHeight());
-
- // Determine where to draw the punch through graphic
- int[] positions = getPunchThroughPositions();
- for (int i = 0; i < positions.length; i += 2) {
- cx = positions[i];
- cy = positions[i + 1];
- if (cx > -1 && cy > -1) {
- c.drawCircle(cx, cy, mRevealRadius, mErasePaint);
- mPunchThroughGraphic.setBounds(cx - dw/2, cy - dh/2, cx + dw/2, cy + dh/2);
- mPunchThroughGraphic.draw(c);
- }
+ // Draw everything else
+ DisplayMetrics metrics = new DisplayMetrics();
+ mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ float alpha = getAlpha();
+ View content = getContent();
+ if (content != null) {
+ alpha *= content.getAlpha();
+ }
+ if (mDrawIdentifier.equals(FIRST_RUN_PORTRAIT) ||
+ mDrawIdentifier.equals(FIRST_RUN_LANDSCAPE)) {
+ // Draw the white circle
+ View bubbleContent = findViewById(R.id.bubble_content);
+ Rect bubbleRect = new Rect();
+ bubbleContent.getGlobalVisibleRect(bubbleRect);
+ mBubblePaint.setAlpha((int) (255 * alpha));
+ float buffer = DynamicGrid.pxFromDp(FIRST_RUN_CIRCLE_BUFFER_DPS, metrics);
+ canvas.drawCircle(metrics.widthPixels / 2,
+ bubbleRect.centerY(),
+ (bubbleContent.getMeasuredWidth() + buffer) / 2,
+ mBubblePaint);
+ } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
+ mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
+ mDrawIdentifier.equals(WORKSPACE_LARGE)) {
+ int offset = DynamicGrid.pxFromDp(WORKSPACE_CIRCLE_Y_OFFSET_DPS, metrics);
+ mErasePaint.setAlpha((int) (128));
+ eraseCanvas.drawCircle(metrics.widthPixels / 2,
+ metrics.heightPixels / 2 - offset,
+ DynamicGrid.pxFromDp(WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics),
+ mErasePaint);
+ mErasePaint.setAlpha(0);
+ eraseCanvas.drawCircle(metrics.widthPixels / 2,
+ metrics.heightPixels / 2 - offset,
+ DynamicGrid.pxFromDp(WORKSPACE_INNER_CIRCLE_RADIUS_DPS, metrics),
+ mErasePaint);
+ canvas.drawBitmap(eraseBg, 0, 0, null);
+ eraseCanvas.setBitmap(null);
+ eraseBg = null;
}
- // Draw the hand graphic in All Apps
- if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
- mDrawIdentifier.equals(ALLAPPS_LARGE)) {
- 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;
+ canvas.restore();
}
// Draw the rest of the cling
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 6e10175..664a99c 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -328,10 +328,12 @@
return height / countY;
}
+ boolean isPhone() {
+ return !isTablet && !isLargeTablet;
+ }
boolean isTablet() {
return isTablet;
}
-
boolean isLargeTablet() {
return isLargeTablet;
}
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 808d85d..9ee3f64 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -143,7 +143,8 @@
Resources res = getResources();
mMaxCountX = (int) grid.numColumns;
- mMaxCountY = mMaxNumItems = Integer.MAX_VALUE;
+ mMaxCountY = (int) grid.numRows;
+ mMaxNumItems = mMaxCountX * mMaxCountY;
mInputMethodManager = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
@@ -452,6 +453,7 @@
Cling cling = mLauncher.showFirstRunFoldersCling();
if (cling != null) {
cling.bringToFront();
+ bringToFront();
}
setFocusOnFirstChild();
}
@@ -526,12 +528,14 @@
}
protected boolean createAndAddShortcut(ShortcutInfo item) {
- final TextView textView =
- (TextView) mInflater.inflate(R.layout.application, this, false);
+ final BubbleTextView textView =
+ (BubbleTextView) mInflater.inflate(R.layout.application, this, false);
textView.setCompoundDrawablesWithIntrinsicBounds(null,
new FastBitmapDrawable(item.getIcon(mIconCache)), null, null);
textView.setText(item.title);
textView.setTag(item);
+ textView.setTextColor(getResources().getColor(R.color.folder_items_text_color));
+ textView.setShadowsEnabled(false);
textView.setOnClickListener(this);
textView.setOnLongClickListener(this);
@@ -875,11 +879,13 @@
float scale = parent.getDescendantRectRelativeToSelf(mFolderIcon, mTempRect);
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
int centerX = (int) (mTempRect.left + mTempRect.width() * scale / 2);
int centerY = (int) (mTempRect.top + mTempRect.height() * scale / 2);
int centeredLeft = centerX - width / 2;
int centeredTop = centerY - height / 2;
-
int currentPage = mLauncher.getWorkspace().getCurrentPage();
// In case the workspace is scrolling, we need to use the final scroll to compute
// the folders bounds.
@@ -897,8 +903,11 @@
bounds.left + bounds.width() - width);
int top = Math.min(Math.max(bounds.top, centeredTop),
bounds.top + bounds.height() - height);
- // If the folder doesn't fit within the bounds, center it about the desired bounds
- if (width >= bounds.width()) {
+ if (grid.isPhone() && (grid.availableWidthPx - width) < grid.iconSizePx) {
+ // Center the folder if it is full (on phones only)
+ left = (grid.availableWidthPx - width) / 2;
+ } else if (width >= bounds.width()) {
+ // If the folder doesn't fit within the bounds, center it about the desired bounds
left = bounds.left + (bounds.width() - width) / 2;
}
if (height >= bounds.height()) {
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index c00c9f8..433e903 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -73,6 +73,9 @@
// The amount of vertical spread between items in the stack [0...1]
private static final float PERSPECTIVE_SHIFT_FACTOR = 0.24f;
+ // Flag as to whether or not to draw an outer ring. Currently none is designed.
+ public static final boolean HAS_OUTER_RING = false;
+
// The degree to which the item in the back of the stack is scaled [0...1]
// (0 means it's not scaled at all, 1 means it's scaled to nothing)
private static final float PERSPECTIVE_SCALE_FACTOR = 0.35f;
@@ -201,7 +204,7 @@
sPreviewSize = grid.folderIconSizePx;
sPreviewPadding = res.getDimensionPixelSize(R.dimen.folder_preview_padding);
sSharedOuterRingDrawable = res.getDrawable(R.drawable.portal_ring_outer_holo);
- sSharedInnerRingDrawable = res.getDrawable(R.drawable.portal_ring_inner_holo);
+ sSharedInnerRingDrawable = res.getDrawable(R.drawable.portal_ring_inner_nolip_holo);
sSharedFolderLeaveBehind = res.getDrawable(R.drawable.portal_ring_rest);
sStaticValuesDirty = false;
}
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 89d4cb3..3bbb39e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -202,8 +202,8 @@
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 = 550;
- private static final int DISMISS_CLING_DURATION = 250;
+ private static final int SHOW_CLING_DURATION = 250;
+ private static final int DISMISS_CLING_DURATION = 200;
private static final Object sLock = new Object();
private static int sScreen = DEFAULT_SCREEN;
@@ -422,7 +422,6 @@
setContentView(R.layout.launcher);
setupViews();
grid.layout(this);
- showFirstRunWorkspaceCling();
registerContentObservers();
@@ -464,6 +463,8 @@
// On large interfaces, we want the screen to auto-rotate based on the current orientation
unlockScreenOrientation(true);
+
+ showFirstRunCling();
}
protected void onUserLeaveHint() {
@@ -4080,47 +4081,30 @@
return true;
}
- private Cling initCling(int clingId, int[] positionData, boolean animate, int delay) {
+ private Cling initCling(int clingId, int[] positionData, boolean animate,
+ boolean dimNavBarVisibilty) {
final Cling cling = (Cling) findViewById(clingId);
if (cling != null) {
cling.init(this, positionData);
- cling.setVisibility(View.VISIBLE);
- cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
- if (animate) {
- cling.buildLayer();
- cling.setAlpha(0f);
- cling.animate()
- .alpha(1f)
- .setInterpolator(new AccelerateInterpolator())
- .setDuration(SHOW_CLING_DURATION)
- .setStartDelay(delay)
- .start();
- } else {
- cling.setAlpha(1f);
+ cling.show(animate, SHOW_CLING_DURATION);
+
+ if (dimNavBarVisibilty) {
+ cling.setSystemUiVisibility(cling.getSystemUiVisibility() |
+ View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
- cling.setFocusableInTouchMode(true);
- cling.post(new Runnable() {
- public void run() {
- cling.setFocusable(true);
- cling.requestFocus();
- }
- });
- mHideFromAccessibilityHelper.setImportantForAccessibilityToNo(
- mDragLayer, clingId == R.id.all_apps_cling);
}
return cling;
}
- private void dismissCling(final Cling cling, final String flag, int duration) {
+ private void dismissCling(final Cling cling, final Runnable postAnimationCb,
+ final String flag, int duration, boolean restoreNavBarVisibilty) {
// To catch cases where siblings of top-level views are made invisible, just check whether
// the cling is directly set to GONE before dismissing it.
if (cling != null && cling.getVisibility() != View.GONE) {
- ObjectAnimator anim = LauncherAnimUtils.ofFloat(cling, "alpha", 0f);
- anim.setDuration(duration);
- anim.addListener(new AnimatorListenerAdapter() {
- public void onAnimationEnd(Animator animation) {
- cling.setVisibility(View.GONE);
+ final Runnable cleanUpClingCb = new Runnable() {
+ public void run() {
cling.cleanup();
+ /*
// We should update the shared preferences on a background thread
new Thread("dismissClingThread") {
public void run() {
@@ -4129,10 +4113,23 @@
editor.commit();
}
}.start();
- };
- });
- anim.start();
+ */
+ if (postAnimationCb != null) {
+ postAnimationCb.run();
+ }
+ }
+ };
+ if (duration <= 0) {
+ cleanUpClingCb.run();
+ } else {
+ cling.hide(duration, cleanUpClingCb);
+ }
mHideFromAccessibilityHelper.restoreImportantForAccessibility(mDragLayer);
+
+ if (restoreNavBarVisibilty) {
+ cling.setSystemUiVisibility(cling.getSystemUiVisibility() &
+ ~View.SYSTEM_UI_FLAG_LOW_PROFILE);
+ }
}
}
@@ -4162,10 +4159,9 @@
return false;
}
- public void showFirstRunWorkspaceCling() {
- // Enable the clings only if they have not been dismissed before
+ public void showFirstRunCling() {
if (isClingsEnabled() &&
- !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
+ !mSharedPrefs.getBoolean(Cling.FIRST_RUN_CLING_DISMISSED_KEY, false) &&
!skipCustomClingIfNoAccounts() ) {
// If we're not using the default workspace layout, replace workspace cling
// with a custom workspace cling (usually specified in an overlay)
@@ -4181,25 +4177,27 @@
clingParent.addView(customCling, clingIndex);
customCling.setId(R.id.workspace_cling);
}
- initCling(R.id.workspace_cling, null, false, 0);
+ initCling(R.id.first_run_cling, null, false, true);
} else {
- removeCling(R.id.workspace_cling);
+ removeCling(R.id.first_run_cling);
}
}
- public void showFirstRunAllAppsCling(int[] position) {
+
+ public void showFirstRunWorkspaceCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
- !mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {
- initCling(R.id.all_apps_cling, position, true, 0);
+ !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false)) {
+ initCling(R.id.workspace_cling, null, false, true);
} else {
- removeCling(R.id.all_apps_cling);
+ removeCling(R.id.workspace_cling);
}
}
public Cling showFirstRunFoldersCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {
- return initCling(R.id.folder_cling, null, true, 0);
+ Cling cling = initCling(R.id.folder_cling, null, true, true);
+ return cling;
} else {
removeCling(R.id.folder_cling);
return null;
@@ -4215,17 +4213,34 @@
}
return false;
}
+ public void dismissFirstRunCling(View v) {
+ Cling cling = (Cling) findViewById(R.id.first_run_cling);
+ Runnable cb = new Runnable() {
+ public void run() {
+ // Show the workspace cling next
+ showFirstRunWorkspaceCling();
+ }
+ };
+ dismissCling(cling, cb, Cling.FIRST_RUN_CLING_DISMISSED_KEY,
+ DISMISS_CLING_DURATION, false);
+ }
public void dismissWorkspaceCling(View v) {
Cling cling = (Cling) findViewById(R.id.workspace_cling);
- dismissCling(cling, Cling.WORKSPACE_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
- }
- public void dismissAllAppsCling(View v) {
- Cling cling = (Cling) findViewById(R.id.all_apps_cling);
- dismissCling(cling, Cling.ALLAPPS_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ Runnable cb = null;
+ if (v == null) {
+ cb = new Runnable() {
+ public void run() {
+ mWorkspace.enterOverviewMode();
+ }
+ };
+ }
+ dismissCling(cling, cb, Cling.WORKSPACE_CLING_DISMISSED_KEY,
+ DISMISS_CLING_DURATION, true);
}
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, null, Cling.FOLDER_CLING_DISMISSED_KEY,
+ DISMISS_CLING_DURATION, true);
}
/**
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 9dfe18b..8cf2c41 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -991,7 +991,6 @@
clearChildrenCache();
}
-
if (mDragController.isDragging()) {
if (isSmall()) {
// If we are in springloaded mode, then force an event to check if the current touch