am f95761eb: am f8177d38: Merge "Saving the system wallpaper thumbnail prefixed by the SDK_INT so that it is recreated after a system update." into ub-now-porkchop
* commit 'f95761eb247bd0bd55d8c24169a35783aa67558f':
diff --git a/Android.mk b/Android.mk
index 6e8365f..110117b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -36,8 +36,7 @@
LOCAL_PROTOC_OPTIMIZE_TYPE := nano
LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/
-# STOPSHIP(kennyguy): change to 21 once the L SDK is baked.
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := 21
LOCAL_PACKAGE_NAME := Launcher3
#LOCAL_CERTIFICATE := shared
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 3633c8c..591d9b6 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -20,7 +20,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher3">
- <uses-sdk android:targetSdkVersion="19" android:minSdkVersion="16"/>
+ <uses-sdk android:targetSdkVersion="21" android:minSdkVersion="16"/>
<permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
@@ -167,18 +167,18 @@
<!-- Intent received used to install shortcuts from other applications -->
<receiver
android:name="com.android.launcher3.InstallShortcutReceiver"
- android:permission="com.android.launcher3.permission.INSTALL_SHORTCUT">
+ android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
- <action android:name="com.android.launcher3.action.INSTALL_SHORTCUT" />
+ <action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
android:name="com.android.launcher3.UninstallShortcutReceiver"
- android:permission="com.android.launcher3.permission.UNINSTALL_SHORTCUT">
+ android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
- <action android:name="com.android.launcher3.action.UNINSTALL_SHORTCUT" />
+ <action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
</intent-filter>
</receiver>
diff --git a/WallpaperPicker/res/drawable-xxhdpi/ic_actionbar_accept.png b/WallpaperPicker/res/drawable-xxhdpi/ic_actionbar_accept.png
new file mode 100755
index 0000000..d9ad51c
--- /dev/null
+++ b/WallpaperPicker/res/drawable-xxhdpi/ic_actionbar_accept.png
Binary files differ
diff --git a/WallpaperPicker/src/com/android/launcher3/Partner.java b/WallpaperPicker/src/com/android/launcher3/Partner.java
deleted file mode 100644
index 1753997..0000000
--- a/WallpaperPicker/src/com/android/launcher3/Partner.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3;
-
-import android.content.pm.PackageManager;
-import android.content.res.Resources;
-import android.util.Pair;
-
-import java.io.File;
-
-/**
- * Utilities to discover and interact with partner customizations. There can
- * only be one set of customizations on a device, and it must be bundled with
- * the system.
- */
-public class Partner {
- /** Marker action used to discover partner */
- private static final String
- ACTION_PARTNER_CUSTOMIZATION = "com.android.launcher3.action.PARTNER_CUSTOMIZATION";
-
- public static final String RESOURCE_FOLDER = "partner_folder";
- public static final String RESOURCE_WALLPAPERS = "partner_wallpapers";
- public static final String RESOURCE_DEFAULT_LAYOUT = "partner_default_layout";
-
- public static final String RESOURCE_DEFAULT_WALLPAPER_HIDDEN = "default_wallpapper_hidden";
- public static final String RESOURCE_SYSTEM_WALLPAPER_DIR = "system_wallpaper_directory";
-
- public static final String RESOURCE_REQUIRE_FIRST_RUN_FLOW = "requires_first_run_flow";
-
- private static boolean sSearched = false;
- private static Partner sPartner;
-
- /**
- * Find and return partner details, or {@code null} if none exists.
- */
- public static synchronized Partner get(PackageManager pm) {
- if (!sSearched) {
- Pair<String, Resources> apkInfo = Utilities.findSystemApk(ACTION_PARTNER_CUSTOMIZATION, pm);
- if (apkInfo != null) {
- sPartner = new Partner(apkInfo.first, apkInfo.second);
- }
- sSearched = true;
- }
- return sPartner;
- }
-
- private final String mPackageName;
- private final Resources mResources;
-
- private Partner(String packageName, Resources res) {
- mPackageName = packageName;
- mResources = res;
- }
-
- public String getPackageName() {
- return mPackageName;
- }
-
- public Resources getResources() {
- return mResources;
- }
-
- public boolean hasDefaultLayout() {
- int defaultLayout = getResources().getIdentifier(Partner.RESOURCE_DEFAULT_LAYOUT,
- "xml", getPackageName());
- return defaultLayout != 0;
- }
-
- public boolean hasFolder() {
- int folder = getResources().getIdentifier(Partner.RESOURCE_FOLDER,
- "xml", getPackageName());
- return folder != 0;
- }
-
- public boolean hideDefaultWallpaper() {
- int resId = getResources().getIdentifier(RESOURCE_DEFAULT_WALLPAPER_HIDDEN, "bool",
- getPackageName());
- return resId != 0 && getResources().getBoolean(resId);
- }
-
- public File getWallpaperDirectory() {
- int resId = getResources().getIdentifier(RESOURCE_SYSTEM_WALLPAPER_DIR, "string",
- getPackageName());
- return (resId != 0) ? new File(getResources().getString(resId)) : null;
- }
-
- public boolean requiresFirstRunFlow() {
- int resId = getResources().getIdentifier(RESOURCE_REQUIRE_FIRST_RUN_FLOW, "bool",
- getPackageName());
- return resId != 0 && getResources().getBoolean(resId);
- }
-}
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index cb13291..0728537 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -925,7 +925,7 @@
Partner partner = Partner.get(pm);
if (partner != null) {
final Resources partnerRes = partner.getResources();
- final int resId = partnerRes.getIdentifier(Partner.RESOURCE_WALLPAPERS, "array",
+ final int resId = partnerRes.getIdentifier(Partner.RES_WALLPAPERS, "array",
partner.getPackageName());
if (resId != 0) {
addWallpapers(bundled, partnerRes, partner.getPackageName(), resId);
diff --git a/res/drawable-hdpi/bg_cling1.png b/res/drawable-hdpi/bg_cling1.png
deleted file mode 100644
index 0e15532..0000000
--- a/res/drawable-hdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/bg_cling2.png b/res/drawable-hdpi/bg_cling2.png
deleted file mode 100644
index e65d9a2..0000000
--- a/res/drawable-hdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/bg_cling3.png b/res/drawable-hdpi/bg_cling3.png
deleted file mode 100644
index ea71fbd..0000000
--- a/res/drawable-hdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/bg_cling4.png b/res/drawable-hdpi/bg_cling4.png
deleted file mode 100644
index 9403667..0000000
--- a/res/drawable-hdpi/bg_cling4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling.9.png b/res/drawable-hdpi/cling.9.png
deleted file mode 100644
index 36fbfc8..0000000
--- a/res/drawable-hdpi/cling.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_down.png b/res/drawable-hdpi/cling_arrow_down.png
deleted file mode 100644
index 4f521ea..0000000
--- a/res/drawable-hdpi/cling_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_left.png b/res/drawable-hdpi/cling_arrow_left.png
deleted file mode 100644
index 13764c9..0000000
--- a/res/drawable-hdpi/cling_arrow_left.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_right.png b/res/drawable-hdpi/cling_arrow_right.png
deleted file mode 100644
index be52244..0000000
--- a/res/drawable-hdpi/cling_arrow_right.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_arrow_up.png b/res/drawable-hdpi/cling_arrow_up.png
deleted file mode 100644
index 83b5b37..0000000
--- a/res/drawable-hdpi/cling_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_bg.9.png b/res/drawable-hdpi/cling_bg.9.png
new file mode 100644
index 0000000..e173ba5
--- /dev/null
+++ b/res/drawable-hdpi/cling_bg.9.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_button.9.png b/res/drawable-hdpi/cling_button.9.png
deleted file mode 100644
index e308382..0000000
--- a/res/drawable-hdpi/cling_button.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/cling_button_pressed.9.png b/res/drawable-hdpi/cling_button_pressed.9.png
deleted file mode 100644
index 4f9ca6f..0000000
--- a/res/drawable-hdpi/cling_button_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/custom_content_page.png b/res/drawable-hdpi/custom_content_page.png
deleted file mode 100644
index 9eef50c..0000000
--- a/res/drawable-hdpi/custom_content_page.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_allapps.png b/res/drawable-hdpi/ic_allapps.png
index 072cf5b..b98e65f 100644
--- a/res/drawable-hdpi/ic_allapps.png
+++ b/res/drawable-hdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_allapps_pressed.png b/res/drawable-hdpi/ic_allapps_pressed.png
index af49dbb..b7eaa67 100644
--- a/res/drawable-hdpi/ic_allapps_pressed.png
+++ b/res/drawable-hdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_pageindicator_add.png b/res/drawable-hdpi/ic_pageindicator_add.png
index 4bb8bfa..ab0e5db 100644
--- a/res/drawable-hdpi/ic_pageindicator_add.png
+++ b/res/drawable-hdpi/ic_pageindicator_add.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_pageindicator_current.png b/res/drawable-hdpi/ic_pageindicator_current.png
index bd15fb4..2e841f5 100644
--- a/res/drawable-hdpi/ic_pageindicator_current.png
+++ b/res/drawable-hdpi/ic_pageindicator_current.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_pageindicator_default.png b/res/drawable-hdpi/ic_pageindicator_default.png
index 2386cd8..07ab948 100644
--- a/res/drawable-hdpi/ic_pageindicator_default.png
+++ b/res/drawable-hdpi/ic_pageindicator_default.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left.9.png b/res/drawable-hdpi/page_hover_left.9.png
new file mode 100644
index 0000000..cc029d8
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left_active.9.png b/res/drawable-hdpi/page_hover_left_active.9.png
new file mode 100644
index 0000000..20c91a0
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left_holo.9.png b/res/drawable-hdpi/page_hover_left_holo.9.png
deleted file mode 100644
index 8a1aa5f..0000000
--- a/res/drawable-hdpi/page_hover_left_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right.9.png b/res/drawable-hdpi/page_hover_right.9.png
new file mode 100644
index 0000000..a42822a
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right_active.9.png b/res/drawable-hdpi/page_hover_right_active.9.png
new file mode 100644
index 0000000..523fafd
--- /dev/null
+++ b/res/drawable-hdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right_holo.9.png b/res/drawable-hdpi/page_hover_right_holo.9.png
deleted file mode 100644
index abf8f51..0000000
--- a/res/drawable-hdpi/page_hover_right_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/quantum_panel.9.png b/res/drawable-hdpi/quantum_panel.9.png
index a005e0b..b4ac9c0 100644
--- a/res/drawable-hdpi/quantum_panel.9.png
+++ b/res/drawable-hdpi/quantum_panel.9.png
Binary files differ
diff --git a/res/drawable-hdpi/screenpanel.9.png b/res/drawable-hdpi/screenpanel.9.png
index eed0f2c..f7ae011 100644
--- a/res/drawable-hdpi/screenpanel.9.png
+++ b/res/drawable-hdpi/screenpanel.9.png
Binary files differ
diff --git a/res/drawable-hdpi/screenpanel_hover.9.png b/res/drawable-hdpi/screenpanel_hover.9.png
index 2cea8a4..ac8e83d 100644
--- a/res/drawable-hdpi/screenpanel_hover.9.png
+++ b/res/drawable-hdpi/screenpanel_hover.9.png
Binary files differ
diff --git a/res/drawable-land-hdpi/bg_cling1.png b/res/drawable-land-hdpi/bg_cling1.png
deleted file mode 100644
index 7123c5c..0000000
--- a/res/drawable-land-hdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-hdpi/bg_cling2.png b/res/drawable-land-hdpi/bg_cling2.png
deleted file mode 100644
index 889b627..0000000
--- a/res/drawable-land-hdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-hdpi/bg_cling3.png b/res/drawable-land-hdpi/bg_cling3.png
deleted file mode 100644
index 4ff338c..0000000
--- a/res/drawable-land-hdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-mdpi/bg_cling1.png b/res/drawable-land-mdpi/bg_cling1.png
deleted file mode 100644
index f5faeb4..0000000
--- a/res/drawable-land-mdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-mdpi/bg_cling2.png b/res/drawable-land-mdpi/bg_cling2.png
deleted file mode 100644
index 963967d..0000000
--- a/res/drawable-land-mdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-mdpi/bg_cling3.png b/res/drawable-land-mdpi/bg_cling3.png
deleted file mode 100644
index 921831a..0000000
--- a/res/drawable-land-mdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xhdpi/bg_cling1.png b/res/drawable-land-xhdpi/bg_cling1.png
deleted file mode 100644
index 2282117..0000000
--- a/res/drawable-land-xhdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xhdpi/bg_cling2.png b/res/drawable-land-xhdpi/bg_cling2.png
deleted file mode 100644
index 5243889..0000000
--- a/res/drawable-land-xhdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xhdpi/bg_cling3.png b/res/drawable-land-xhdpi/bg_cling3.png
deleted file mode 100644
index 08475f7..0000000
--- a/res/drawable-land-xhdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling1.png b/res/drawable-land-xxhdpi/bg_cling1.png
deleted file mode 100644
index 78943f0..0000000
--- a/res/drawable-land-xxhdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling2.png b/res/drawable-land-xxhdpi/bg_cling2.png
deleted file mode 100644
index 98b6568..0000000
--- a/res/drawable-land-xxhdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling3.png b/res/drawable-land-xxhdpi/bg_cling3.png
deleted file mode 100644
index e249fe5..0000000
--- a/res/drawable-land-xxhdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling1.png b/res/drawable-mdpi/bg_cling1.png
deleted file mode 100644
index f284412..0000000
--- a/res/drawable-mdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling2.png b/res/drawable-mdpi/bg_cling2.png
deleted file mode 100644
index 0052dc2..0000000
--- a/res/drawable-mdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling3.png b/res/drawable-mdpi/bg_cling3.png
deleted file mode 100644
index fabdf7a..0000000
--- a/res/drawable-mdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling4.png b/res/drawable-mdpi/bg_cling4.png
deleted file mode 100644
index 2f152f4d..0000000
--- a/res/drawable-mdpi/bg_cling4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/bg_cling5.png b/res/drawable-mdpi/bg_cling5.png
deleted file mode 100644
index e094809..0000000
--- a/res/drawable-mdpi/bg_cling5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling.9.png b/res/drawable-mdpi/cling.9.png
deleted file mode 100644
index 4c0f139..0000000
--- a/res/drawable-mdpi/cling.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_down.png b/res/drawable-mdpi/cling_arrow_down.png
deleted file mode 100644
index 58e66fb..0000000
--- a/res/drawable-mdpi/cling_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_left.png b/res/drawable-mdpi/cling_arrow_left.png
deleted file mode 100644
index 023c717..0000000
--- a/res/drawable-mdpi/cling_arrow_left.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_right.png b/res/drawable-mdpi/cling_arrow_right.png
deleted file mode 100644
index cf0eb10..0000000
--- a/res/drawable-mdpi/cling_arrow_right.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_arrow_up.png b/res/drawable-mdpi/cling_arrow_up.png
deleted file mode 100644
index 9b0e6b7..0000000
--- a/res/drawable-mdpi/cling_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_bg.9.png b/res/drawable-mdpi/cling_bg.9.png
new file mode 100644
index 0000000..fc49c89
--- /dev/null
+++ b/res/drawable-mdpi/cling_bg.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_button.9.png b/res/drawable-mdpi/cling_button.9.png
deleted file mode 100644
index a0b6f97..0000000
--- a/res/drawable-mdpi/cling_button.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/cling_button_pressed.9.png b/res/drawable-mdpi/cling_button_pressed.9.png
deleted file mode 100644
index 986e669..0000000
--- a/res/drawable-mdpi/cling_button_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/custom_content_page.png b/res/drawable-mdpi/custom_content_page.png
deleted file mode 100644
index cc4005d..0000000
--- a/res/drawable-mdpi/custom_content_page.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_allapps.png b/res/drawable-mdpi/ic_allapps.png
index f3887be..f410673 100644
--- a/res/drawable-mdpi/ic_allapps.png
+++ b/res/drawable-mdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_allapps_pressed.png b/res/drawable-mdpi/ic_allapps_pressed.png
index d7ea96f..aa4f913 100644
--- a/res/drawable-mdpi/ic_allapps_pressed.png
+++ b/res/drawable-mdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_pageindicator_add.png b/res/drawable-mdpi/ic_pageindicator_add.png
index e20ffa7..11659a3 100644
--- a/res/drawable-mdpi/ic_pageindicator_add.png
+++ b/res/drawable-mdpi/ic_pageindicator_add.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_pageindicator_current.png b/res/drawable-mdpi/ic_pageindicator_current.png
index bb49d31..08f43b4 100644
--- a/res/drawable-mdpi/ic_pageindicator_current.png
+++ b/res/drawable-mdpi/ic_pageindicator_current.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_pageindicator_default.png b/res/drawable-mdpi/ic_pageindicator_default.png
index 50d0989..635be4a 100644
--- a/res/drawable-mdpi/ic_pageindicator_default.png
+++ b/res/drawable-mdpi/ic_pageindicator_default.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left.9.png b/res/drawable-mdpi/page_hover_left.9.png
new file mode 100644
index 0000000..2bbf428
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left_active.9.png b/res/drawable-mdpi/page_hover_left_active.9.png
new file mode 100644
index 0000000..bf70f36
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left_holo.9.png b/res/drawable-mdpi/page_hover_left_holo.9.png
deleted file mode 100644
index 561d3cd..0000000
--- a/res/drawable-mdpi/page_hover_left_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right.9.png b/res/drawable-mdpi/page_hover_right.9.png
new file mode 100644
index 0000000..4bafd0f
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right_active.9.png b/res/drawable-mdpi/page_hover_right_active.9.png
new file mode 100644
index 0000000..4aaa014
--- /dev/null
+++ b/res/drawable-mdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right_holo.9.png b/res/drawable-mdpi/page_hover_right_holo.9.png
deleted file mode 100644
index 2681f23..0000000
--- a/res/drawable-mdpi/page_hover_right_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/quantum_panel.9.png b/res/drawable-mdpi/quantum_panel.9.png
index 785f573..c5a6eb7 100644
--- a/res/drawable-mdpi/quantum_panel.9.png
+++ b/res/drawable-mdpi/quantum_panel.9.png
Binary files differ
diff --git a/res/drawable-mdpi/screenpanel.9.png b/res/drawable-mdpi/screenpanel.9.png
index 6f8b7e6..c2779fc 100644
--- a/res/drawable-mdpi/screenpanel.9.png
+++ b/res/drawable-mdpi/screenpanel.9.png
Binary files differ
diff --git a/res/drawable-mdpi/screenpanel_hover.9.png b/res/drawable-mdpi/screenpanel_hover.9.png
index 8a94984..70b3078 100644
--- a/res/drawable-mdpi/screenpanel_hover.9.png
+++ b/res/drawable-mdpi/screenpanel_hover.9.png
Binary files differ
diff --git a/res/drawable-nodpi/ic_migration.png b/res/drawable-nodpi/ic_migration.png
new file mode 100644
index 0000000..c282cd2
--- /dev/null
+++ b/res/drawable-nodpi/ic_migration.png
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling1.png b/res/drawable-xhdpi/bg_cling1.png
deleted file mode 100644
index b71351a..0000000
--- a/res/drawable-xhdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling2.png b/res/drawable-xhdpi/bg_cling2.png
deleted file mode 100644
index ad78dfe..0000000
--- a/res/drawable-xhdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling3.png b/res/drawable-xhdpi/bg_cling3.png
deleted file mode 100644
index ae04195..0000000
--- a/res/drawable-xhdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/bg_cling4.png b/res/drawable-xhdpi/bg_cling4.png
deleted file mode 100644
index f4bb83e..0000000
--- a/res/drawable-xhdpi/bg_cling4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling.9.png b/res/drawable-xhdpi/cling.9.png
deleted file mode 100644
index 1cb4681..0000000
--- a/res/drawable-xhdpi/cling.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_down.png b/res/drawable-xhdpi/cling_arrow_down.png
deleted file mode 100644
index ee10933..0000000
--- a/res/drawable-xhdpi/cling_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_left.png b/res/drawable-xhdpi/cling_arrow_left.png
deleted file mode 100644
index cffbcf3..0000000
--- a/res/drawable-xhdpi/cling_arrow_left.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_right.png b/res/drawable-xhdpi/cling_arrow_right.png
deleted file mode 100644
index d880d67..0000000
--- a/res/drawable-xhdpi/cling_arrow_right.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_arrow_up.png b/res/drawable-xhdpi/cling_arrow_up.png
deleted file mode 100644
index fd2c60c..0000000
--- a/res/drawable-xhdpi/cling_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_bg.9.png b/res/drawable-xhdpi/cling_bg.9.png
new file mode 100644
index 0000000..4db356f
--- /dev/null
+++ b/res/drawable-xhdpi/cling_bg.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button.9.png b/res/drawable-xhdpi/cling_button.9.png
deleted file mode 100644
index 4192563..0000000
--- a/res/drawable-xhdpi/cling_button.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button_pressed.9.png b/res/drawable-xhdpi/cling_button_pressed.9.png
deleted file mode 100644
index d3ce469..0000000
--- a/res/drawable-xhdpi/cling_button_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/custom_content_page.png b/res/drawable-xhdpi/custom_content_page.png
deleted file mode 100644
index e1da91c..0000000
--- a/res/drawable-xhdpi/custom_content_page.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_allapps.png b/res/drawable-xhdpi/ic_allapps.png
index 6a528d5..ff3d823 100644
--- a/res/drawable-xhdpi/ic_allapps.png
+++ b/res/drawable-xhdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_allapps_pressed.png b/res/drawable-xhdpi/ic_allapps_pressed.png
index 15a8aa9..5f188f6 100644
--- a/res/drawable-xhdpi/ic_allapps_pressed.png
+++ b/res/drawable-xhdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_pageindicator_add.png b/res/drawable-xhdpi/ic_pageindicator_add.png
index 9659e6f..af1da2d 100644
--- a/res/drawable-xhdpi/ic_pageindicator_add.png
+++ b/res/drawable-xhdpi/ic_pageindicator_add.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_pageindicator_current.png b/res/drawable-xhdpi/ic_pageindicator_current.png
index 07b3137..0e9a52f 100644
--- a/res/drawable-xhdpi/ic_pageindicator_current.png
+++ b/res/drawable-xhdpi/ic_pageindicator_current.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_pageindicator_default.png b/res/drawable-xhdpi/ic_pageindicator_default.png
index 0351d57..d0f14cd 100644
--- a/res/drawable-xhdpi/ic_pageindicator_default.png
+++ b/res/drawable-xhdpi/ic_pageindicator_default.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left.9.png b/res/drawable-xhdpi/page_hover_left.9.png
new file mode 100644
index 0000000..a2b9b65
--- /dev/null
+++ b/res/drawable-xhdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left_active.9.png b/res/drawable-xhdpi/page_hover_left_active.9.png
new file mode 100644
index 0000000..ba9478e
--- /dev/null
+++ b/res/drawable-xhdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left_holo.9.png b/res/drawable-xhdpi/page_hover_left_holo.9.png
deleted file mode 100644
index 4972a2e..0000000
--- a/res/drawable-xhdpi/page_hover_left_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_right.9.png b/res/drawable-xhdpi/page_hover_right.9.png
new file mode 100644
index 0000000..1243ea9
--- /dev/null
+++ b/res/drawable-xhdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_right_active.9.png b/res/drawable-xhdpi/page_hover_right_active.9.png
new file mode 100644
index 0000000..582261c
--- /dev/null
+++ b/res/drawable-xhdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_right_holo.9.png b/res/drawable-xhdpi/page_hover_right_holo.9.png
deleted file mode 100644
index b99461f..0000000
--- a/res/drawable-xhdpi/page_hover_right_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/quantum_panel.9.png b/res/drawable-xhdpi/quantum_panel.9.png
index 5726fd2..1797ad5 100644
--- a/res/drawable-xhdpi/quantum_panel.9.png
+++ b/res/drawable-xhdpi/quantum_panel.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/screenpanel.9.png b/res/drawable-xhdpi/screenpanel.9.png
index 2d70d7a..53a7812 100644
--- a/res/drawable-xhdpi/screenpanel.9.png
+++ b/res/drawable-xhdpi/screenpanel.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/screenpanel_hover.9.png b/res/drawable-xhdpi/screenpanel_hover.9.png
index 0032fff..a2e200f 100644
--- a/res/drawable-xhdpi/screenpanel_hover.9.png
+++ b/res/drawable-xhdpi/screenpanel_hover.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling1.png b/res/drawable-xxhdpi/bg_cling1.png
deleted file mode 100644
index 0777856..0000000
--- a/res/drawable-xxhdpi/bg_cling1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling2.png b/res/drawable-xxhdpi/bg_cling2.png
deleted file mode 100644
index 1797a1b..0000000
--- a/res/drawable-xxhdpi/bg_cling2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling3.png b/res/drawable-xxhdpi/bg_cling3.png
deleted file mode 100644
index a87be63..0000000
--- a/res/drawable-xxhdpi/bg_cling3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling4.png b/res/drawable-xxhdpi/bg_cling4.png
deleted file mode 100644
index cabe919..0000000
--- a/res/drawable-xxhdpi/bg_cling4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling_home.png b/res/drawable-xxhdpi/bg_cling_home.png
deleted file mode 100644
index 1ae93e7..0000000
--- a/res/drawable-xxhdpi/bg_cling_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling_nakasi3.png b/res/drawable-xxhdpi/bg_cling_nakasi3.png
deleted file mode 100644
index f47236c..0000000
--- a/res/drawable-xxhdpi/bg_cling_nakasi3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling.9.png b/res/drawable-xxhdpi/cling.9.png
deleted file mode 100644
index 7beae03..0000000
--- a/res/drawable-xxhdpi/cling.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_down.png b/res/drawable-xxhdpi/cling_arrow_down.png
deleted file mode 100644
index 48c4f06..0000000
--- a/res/drawable-xxhdpi/cling_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_left.png b/res/drawable-xxhdpi/cling_arrow_left.png
deleted file mode 100644
index 8760d05..0000000
--- a/res/drawable-xxhdpi/cling_arrow_left.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_right.png b/res/drawable-xxhdpi/cling_arrow_right.png
deleted file mode 100644
index 356ba17..0000000
--- a/res/drawable-xxhdpi/cling_arrow_right.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_arrow_up.png b/res/drawable-xxhdpi/cling_arrow_up.png
deleted file mode 100644
index 4cb805f..0000000
--- a/res/drawable-xxhdpi/cling_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_bg.9.png b/res/drawable-xxhdpi/cling_bg.9.png
new file mode 100644
index 0000000..dc9f69a
--- /dev/null
+++ b/res/drawable-xxhdpi/cling_bg.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button.9.png b/res/drawable-xxhdpi/cling_button.9.png
deleted file mode 100644
index e412876..0000000
--- a/res/drawable-xxhdpi/cling_button.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button_pressed.9.png b/res/drawable-xxhdpi/cling_button_pressed.9.png
deleted file mode 100644
index 55e89da..0000000
--- a/res/drawable-xxhdpi/cling_button_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_allapps.png b/res/drawable-xxhdpi/ic_allapps.png
index ae5545d..5dbfe4c 100644
--- a/res/drawable-xxhdpi/ic_allapps.png
+++ b/res/drawable-xxhdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_allapps_pressed.png b/res/drawable-xxhdpi/ic_allapps_pressed.png
index 77b45ae..e761723 100644
--- a/res/drawable-xxhdpi/ic_allapps_pressed.png
+++ b/res/drawable-xxhdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_pageindicator_add.png b/res/drawable-xxhdpi/ic_pageindicator_add.png
index 591b189..c288952 100644
--- a/res/drawable-xxhdpi/ic_pageindicator_add.png
+++ b/res/drawable-xxhdpi/ic_pageindicator_add.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_pageindicator_current.png b/res/drawable-xxhdpi/ic_pageindicator_current.png
index 4e4660f..b74e92e 100644
--- a/res/drawable-xxhdpi/ic_pageindicator_current.png
+++ b/res/drawable-xxhdpi/ic_pageindicator_current.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_pageindicator_default.png b/res/drawable-xxhdpi/ic_pageindicator_default.png
index 1cccb17..e362ece 100644
--- a/res/drawable-xxhdpi/ic_pageindicator_default.png
+++ b/res/drawable-xxhdpi/ic_pageindicator_default.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left.9.png b/res/drawable-xxhdpi/page_hover_left.9.png
new file mode 100644
index 0000000..63869dd
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left_active.9.png b/res/drawable-xxhdpi/page_hover_left_active.9.png
new file mode 100644
index 0000000..9a418ce
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left_holo.9.png b/res/drawable-xxhdpi/page_hover_left_holo.9.png
deleted file mode 100644
index 626aafb..0000000
--- a/res/drawable-xxhdpi/page_hover_left_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right.9.png b/res/drawable-xxhdpi/page_hover_right.9.png
new file mode 100644
index 0000000..c6fd398
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right_active.9.png b/res/drawable-xxhdpi/page_hover_right_active.9.png
new file mode 100644
index 0000000..7aef373
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right_holo.9.png b/res/drawable-xxhdpi/page_hover_right_holo.9.png
deleted file mode 100644
index 66257dc..0000000
--- a/res/drawable-xxhdpi/page_hover_right_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/quantum_panel.9.png b/res/drawable-xxhdpi/quantum_panel.9.png
index 035cdc4..d7ba874 100644
--- a/res/drawable-xxhdpi/quantum_panel.9.png
+++ b/res/drawable-xxhdpi/quantum_panel.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/screenpanel.9.png b/res/drawable-xxhdpi/screenpanel.9.png
index 7ed058e..2d13954 100644
--- a/res/drawable-xxhdpi/screenpanel.9.png
+++ b/res/drawable-xxhdpi/screenpanel.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/screenpanel_hover.9.png b/res/drawable-xxhdpi/screenpanel_hover.9.png
index 24d2266..369fc44 100644
--- a/res/drawable-xxhdpi/screenpanel_hover.9.png
+++ b/res/drawable-xxhdpi/screenpanel_hover.9.png
Binary files differ
diff --git a/res/drawable/bg_migration_cling.xml b/res/drawable/bg_migration_cling.xml
new file mode 100644
index 0000000..bfff5a4
--- /dev/null
+++ b/res/drawable/bg_migration_cling.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval" >
+
+ <gradient
+ android:endColor="#00ffeb3a"
+ android:gradientRadius="50%p"
+ android:startColor="#80ffeb3a"
+ android:type="radial" />
+
+</shape>
\ No newline at end of file
diff --git a/res/drawable/cling_arrow_end.xml b/res/drawable/cling_arrow_end.xml
deleted file mode 100644
index 3f63c7d..0000000
--- a/res/drawable/cling_arrow_end.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 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.
--->
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/cling_arrow_right"
- android:autoMirrored="true">
-</bitmap>
diff --git a/res/drawable/cling_arrow_start.xml b/res/drawable/cling_arrow_start.xml
deleted file mode 100644
index ebe9183..0000000
--- a/res/drawable/cling_arrow_start.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 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.
--->
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/cling_arrow_left"
- android:autoMirrored="true">
-</bitmap>
diff --git a/res/drawable/cling_button_bg.xml b/res/drawable/cling_button_bg.xml
deleted file mode 100644
index 7bf6ce7..0000000
--- a/res/drawable/cling_button_bg.xml
+++ /dev/null
@@ -1,20 +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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <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
deleted file mode 100644
index 9baee64..0000000
--- a/res/layout-land/first_run_cling.xml
+++ /dev/null
@@ -1,97 +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="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="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="100dp"
- android:layout_marginRight="100dp"
- android:orientation="vertical">
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="10dp"
- android:text="@string/first_run_cling_title"
- android:textColor="#FFFFFFFF"
- android:textSize="30sp"
- android:gravity="center" />
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/first_run_cling_description"
- android:textColor="#80000000"
- android:textSize="16sp"
- android:gravity="center" />
- </LinearLayout>
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/search_bar_hint"
- android:layout_width="160dp"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:layout_marginEnd="10dp"
- android:layout_marginTop="65dp"
- android:visibility="gone"
- android:drawableTop="@drawable/cling_arrow_up"
- android:drawablePadding="5dp"
- android:text="@string/first_run_cling_search_bar_hint" />
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/custom_content_hint"
- android:layout_width="160dp"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginStart="10dp"
- android:layout_marginTop="100dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_left"
- android:drawablePadding="10dp"
- 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="85dp"
- android:drawableEnd="@drawable/cling_arrow_right"
- android:drawablePadding="5dp"
- 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-land/folder_cling.xml b/res/layout-land/folder_cling.xml
deleted file mode 100644
index 5dd3729..0000000
--- a/res/layout-land/folder_cling.xml
+++ /dev/null
@@ -1,65 +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_landscape">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="15dp"
- android:layout_marginEnd="15dp"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="10dp">
- <LinearLayout
- android:id="@+id/folder_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- 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="match_parent"
- android:layout_height="wrap_content"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
- </FrameLayout>
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginEnd="20dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissFolderCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 0af9e59..8cd8673 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -57,40 +57,6 @@
android:id="@+id/overview_panel"
android:visibility="gone" />
- <!-- 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. -->
- <com.android.launcher3.ScrimView
- android:id="@+id/cling_scrim"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <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/migration_cling"
- android:id="@+id/migration_cling"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <include layout="@layout/migration_workspace_cling"
- android:id="@+id/migration_workspace_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"
- 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" />
-
<include layout="@layout/apps_customize_pane"
android:id="@+id/apps_customize_pane"
android:layout_width="match_parent"
diff --git a/res/layout-land/longpress_cling.xml b/res/layout-land/longpress_cling.xml
new file mode 100644
index 0000000..93bbc07
--- /dev/null
+++ b/res/layout-land/longpress_cling.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
+ android:id="@+id/longpress_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/cling_scrim_background"
+ android:orientation="vertical" >
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <FrameLayout
+ android:id="@+id/cling_content"
+ android:layout_width="360dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:background="@drawable/cling_bg" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-land/migration_cling.xml b/res/layout-land/migration_cling.xml
index 343f43f..307cba8 100644
--- a/res/layout-land/migration_cling.xml
+++ b/res/layout-land/migration_cling.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!--
+ 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.
@@ -13,88 +14,90 @@
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"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/migration_cling"
android:layout_width="match_parent"
android:layout_height="match_parent"
- launcher:drawIdentifier="migration_landscape">
+ android:background="#FF009688"
+ android:baselineAligned="false"
+ android:gravity="center_vertical" >
+
<FrameLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
+ android:layout_width="0dp"
android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_weight="1" >
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:gravity="center"
- android:text="@string/first_run_cling_title"
- android:textSize="42dp"
- android:textColor="#FFffffff" />
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="0dp"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/on_boarding_welcome" />
+ <ImageView
+ android:layout_width="@dimen/cling_migration_bg_size"
+ android:layout_height="@dimen/cling_migration_bg_size"
+ android:layout_gravity="center"
+ android:background="@drawable/bg_migration_cling" />
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_up" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:paddingLeft="25dp"
- android:paddingRight="25dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:orientation="vertical"
- android:background="@drawable/cling">
- <TextView
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_title" />
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_description" />
- </LinearLayout>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:layout_marginBottom="25dp"
- android:orientation="vertical">
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_copy_apps"
- android:onClick="dismissMigrationClingCopyApps" />
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_use_default"
- android:onClick="dismissMigrationClingUseDefault" />
- </LinearLayout>
+ <ImageView
+ android:layout_width="@dimen/cling_migration_logo_width"
+ android:layout_height="@dimen/cling_migration_logo_height"
+ android:layout_gravity="center"
+ android:src="@drawable/ic_migration" />
</FrameLayout>
-</com.android.launcher3.Cling>
+
+ <LinearLayout
+ android:layout_width="@dimen/cling_migration_content_width"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/cling_migration_content_margin"
+ android:orientation="vertical"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="8dp"
+ android:text="@string/first_run_cling_title"
+ android:textColor="#E1000000"
+ android:textSize="34sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_title"
+ android:textColor="#E1000000"
+ android:textSize="20sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="24dp"
+ android:text="@string/migration_cling_description"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <Button
+ android:id="@+id/cling_dismiss_migration_copy_apps"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_copy_apps"
+ android:textColor="#FFFFFFFF"
+ android:textSize="14sp" />
+
+ <Button
+ android:id="@+id/cling_dismiss_migration_use_default"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_use_default"
+ android:textColor="#deFFFFFF"
+ android:textSize="14sp" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-land/migration_workspace_cling.xml b/res/layout-land/migration_workspace_cling.xml
deleted file mode 100644
index 1148be4..0000000
--- a/res/layout-land/migration_workspace_cling.xml
+++ /dev/null
@@ -1,70 +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="migration_workspace_landscape">
- <LinearLayout
- android:id="@+id/content"
- android:layout_width="400dp"
- android:layout_height="wrap_content"
- android:layout_gravity="end|center_vertical"
- android:paddingEnd="60dp"
- android:paddingRight="60dp"
- android:orientation="vertical">
- <LinearLayout
- android:id="@+id/migration_workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="4dp"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@drawable/cling_arrow_end" />
- </LinearLayout>
- <Button
- style="@style/ClingButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="5dp"
- android:layout_gravity="right"
- android:onClick="dismissMigrationWorkspaceCling" />
- </LinearLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-land/workspace_cling.xml b/res/layout-land/workspace_cling.xml
deleted file mode 100644
index d3b07d7..0000000
--- a/res/layout-land/workspace_cling.xml
+++ /dev/null
@@ -1,108 +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_landscape">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:id="@+id/workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginStart="25dp"
- android:layout_marginEnd="25dp"
- android:layout_marginTop="30dp"
- android:orientation="vertical">
- <LinearLayout
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/focused_hotseat_app_bubble"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|left"
- android:layout_marginLeft="25dp"
- android:layout_marginBottom="90dp"
- android:orientation="vertical"
- android:visibility="gone">
- <LinearLayout
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:layout_width="240dp"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:background="@drawable/cling">
- <TextView
- android:id="@+id/focused_hotseat_app_title"
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- <TextView
- android:id="@+id/focused_hotseat_app_description"
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:layout_marginLeft="78dp"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
- </FrameLayout>
-
- <Button
- style="@style/ClingButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="20dp"
- android:layout_gravity="bottom|right"
- 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
deleted file mode 100644
index ac3939c..0000000
--- a/res/layout-port/first_run_cling.xml
+++ /dev/null
@@ -1,100 +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="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="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="100dp"
- android:layout_marginRight="100dp"
- android:orientation="vertical">
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="10dp"
- android:text="@string/first_run_cling_title"
- android:textColor="#FFFFFFFF"
- android:gravity="center" />
- <TextView
- style="@style/ClingAltText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/first_run_cling_description"
- android:textColor="#80000000"
- android:gravity="center" />
- </LinearLayout>
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/search_bar_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:layout_marginEnd="10dp"
- android:layout_marginTop="65dp"
- android:gravity="center_horizontal"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableTop="@drawable/cling_arrow_up"
- android:drawablePadding="5dp"
- android:text="@string/first_run_cling_search_bar_hint" />
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/custom_content_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|start"
- android:layout_marginStart="10dp"
- android:layout_marginEnd="10dp"
- android:layout_marginTop="100dp"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_start"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_custom_content_hint" />
- <TextView
- style="@style/ClingHintText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="10dp"
- android:layout_marginBottom="85dp"
- android:maxWidth="180dp"
- android:drawableEnd="@drawable/cling_arrow_end"
- android:drawablePadding="5dp"
- 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
deleted file mode 100644
index 1a1b11f..0000000
--- a/res/layout-port/folder_cling.xml
+++ /dev/null
@@ -1,65 +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_portrait">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="15dp"
- android:layout_marginEnd="15dp"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="10dp">
- <LinearLayout
- android:id="@+id/folder_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- 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="match_parent"
- android:layout_height="wrap_content"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
- </FrameLayout>
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginBottom="15dp"
- android:layout_marginEnd="20dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissFolderCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 46e0c0f..9e98d42 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -65,40 +65,6 @@
android:id="@+id/search_drop_target_bar"
layout="@layout/search_drop_target_bar" />
- <!-- 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. -->
- <com.android.launcher3.ScrimView
- android:id="@+id/cling_scrim"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <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/migration_cling"
- android:id="@+id/migration_cling"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <include layout="@layout/migration_workspace_cling"
- android:id="@+id/migration_workspace_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"
- 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" />
-
<!-- This is the search bar voice button proxy view. It allows us to have a larger
touch target than the microphone constrained by the search bar bounds. -->
<com.android.launcher3.DrawableStateProxyView
diff --git a/res/layout-port/longpress_cling.xml b/res/layout-port/longpress_cling.xml
new file mode 100644
index 0000000..8e35f5c
--- /dev/null
+++ b/res/layout-port/longpress_cling.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
+ android:id="@+id/longpress_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/cling_scrim_background" >
+
+ <FrameLayout
+ android:id="@+id/cling_content"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:background="@drawable/cling_bg"
+ android:tag="crop_bg_top_and_sides" />
+
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-port/migration_cling.xml b/res/layout-port/migration_cling.xml
index 1bffe6c..dde8dbc 100644
--- a/res/layout-port/migration_cling.xml
+++ b/res/layout-port/migration_cling.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!--
+ 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.
@@ -13,88 +14,93 @@
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"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/migration_cling"
android:layout_width="match_parent"
android:layout_height="match_parent"
- launcher:drawIdentifier="migration_portrait">
- <FrameLayout
- android:id="@+id/content"
+ android:background="#FF009688" >
+
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" >
+
+ <ImageView
+ android:layout_width="@dimen/cling_migration_bg_size"
+ android:layout_height="@dimen/cling_migration_bg_size"
+ android:layout_below="@+id/ic_cling_migration"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="@dimen/cling_migration_bg_shift"
+ android:src="@drawable/bg_migration_cling" />
+
+ <ImageView
+ android:id="@+id/ic_cling_migration"
+ android:layout_width="@dimen/cling_migration_logo_width"
+ android:layout_height="@dimen/cling_migration_logo_height"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:src="@drawable/ic_migration" />
<LinearLayout
- android:layout_width="match_parent"
+ android:layout_width="@dimen/cling_migration_content_width"
android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:gravity="center"
- android:text="@string/first_run_cling_title"
- android:textSize="42dp"
- android:textColor="#FFffffff" />
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="0dp"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/on_boarding_welcome" />
+ android:layout_below="@+id/ic_cling_migration"
+ android:layout_marginStart="@dimen/cling_migration_content_margin"
+ android:orientation="vertical"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp" >
- <ImageView
+ <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_up" />
+ android:paddingBottom="8dp"
+ android:text="@string/first_run_cling_title"
+ android:textColor="#E1000000"
+ android:textSize="34sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_title"
+ android:textColor="#E1000000"
+ android:textSize="20sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="24dp"
+ android:text="@string/migration_cling_description"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:paddingLeft="25dp"
- android:paddingRight="25dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:orientation="vertical"
- android:background="@drawable/cling">
- <TextView
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <Button
+ android:id="@+id/cling_dismiss_migration_copy_apps"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="@string/migration_cling_title" />
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_copy_apps"
+ android:textColor="#FFFFFFFF"
+ android:textSize="14sp" />
+
+ <Button
+ android:id="@+id/cling_dismiss_migration_use_default"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="@string/migration_cling_description" />
+ android:layout_weight="1"
+ android:fontFamily="sans-serif-medium"
+ android:text="@string/migration_cling_use_default"
+ android:textColor="#deFFFFFF"
+ android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
+ </RelativeLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:layout_marginBottom="25dp"
- android:orientation="vertical">
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_copy_apps"
- android:onClick="dismissMigrationClingCopyApps" />
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_use_default"
- android:onClick="dismissMigrationClingUseDefault" />
- </LinearLayout>
- </FrameLayout>
-</com.android.launcher3.Cling>
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-port/migration_workspace_cling.xml b/res/layout-port/migration_workspace_cling.xml
deleted file mode 100644
index 576bb41..0000000
--- a/res/layout-port/migration_workspace_cling.xml
+++ /dev/null
@@ -1,70 +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="migration_workspace_portrait">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:id="@+id/migration_workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginStart="25dp"
- android:layout_marginEnd="25dp"
- android:orientation="vertical">
- <LinearLayout
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
-
- <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|right"
- android:onClick="dismissMigrationWorkspaceCling" />
- </FrameLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
deleted file mode 100644
index 6245686..0000000
--- a/res/layout-port/workspace_cling.xml
+++ /dev/null
@@ -1,108 +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:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:id="@+id/workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginStart="25dp"
- android:layout_marginEnd="25dp"
- android:layout_marginTop="30dp"
- android:orientation="vertical">
- <LinearLayout
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/focused_hotseat_app_bubble"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|left"
- android:layout_marginLeft="25dp"
- android:layout_marginBottom="90dp"
- android:orientation="vertical"
- android:visibility="gone">
- <LinearLayout
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:layout_width="240dp"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:background="@drawable/cling">
- <TextView
- android:id="@+id/focused_hotseat_app_title"
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- <TextView
- android:id="@+id/focused_hotseat_app_description"
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:layout_marginLeft="78dp"
- android:src="@drawable/cling_arrow_down" />
- </LinearLayout>
- </FrameLayout>
-
- <Button
- style="@style/ClingButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="15dp"
- android:layout_marginRight="20dp"
- android:layout_gravity="bottom|right"
- android:onClick="dismissWorkspaceCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp-port/first_run_cling.xml b/res/layout-sw600dp-port/first_run_cling.xml
deleted file mode 100644
index d80c084..0000000
--- a/res/layout-sw600dp-port/first_run_cling.xml
+++ /dev/null
@@ -1,100 +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="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="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="100dp"
- android:layout_marginRight="100dp"
- android:orientation="vertical">
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="10dp"
- android:text="@string/first_run_cling_title"
- android:textColor="#FFFFFFFF"
- android:gravity="center" />
- <TextView
- style="@style/ClingAltText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/first_run_cling_description"
- android:textColor="#80000000"
- android:gravity="center" />
- </LinearLayout>
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/search_bar_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:layout_marginEnd="30dp"
- android:layout_marginTop="80dp"
- android:gravity="center_horizontal"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableTop="@drawable/cling_arrow_up"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_search_bar_hint" />
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/custom_content_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|start"
- android:layout_marginStart="30dp"
- android:layout_marginTop="120dp"
- android:gravity="start"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_start"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_custom_content_hint" />
- <TextView
- style="@style/ClingHintText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="30dp"
- android:layout_marginBottom="120dp"
- android:maxWidth="180dp"
- android:drawableEnd="@drawable/cling_arrow_end"
- android:drawablePadding="10dp"
- 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="30dp"
- android:layout_marginEnd="30dp"
- android:layout_gravity="bottom|end"
- android:onClick="dismissFirstRunCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp-port/longpress_cling.xml b/res/layout-sw600dp-port/longpress_cling.xml
new file mode 100644
index 0000000..b42d697
--- /dev/null
+++ b/res/layout-sw600dp-port/longpress_cling.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
+ android:id="@+id/longpress_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/cling_scrim_background"
+ android:orientation="vertical" >
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <FrameLayout
+ android:id="@+id/cling_content"
+ android:layout_width="360dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:background="@drawable/cling_bg" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="3" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw600dp-port/migration_workspace_cling.xml b/res/layout-sw600dp-port/migration_workspace_cling.xml
deleted file mode 100644
index eb13137..0000000
--- a/res/layout-sw600dp-port/migration_workspace_cling.xml
+++ /dev/null
@@ -1,70 +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="migration_workspace_large_portrait">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="480dp"
- android:layout_height="match_parent"
- android:layout_gravity="bottom|center_horizontal">
- <LinearLayout
- android:id="@+id/migration_workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginStart="25dp"
- android:layout_marginEnd="25dp"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="4dp"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/dismiss_migration_workspace_cling_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:onClick="dismissMigrationWorkspaceCling" />
- </LinearLayout>
- </FrameLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp/first_run_cling.xml b/res/layout-sw600dp/first_run_cling.xml
deleted file mode 100644
index 295765b..0000000
--- a/res/layout-sw600dp/first_run_cling.xml
+++ /dev/null
@@ -1,100 +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="first_run_landscape">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:id="@+id/bubble_content"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="100dp"
- android:layout_marginRight="100dp"
- android:orientation="vertical">
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="10dp"
- android:text="@string/first_run_cling_title"
- android:textColor="#FFFFFFFF"
- android:gravity="center" />
- <TextView
- style="@style/ClingAltText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/first_run_cling_description"
- android:textColor="#80000000"
- android:gravity="center" />
- </LinearLayout>
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/search_bar_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|start"
- android:layout_marginStart="60dp"
- android:layout_marginTop="105dp"
- android:gravity="start"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_start"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_search_bar_hint" />
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/custom_content_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|start"
- android:layout_marginStart="60dp"
- android:layout_marginTop="200dp"
- android:gravity="start"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_start"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_custom_content_hint" />
- <TextView
- style="@style/ClingHintText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="30dp"
- android:layout_marginBottom="120dp"
- android:maxWidth="180dp"
- android:drawableEnd="@drawable/cling_arrow_end"
- android:drawablePadding="10dp"
- 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="30dp"
- android:layout_marginEnd="30dp"
- android:layout_gravity="bottom|end"
- android:onClick="dismissFirstRunCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp/folder_cling.xml b/res/layout-sw600dp/folder_cling.xml
deleted file mode 100644
index f21aef4..0000000
--- a/res/layout-sw600dp/folder_cling.xml
+++ /dev/null
@@ -1,66 +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">
- <LinearLayout
- android:id="@+id/folder_bubble"
- android:layout_width="300dp"
- android:layout_height="match_parent"
- android:layout_gravity="left|top"
- android:paddingTop="28dp"
- android:paddingRight="10dp"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@drawable/cling_arrow_start" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="4dp"
- 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>
- </LinearLayout>
- <Button
- style="@style/ClingButton"
- android:id="@+id/cling_dismiss"
- android:layout_marginTop="5dp"
- android:layout_gravity="right"
- android:onClick="dismissFolderCling" />
- </LinearLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp/migration_cling.xml b/res/layout-sw600dp/migration_cling.xml
deleted file mode 100644
index 19def6a..0000000
--- a/res/layout-sw600dp/migration_cling.xml
+++ /dev/null
@@ -1,98 +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="migration_portrait">
- <LinearLayout
- android:id="@+id/content"
- android:layout_width="360dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:orientation="vertical">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginBottom="15dp"
- android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:text="@string/first_run_cling_title"
- android:textSize="42dp"
- android:textColor="#FFffffff" />
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="0dp"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/on_boarding_welcome" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_up" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="4dp"
- android:layout_marginRight="4dp"
- android:paddingLeft="25dp"
- android:paddingRight="25dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- android:orientation="vertical"
- android:background="@drawable/cling">
- <TextView
- style="@style/ClingTitleText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_title" />
- <TextView
- style="@style/ClingText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_description" />
- </LinearLayout>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:orientation="vertical">
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_copy_apps"
- android:onClick="dismissMigrationClingCopyApps" />
- <Button
- style="@style/ClingButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/migration_cling_use_default"
- android:onClick="dismissMigrationClingUseDefault" />
- </LinearLayout>
- </LinearLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw600dp/workspace_cling.xml b/res/layout-sw600dp/workspace_cling.xml
deleted file mode 100644
index 63b5522..0000000
--- a/res/layout-sw600dp/workspace_cling.xml
+++ /dev/null
@@ -1,65 +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_large">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:id="@+id/workspace_cling_bubble"
- android:layout_width="400dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal|bottom"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- <Button
- style="@style/ClingButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:onClick="dismissWorkspaceCling" />
- </LinearLayout>
- </FrameLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw720dp/first_run_cling.xml b/res/layout-sw720dp/first_run_cling.xml
deleted file mode 100644
index c43d8d3..0000000
--- a/res/layout-sw720dp/first_run_cling.xml
+++ /dev/null
@@ -1,98 +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="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="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="100dp"
- android:layout_marginRight="100dp"
- android:orientation="vertical">
- <TextView
- style="@style/ClingAltTitleText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="10dp"
- android:text="@string/first_run_cling_title"
- android:textColor="#FFFFFFFF"
- android:gravity="center" />
- <TextView
- style="@style/ClingAltText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/first_run_cling_description"
- android:textColor="#80000000"
- android:gravity="center" />
- </LinearLayout>
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/search_bar_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:layout_marginEnd="120dp"
- android:layout_marginTop="80dp"
- android:gravity="center_horizontal"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableTop="@drawable/cling_arrow_up"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_search_bar_hint" />
- <TextView
- style="@style/ClingHintText"
- android:id="@+id/custom_content_hint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical|start"
- android:layout_marginStart="30dp"
- android:gravity="start"
- android:maxWidth="160dp"
- android:visibility="gone"
- android:drawableStart="@drawable/cling_arrow_start"
- android:drawablePadding="10dp"
- android:text="@string/first_run_cling_custom_content_hint" />
- <TextView
- style="@style/ClingHintText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical|end"
- android:layout_marginEnd="30dp"
- android:maxWidth="180dp"
- android:drawableEnd="@drawable/cling_arrow_end"
- android:drawablePadding="10dp"
- 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="30dp"
- android:layout_marginEnd="40dp"
- android:layout_gravity="bottom|end"
- android:onClick="dismissFirstRunCling" />
-</com.android.launcher3.Cling>
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index f8b8437..6261541 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -66,40 +66,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
- <!-- 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. -->
- <com.android.launcher3.ScrimView
- android:id="@+id/cling_scrim"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <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/migration_cling"
- android:id="@+id/migration_cling"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- <include layout="@layout/migration_workspace_cling"
- android:id="@+id/migration_workspace_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"
- 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.launcher3.DrawableStateProxyView
android:id="@+id/voice_button_proxy"
android:layout_width="0dp"
diff --git a/res/layout-sw720dp/migration_workspace_cling.xml b/res/layout-sw720dp/migration_workspace_cling.xml
deleted file mode 100644
index eb13137..0000000
--- a/res/layout-sw720dp/migration_workspace_cling.xml
+++ /dev/null
@@ -1,70 +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="migration_workspace_large_portrait">
- <FrameLayout
- android:id="@+id/content"
- android:layout_width="480dp"
- android:layout_height="match_parent"
- android:layout_gravity="bottom|center_horizontal">
- <LinearLayout
- android:id="@+id/migration_workspace_cling_bubble"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginStart="25dp"
- android:layout_marginEnd="25dp"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="4dp"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp"
- android:paddingBottom="20dp"
- 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>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:src="@drawable/cling_arrow_down" />
- <Button
- style="@style/ClingButton"
- android:id="@+id/dismiss_migration_workspace_cling_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:onClick="dismissMigrationWorkspaceCling" />
- </LinearLayout>
- </FrameLayout>
-</com.android.launcher3.Cling>
diff --git a/res/layout/apps_customize_application.xml b/res/layout/apps_customize_application.xml
index 17f4a8e..c56cdf3 100644
--- a/res/layout/apps_customize_application.xml
+++ b/res/layout/apps_customize_application.xml
@@ -14,10 +14,8 @@
limitations under the License.
-->
-<com.android.launcher3.PagedViewIcon
+<com.android.launcher3.BubbleTextView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
-
style="@style/WorkspaceIcon.AppsCustomize"
android:id="@+id/application_icon"
android:focusable="true" />
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index c2d399e..bf5f71b 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -49,8 +49,6 @@
android:layout_height="match_parent"
launcher:widgetCountX="@integer/apps_customize_widget_cell_count_x"
launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y"
- launcher:clingFocusedX="@integer/apps_customize_cling_focused_x"
- launcher:clingFocusedY="@integer/apps_customize_cling_focused_y"
launcher:maxGap="@dimen/workspace_max_gap"
launcher:pageIndicator="@+id/apps_customize_page_indicator" />
</FrameLayout>
diff --git a/res/layout/custom_content_page_indicator_marker.xml b/res/layout/custom_content_page_indicator_marker.xml
deleted file mode 100644
index 8fe3f8f..0000000
--- a/res/layout/custom_content_page_indicator_marker.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 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.PageIndicatorMarker
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
- android:layout_width="16dp"
- android:layout_height="16dp"
- android:layout_gravity="center_vertical">
- <ImageView
- android:id="@+id/inactive"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:src="@drawable/custom_content_page"
- />
- <ImageView
- android:id="@+id/active"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:src="@drawable/custom_content_page"
- android:alpha="0"
- android:scaleX="0.5"
- android:scaleY="0.5"
- />
-</com.android.launcher3.PageIndicatorMarker>
diff --git a/res/layout/longpress_cling_content.xml b/res/layout/longpress_cling_content.xml
new file mode 100644
index 0000000..47a8e97
--- /dev/null
+++ b/res/layout/longpress_cling_content.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="24dp"
+ android:paddingTop="36dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="36dp"
+ android:paddingRight="36dp"
+ android:text="@string/workspace_cling_longpress_title"
+ android:textColor="#E1000000"
+ android:textSize="24sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:paddingLeft="36dp"
+ android:paddingRight="36dp"
+ android:text="@string/workspace_cling_longpress_description"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
+ <Button
+ android:id="@+id/cling_dismiss_longpress_info"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginRight="12dp"
+ android:layout_marginTop="27dp"
+ android:fontFamily="sans-serif-medium"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
+ android:text="@string/workspace_cling_longpress_dismiss"
+ android:textColor="#FFFFFFFF"
+ android:textSize="14sp" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/longpress_cling_welcome_content.xml b/res/layout/longpress_cling_welcome_content.xml
new file mode 100644
index 0000000..dd4f8d7
--- /dev/null
+++ b/res/layout/longpress_cling_welcome_content.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="24dp"
+ android:paddingTop="36dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ android:paddingLeft="36dp"
+ android:paddingRight="36dp"
+ android:text="@string/first_run_cling_title"
+ android:textColor="#E1000000"
+ android:textSize="34sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="5.3dp"
+ android:fontFamily="sans-serif-medium"
+ android:paddingLeft="36dp"
+ android:paddingRight="36dp"
+ android:text="@string/workspace_cling_longpress_title"
+ android:textColor="#E1000000"
+ android:textSize="20sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="36dp"
+ android:paddingRight="36dp"
+ android:text="@string/workspace_cling_longpress_description"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
+ <Button
+ android:id="@+id/cling_dismiss_longpress_info"
+ style="?android:attr/buttonBarButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginRight="12dp"
+ android:layout_marginTop="27dp"
+ android:fontFamily="sans-serif-medium"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
+ android:text="@string/workspace_cling_longpress_dismiss"
+ android:textColor="#FFFFFFFF"
+ android:textSize="14sp" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index bb933f7..4a4bb78 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"skryf Tuis-instellings en -kortpaaie"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Laat die program toe om die instellings en kortpaaie in Tuis te verander."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Kon nie legstuk laai nie"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Stel op"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Dit is \'n stelselprogram en kan nie gedeïnstalleer word nie."</string>
<string name="dream_name" msgid="1530253749244328964">"Vuurpyllanseerder"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Naamlose vouer"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"BEGIN VAN NUUTS AF"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiseer jou spasie"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Raak en hou agtergrond om muurpapier, legstukke en instellings te bestuur."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Muurpapiere, legstukke en instellings"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Raak en hou agtergrond om te pasmaak"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"HET DIT"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Hier\'s \'n vouer"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Om een soos dié te skep, raak en hou \'n program en skuif dit dan oor \'n ander een."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 51d5c70..d77744c 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"የመነሻ ቅንብሮችን እና አቋራጮችን ይጽፋል"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"መተግብሪያው ቅንብሮችን እና አቋራጮችን በመነሻ ውስጥ እንዲቀይራቸው ያስችለዋል።"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"ፍርግም የመጫን ችግር"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"ማዋቀሪያ"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"ይህ የስርዓት መተግበሪያ ነው እና ማራገፍ አይቻልም።"</string>
<string name="dream_name" msgid="1530253749244328964">"የሮኬት ማስጀመሪያ"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"ስም-አልባ አቃፊ"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"እንደ አዲስ ይጀምሩ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"ቦታዎን ያደራጁ"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"የግድግዳ ወረቀት፣ ምግብሮችን እና ቅንብሮችን ለማቀናበር ጀርባውን ይንኩ እና ይያዙት።"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"የግድግዳ ወረቀቶች፣ ንዑስ ፕሮግራሞች እና ቅንብሮች"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"ለማበጀት ጀርባውን ነክተው ይያዙት"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ገባኝ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"አንድ አቃፊ እነሆ"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"አንድ እንደዚህ አይነት ለመፍጠር መተግበሪያውን ነክተው ይያዙት እና ወደ ሌላ ያንቀሳቅሱት።"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"እሺ"</string>
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index cb62184..8b6aa02 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"كتابة إعدادات واختصارات الشاشة الرئيسية"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"للسماح للتطبيق بتغيير الإعدادات والاختصارات في الشاشة الرئيسية."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"حدثت مشكلة أثناء تحميل الأداة"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"الإعداد"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"هذا تطبيق نظام وتتعذر إزالته."</string>
<string name="dream_name" msgid="1530253749244328964">"قاذفة صواريخ"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"مجلد بدون اسم"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"بداية جديدة"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"تنظيم مساحتك"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"المس مع الاستمرار الجزء الخلفي من صورة الشاشة لإدارة الخلفية والأدوات والإعدادات."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"الخلفيات والأدوات والإعدادات"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"المس مع الاستمرار الخلفية لتخصيصها"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"حسنًا"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"إليك المجلد"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"لإنشاء مجلد مثل هذا، المس أحد التطبيقات مع استمرار اللمس، ثم حركه فوق آخر."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"موافق"</string>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index 5f93a9a..dcd1930 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"запис на настройките и преките пътища в Начало"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Разрешава на приложението да променя настройките и преките пътища в Начало."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Проблем при зареждане на приспособлението"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Настройване"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Това е системно приложение и не може да се деинсталира."</string>
<string name="dream_name" msgid="1530253749244328964">"Ракетна площадка"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Папка без име"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"СТАРТИРАНЕ ОТНАЧАЛО"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Организиране на мястото ви"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Докоснете и задръжте фона, за да управлявате тапета, приспособленията и настройките."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Тапети, приспособления и настройки"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Докоснете и задръжте фона за персонализиране"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"РАЗБРАХ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ето една папка"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"За да създадете подобна, докоснете и задръжте приложение, след което го преместете върху друго."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"ОK"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 7fc9051..6d10235 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"escriu la configuració i les dreceres de la pantalla d\'inici"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permet que l\'aplicació canviï la configuració i les dreceres de la pantalla d\'inici."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"S\'ha produït un problema en carregar el widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuració"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Aquesta aplicació és una aplicació del sistema i no es pot desinstal·lar."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Carpeta sense nom"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"NOU COMENÇAMENT"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organitza el teu espai"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Toca i mantén premut el fons per gestionar el fons de pantalla, els widgets i la configuració."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fons de pantalla, widgets i configuració"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Mantén premut el fons per fer personalitzacions."</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"D\'ACORD"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Aquí hi ha una carpeta"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Per crear-ne una com aquesta, mantén premuda una aplicació i, a continuació, mou-la sobre una altra."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"D\'acord"</string>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index e90afb0..f729a46 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"zápis nastavení a odkazů plochy"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Umožňuje aplikaci změnit nastavení a odkazy na ploše."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problém s načtením widgetu"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Nastavení"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Toto je systémová aplikace a nelze ji odinstalovat."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Složka bez názvu"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ZAČÍT S VÝCHOZÍM ROZVRŽENÍM"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizace prostoru"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Chcete-li spravovat tapetu, widgety a nastavení, dotkněte se pozadí a přidržte je."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Tapety, widgety a nastavení"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Pozadí můžete přizpůsobit klepnutím a podržením"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ROZUMÍM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Toto je složka"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Chcete-li vytvořit složku, přetáhněte aplikaci na jinou aplikaci."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 60ea2c6..85159b2 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"skrive indstillinger og genveje for startskærmen"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Tillader, at appen ændrer indstillingerne og genvejene på startskærmen."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Der er problemer med indlæsning af widgetten"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Konfigurer"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Dette er en systemapp, som ikke kan afinstalleres."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Unavngiven mappe"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"START PÅ EN FRISK"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiser din arbejdsplads"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Tryk på en baggrund, og hold fingeren nede for at administrere baggrunde, widgets og indstillinger."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Baggrunde, widgets og indstillinger"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Tryk på baggrunden, og hold fingeren nede for at tilpasse den"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK, FORSTÅET"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Her kan du se en mappe"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Du kan oprette en mappe magen til denne ved at trykke på en app og holde fingeren nede, mens du flytter appen til en anden mappe."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 1e225eb..698a254 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"Einstellungen und Verknüpfungen für den Startbildschirm schreiben"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Ermöglicht der App, die Einstellungen und Verknüpfungen auf dem Startbildschirm zu ändern"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem beim Laden des Widgets"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Einrichten"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Dies ist eine Systemanwendung, die nicht deinstalliert werden kann."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Unbenannter Ordner"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"Standardübersicht verwenden"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Arbeitsbereich organisieren"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Hintergrund berühren und halten, um Hintergrund, Widgets und Einstellungen zu verwalten"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Hintergründe, Widgets & Einstellungen"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Berühren und halten Sie den Hintergrund, um ihn anzupassen."</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Hier ist ein Ordner"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Um einen Ordner zu erstellen, berühren und halten Sie eine App und verschieben Sie sie auf eine andere."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index ccc5a29..3eec27d 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"εγγραφή ρυθμίσεων και συντομεύσεων αρχικής οθόνης"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Επιτρέπει στην εφαρμογή την αλλαγή των ρυθμίσεων και των συντομεύσεων στην Αρχική οθόνη."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Παρουσιάστηκε πρόβλημα στη φόρτωση του γραφικού στοιχείου"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Ρύθμιση"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Αυτή είναι μια εφαρμογή συστήματος και δεν είναι δυνατή η κατάργηση της εγκατάστασής της."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Φάκελος χωρίς όνομα"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ΝΕΑ ΕΝΑΡΞΗ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Οργανώστε το χώρο σας"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Αγγίξτε παρατεταμένα το φόντο για να διαχειριστείτε την ταπετσαρία, τα γραφικά στοιχεία και τις ρυθμίσεις."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Ταπετσαρίες, γραφικά στοιχεία και ρυθμίσεις"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Αγγίξτε παρατεταμένα το παρασκήνιο για προσαρμογή"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ΕΓΙΝΕ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ορίστε ένας φάκελος"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Για να δημιουργήσετε έναν φάκελο σαν κι αυτόν, πατήστε παρατεταμένα μια εφαρμογή και στη συνέχεια, μετακινήστε τη πάνω σε μια άλλη."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 7be42db..615e5c9 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"write Home settings and shortcuts"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Allows the app to change the settings and shortcuts in Home."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem loading widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Setup"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"This is a system app and can\'t be uninstalled."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Unnamed Folder"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"START AFRESH"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organise your space"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Touch & hold background to manage wallpaper, widgets and settings."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Wallpapers, widgets, & settings"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Touch & hold background to customise"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"GOT IT"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Here\'s a folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"To create one like this, touch & hold an app, then move it over another."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index 7be42db..615e5c9 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"write Home settings and shortcuts"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Allows the app to change the settings and shortcuts in Home."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem loading widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Setup"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"This is a system app and can\'t be uninstalled."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Unnamed Folder"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"START AFRESH"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organise your space"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Touch & hold background to manage wallpaper, widgets and settings."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Wallpapers, widgets, & settings"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Touch & hold background to customise"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"GOT IT"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Here\'s a folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"To create one like this, touch & hold an app, then move it over another."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-en-sw340dp/dimens.xml b/res/values-en-sw340dp/dimens.xml
deleted file mode 100644
index 96d5304..0000000
--- a/res/values-en-sw340dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources>
-<!-- Cling -->
- <dimen name="cling_title_text_size">22sp</dimen>
- <dimen name="cling_text_size">16sp</dimen>
- <dimen name="cling_alt_title_text_size">30sp</dimen>
- <dimen name="cling_alt_text_size">16sp</dimen>
- <dimen name="cling_hint_text_size">18sp</dimen>
-</resources>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 304f027..31afa3e 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"escribir configuración y accesos directos de la pantalla principal"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permite que la aplicación cambie la configuración y los accesos directos de la pantalla principal."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema al cargar el widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuración"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Esta es una aplicación del sistema y no se puede desinstalar."</string>
<string name="dream_name" msgid="1530253749244328964">"Lanzacohetes"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Carpeta sin nombre"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"EMPEZAR DE CERO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiza tu espacio"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Mantén presionado el fondo para administrar el fondo de pantalla, los widgets y la configuración."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fondos, widgets y configuración"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Mantén presionado el fondo para personalizarlo"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ENTENDIDO"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Aquí tienes una carpeta"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Para crear una carpeta como esta, mantén presionada una aplicación y luego muévela sobre otra."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Aceptar"</string>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index dbb3c43..4e91412 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"escribir información de accesos directos y de ajustes de la pantalla de inicio"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permite que las aplicaciones cambien los ajustes y los accesos directos de la pantalla de inicio."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema al cargar el widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuración"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Esta aplicación es del sistema y no se puede desinstalar."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Carpeta sin nombre"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"AJUSTES PREDETERMINADOS"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiza tu espacio"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Mantén pulsado el fondo para gestionar el fondo de pantalla, los widgets y los ajustes."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fondos de pantalla, widgets y ajustes"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Mantén pulsado el fondo para personalizarlo"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ENTENDIDO"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Esto es una carpeta"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Para crear una carpeta como esta, mantén pulsada una aplicación y muévela sobre otra."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Aceptar"</string>
diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml
index 05f38b0..fa352a1 100644
--- a/res/values-et-rEE/strings.xml
+++ b/res/values-et-rEE/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"kirjuta avaekraani seaded ja otseteed"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Võimaldab rakendusel muuta avaekraanil seadeid ja otseteid."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Probleem vidina laadimisel"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Seadistamine"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"See on süsteemirakendus ja seda ei saa desinstallida."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Nimetu kaust"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ALUSTA ALGUSEST"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Korraldage oma ruumi"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Taustapildi, vidinate ja seadete haldamiseks puudutage tausta ning hoidke seda all."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Taustapildid, vidinad ja seaded"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Kohandamiseks puudutage ja hoidke tausta all"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SELGE"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Siin on kaust"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Sarnase loomiseks vajutage ja hoidke rakendust all, seejärel viige see teise peale."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 3a63ad9..13f40e2 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"نوشتن تنظیمات و میانبرهای صفحه اصلی"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"به برنامه اجازه میدهد تنظیمات و میانبرها را در صفحه اصلی تغییر دهد."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"مشکل در بارگیری ابزارک"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"تنظیم"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"این برنامه سیستمی است و حذف نصب نمیشود."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"پوشه بینام"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"شروع تازه"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"فضای خود را سازماندهی کنید"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"برای مدیریت کاغذدیواری، ابزارکها و تنظیمات، پسزمینه را لمس کرده و نگهدارید."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"کاغذدیواریها، ابزارکها و تنظیمات"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"برای سفارشی کردن، پسزمینه را لمس کنید و نگهدارید"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"متوجه شدم"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"اینجا یک پوشه است"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"برای ایجاد پوشهای مثل این، یک برنامه را لمس کرده و نگهدارید، سپس آن را روی برنامه دیگر بیاندازید."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"تأیید"</string>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index 4c09e34..3990a16 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"kirjoita aloitusruudun asetuksia ja pikakuvakkeita"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Antaa sovelluksen muuttaa aloitusruudun asetuksia ja pikakuvakkeita."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Ongelma ladattaessa widgetiä"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Asetus"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Tämä on järjestelmäsovellus, eikä sitä voi poistaa."</string>
<string name="dream_name" msgid="1530253749244328964">"Sinko"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Nimetön kansio"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ALOITA ALUSTA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Järjestä tilasi"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Hallitse taustakuvaa, widgetejä ja asetuksia koskettamalla taustaa pitkään."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Taustakuvat, widgetit ja asetukset"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Muokkaa taustaa koskettamalla ja painamalla pitkään"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SELVÄ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Tässä on kansio"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Luo se seuraavasti: kosketa sovellusta pitkään ja siirrä se sitten toisen päälle."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml
index 8674cd3..f428350 100644
--- a/res/values-fr-rCA/strings.xml
+++ b/res/values-fr-rCA/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"enregistrer les paramètres de la page d\'accueil et des raccourcis"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permet à l\'application de modifier les paramètres et les raccourcis de l\'écran d\'accueil."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problème lors du chargement du widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuration"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Impossible de désinstaller cette application, car il s\'agit d\'une application système."</string>
<string name="dream_name" msgid="1530253749244328964">"Lance-missile"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Dossier sans nom"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"DISPOSITION PAR DÉFAUT"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiser son espace personnel"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Maintenez votre doigt sur l\'arrière-plan pour gérer les fonds d\'écran, les widgets et les paramètres."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fonds d\'écran, widgets et paramètres"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Maintenez le doigt sur le fond d\'écran pour personnaliser"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"J\'ai compris"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Voici un dossier"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Pour créer un dossier comme ça, maintenez votre doigt sur une application, puis déplacez-la sur une autre."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 17cdab7..31448f1 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"modifier les paramètres et les raccourcis de l\'écran d\'accueil"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permettre à l\'application de modifier les paramètres et les raccourcis de l\'écran d\'accueil"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problème lors du chargement du widget."</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuration"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Impossible de désinstaller cette application, car il s\'agit d\'une application système."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Dossier sans nom"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"DISPOSITION PAR DÉFAUT"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organisez votre espace"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Appuyez de manière prolongée sur l\'arrière-plan pour gérer les fonds d\'écran, les widgets et les paramètres."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fonds d\'écran, widgets et paramètres"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Appuyez de manière prolongée sur l\'arrière-plan pour le personnaliser."</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Voici un dossier"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Pour en créer un, appuyez de manière prolongée sur une application, puis déplacez-la vers une autre."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index 49943aa..9058b78 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"होम सेटिंग और शॉर्टकट लिखें"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"ऐप्लिकेशन को होम में सेटिंग और शॉर्टकट बदलने देती है."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"विजेट लोड करने में समस्या"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"सेटअप"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"यह एक सिस्टम ऐप्लिकेशन है और इसे अनइंस्टॉल नहीं किया जा सकता."</string>
<string name="dream_name" msgid="1530253749244328964">"रॉकेट लॉन्चर"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"अनामित फ़ोल्डर"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"फिर से शुरू करें"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"अपने स्थान को व्यवस्थित करें"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"वॉलपेपर, विजेट और सेटिंग प्रबंधित करने के लिए पृष्ठभूमि को स्पर्श करके रखें."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"वॉलपेपर, विजेट और सेटिंग"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"पृष्ठभूमि कस्टमाइज़ करने के लिए स्पर्श करके रखें"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"समझ लिया"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"यहां एक फ़ोल्डर है"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"इसके जैसा कोई एक बनाने के लिए, किसी ऐप्लिकेशन को स्पर्श करके रखें, फिर इसे किसी दूसरे पर ले जाएं."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"ठीक"</string>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index 696d2a7..c881077 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"pisanje postavki početnog zaslona i prečaca"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Aplikaciji omogućuje promjenu postavki i prečaca na početnom zaslonu."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem pri učitavanju widgeta"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Postavljanje"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Ovo je aplikacija sustava i ne može se ukloniti."</string>
<string name="dream_name" msgid="1530253749244328964">"Lansirna rampa"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Neimenovana mapa"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"POKRENI NOVO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizirajte svoj prostor"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Dodirnite i držite pozadinu da biste upravljali pozadinskom slikom, widgetima i postavkama."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Pozadinske slike, widgeti i postavke"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Dodirnite i zadržite pozadinu radi prilagodbe"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SHVAĆAM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Evo mape"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Da biste izradili ovakvu mapu, dodirnite i držite aplikaciju pa je pomaknite preko druge aplikacije."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"U redu"</string>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 33ee617..08d3095 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"Főoldal beállításainak és parancsikonjainak írása"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Lehetővé teszi az alkalmazás számára, hogy módosítsa a kezdőképernyő beállításait és parancsikonjait."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Probléma történt a modul betöltésekor"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Beállítás"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Ez egy rendszeralkalmazás, és nem lehet eltávolítani."</string>
<string name="dream_name" msgid="1530253749244328964">"Aknavető"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Névtelen mappa"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"TELJESEN ÚJ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Munkaterület rendezése"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Érintse meg és tartsa lenyomva a hátteret a háttérkép, modulok és beállítások kezeléséhez."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Háttérképek, modulok és beállítások"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Érintse meg és tartsa lenyomva a személyre szabáshoz"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"MEGÉRTETTEM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Itt egy mappa"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Mappa létrehozásához érintse meg és tartsa lenyomva az alkalmazást, majd húzza egy másik fölé."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index 2aa5cc0..4ec39c8 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"ստեղծել հիմնաէջի կարգավորումներ ու դյուրանցումներ"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Ծրագրին թույլ է տալիս փոփոխել հիմնաէջի կարգավորումներն ու դյուրանցումները:"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Վիջեթի բեռնման խնդիր կա"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Կարգավորում"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Սա համակարգային ծրագիր է և չի կարող ապատեղադրվել:"</string>
<string name="dream_name" msgid="1530253749244328964">"Հրթիռային թողարկիչ"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Անանուն թղթապանակ"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ՄԵԿՆԱՐԿԵԼ ԸՍՏ ԿԱՆԽԱԴՐՎԱԾԻ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Կառավարեք ձեր տարածությունը"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Հպեք և պահեք հետնաշերտի վրա՝ պաստառները, վիջեթներն ու կարգավորումները կառավարելու համար:"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Պաստառներ, վիջեթներ և կարգավորումներ"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Հարմարեցնելու համար հպեք և պահեք հետնաշերտի վրա"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ՀԱՍԿԱՆԱԼԻ Է"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ահա մի թղթապանակ"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Նման թղթապանակ ստեղծելու համար հպեք և պահեք որևէ ծրագրի վրա, ապա տեղաշարժեք այն մեկ ուրիշ ծրագրի վրա:"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Լավ"</string>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index db6f9a1..137e3cc 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"menulis setelan dan pintasan layar Utama"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Mengizinkan aplikasi mengubah setelan dan pintasan di layar Utama."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Masalah memuat widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Siapkan"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Ini adalah aplikasi sistem dan tidak dapat dicopot pemasangannya."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Folder Tanpa Nama"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"MULAI DARI AWAL"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Kelola ruang Anda"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Sentuh lama latar belakang untuk mengelola wallpaper, widget, dan setelan."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Wallpaper, widget, & setelan"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Sentuh & tahan latar belakang untuk menyesuaikan"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"MENGERTI"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ini adalah folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Untuk membuat seperti yang ini, sentuh lama aplikasi, lalu pindahkan ke atas aplikasi lain."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Oke"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 388fcca..b01b251 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"creazione di impostazioni e scorciatoie in Home"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Consente all\'app di modificare le impostazioni e le scorciatoie in Home."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Errore durante il caricamento del widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configurazione"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Questa è un\'app di sistema e non può essere disinstallata."</string>
<string name="dream_name" msgid="1530253749244328964">"Lanciamissili"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Cartella senza nome"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"RICOMINCIA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizza il tuo spazio"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Tocca e tieni premuto lo sfondo per gestire sfondi, widget e impostazioni."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Sfondi, widget e impostazioni"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Tocca lo sfondo e tieni premuto per personalizzare"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ecco una cartella"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Per crearne una simile, tocca un\'app e tieni premuto, dopodiché spostala sopra un\'altra."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index c87d948..6318207 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"כתוב הגדרות וקיצורי דרך של דף הבית"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"מאפשר לאפליקציה לשנות את ההגדרות וקיצורי הדרך בדף הבית."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"בעיה בטעינת ווידג\'ט"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"הגדר"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"זוהי אפליקציית מערכת ולא ניתן להסיר את התקנתה."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"תיקיה ללא שם"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"התחל דף חדש"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"ארגן את אזור העבודה שלך"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"גע נגיעה רציפה ברקע כדי לנהל את הטפט, רכיבי הווידג\'ט וההגדרות."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"טפטים, ווידג\'טים והגדרות"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"גע והחזק ברקע לביצוע התאמה אישית"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"הבנתי"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"הנה תיקייה"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"כדי ליצור תיקייה כזו, גע נגיעה רציפה באפליקציה, ולאחר מכן גרור ושחרר אותו על-גבי אפליקציה אחרת."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"אישור"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index aeddd07..232845a 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"ホームの設定とショートカットの書き込み"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"ホームの設定とショートカットの変更をアプリに許可します。"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"ウィジェットを表示できません"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"セットアップ"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"このシステムアプリはアンインストールできません。"</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"名前のないフォルダ"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"初期状態にリセットする"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"スペースを整理"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"壁紙、ウィジェット、設定を管理するには、背景を押し続けます。"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"壁紙、ウィジェット、設定"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"カスタマイズするにはバックグラウンドを押し続けます"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"これがフォルダです"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"これと同じフォルダを作成するには、アプリを押し続けてから別のアプリの上に移動します。"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-ka-rGE/strings.xml b/res/values-ka-rGE/strings.xml
index a1ab308..2fb51f5 100644
--- a/res/values-ka-rGE/strings.xml
+++ b/res/values-ka-rGE/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"მთავარი ეკრანის პარამეტრებისა და მალსახმობების ჩაწერა"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"აპისთვის მთავარი ეკრანის პარამეტრებისა და მალსახმობების შეცვლის უფლების მიცემა."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"პრობლემა ვიჯეტის ჩატვირთვისას"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"დაყენება"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"ეს სისტემური აპია და მისი წაშლა შეუძლებელია."</string>
<string name="dream_name" msgid="1530253749244328964">"ფეიერვერკი"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"უსახელო საქაღალდე"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"სტანდარტული განლაგება"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"თქვენი სივრცის ორგანიზება"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"თუ გსურთ ფონების, ვიჯეტების და პარამეტრების მართვა, შეეხეთ და არ აუშვათ ფონს."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"ფონები, ვიჯეტები, & პარამეტრები"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"მოსარგებად შეეხეთ & დააყოვნეთ ფონზე"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"გასაგებია"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"აი, საქაღალდე"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"ასეთის შესაქმნელად, შეეხეთ და დააყოვნეთ აპზე, ხოლო შემდეგ გადააჩოჩეთ შემდეგზე."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"კარგი"</string>
diff --git a/res/values-km-rKH/strings.xml b/res/values-km-rKH/strings.xml
index 2a7a782..bcd6060 100644
--- a/res/values-km-rKH/strings.xml
+++ b/res/values-km-rKH/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"សរសេរការកំណត់ និងផ្លូវកាត់លើអេក្រង់ដើម"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"អនុញ្ញាតឲ្យកម្មវិធីប្ដូរការកំណត់ និងផ្លូវកាត់ក្នុងអេក្រង់ដើម។"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"បញ្ហាក្នុងការផ្ទុកធាតុក្រាហ្វិក"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"រៀបចំ"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"នេះជាកម្មវិធីប្រព័ន្ធ មិនអាចលុបបានទេ។"</string>
<string name="dream_name" msgid="1530253749244328964">"កម្មវិធីចាប់ផ្ដើមរ៉ូកែត"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"ថតគ្មានឈ្មោះ"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ចាប់ផ្ដើមធ្វើឲ្យស្រស់"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"រៀបចំចន្លោះរបស់អ្នក"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"ប៉ះ & សង្កត់លើផ្ទៃខាងក្រោម ដើម្បីគ្រប់គ្រងផ្ទាំងរូបភាព, ធាតុក្រាហ្វិក និងការកំណត់។"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"ផ្ទាំងរូបភាព,ធាតុក្រាហ្វិក & ការកំណត់"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"ប៉ះ & សង្កត់ផ្ទៃខាងក្រោយដើម្បីប្ដូរតាមតម្រូវការ"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"យល់ហើយ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"នេះជាថត"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"ដើម្បីបង្កើតមួយដូចនេះ ប៉ះ & សង្កត់លើកម្មវិធី បន្ទាប់មកផ្លាស់ទីវាទៅលើធាតុមួយផ្សេងទៀត។"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"យល់ព្រម"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 392cfec..41c854e 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"홈 설정 및 바로가기 쓰기"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"앱이 홈에 있는 설정 및 바로가기를 변경할 수 있도록 합니다."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"위젯을 로드하는 중 문제가 발생했습니다."</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"설정"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"시스템 앱은 제거할 수 없습니다."</string>
<string name="dream_name" msgid="1530253749244328964">"로켓 실행기"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"이름이 없는 폴더"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"새로 시작"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"공간 관리하기"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"배경화면, 위젯, 설정을 관리하려면 백그라운드를 길게 터치합니다."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"배경화면, 위젯, 설정"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"백그라운드를 길게 터치하여 맞춤설정합니다."</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"확인"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"폴더"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"폴더를 만들려면 앱을 길게 터치한 다음 다른 앱 위에 올려 놓으세요."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"확인"</string>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 07d9279..1b34181 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -23,6 +23,4 @@
<dimen name="apps_customize_tab_bar_height">42dp</dimen>
<integer name="apps_customize_widget_cell_count_x">3</integer>
<integer name="apps_customize_widget_cell_count_y">2</integer>
- <integer name="apps_customize_cling_focused_x">2</integer>
- <integer name="apps_customize_cling_focused_y">1</integer>
</resources>
diff --git a/res/values-lo-rLA/strings.xml b/res/values-lo-rLA/strings.xml
index 185f4f8..1d953ff 100644
--- a/res/values-lo-rLA/strings.xml
+++ b/res/values-lo-rLA/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"ຂຽນການຕັ້ງຄ່າໜ້າຫຼັກ ແລະທາງລັດ"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"ອະນຸຍາດໃຫ້ແອັບຯດັ່ງກ່າວ ປ່ຽນການຕັ້ງຄ່າ ແລະທາງລັດໃນໜ້າຫຼັກ."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"ມີບັນຫາໃນການໂຫລດວິດເຈັດ"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"ຕິດຕັ້ງ"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"ນີ້ແມ່ນແອັບຯຂອງລະບົບ ແລະບໍ່ສາມາດຖອນການຕິດຕັ້ງອອກໄດ້."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"ໂຟນເດີຍັງບໍ່ຖືກຕັ້ງຊື່"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ເລີ່ມຕົ້ນໃໝ່"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"ຈັດການພື້ນທີ່ຂອງທ່ານ"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"ແຕະຄ້າງໄວ້ທີ່ພາບພື້ນຫຼັງເພື່ອຈັດການພາບພື້ນຫຼັງ, ວິດເຈັດແລະການຕັ້ງຄ່າ."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"ຮູບພື້ນຫຼັງ, ວິດເຈັດ, & ການຕັ້ງຄ່າ"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"ແຕະທີ່ພາບພື້ນຫລັງຄ້າງໄວ້ເພື່ອປັບແຕ່ງ"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ເຂົ້າໃຈແລ້ວ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"ນີ້ແມ່ນໂຟນເດີ"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"ເພື່ອສ້າງອັນໃໝ່ແບບນີ້ ໃຫ້ແຕະຄ້າງໄວ້ທີ່ແອັບຯທີ່ຕ້ອງການຍ້າຍແລ້ວລາກມັນໄປຫາໂຕອື່ນ."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"ຕົກລົງ"</string>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index 9acb910..f7db792 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"rašyti pagrindinio puslapio nustatymus ir sparčiuosius klavišus"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Programai leidžiama keisti pagrindinio puslapio nustatymus ir sparčiuosius klavišus."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema įkeliant valdiklį"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Sąranka"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Tai sistemos programa ir jos negalima pašalinti."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Aplankas be pavadinimo"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"PRADĖTI IŠ NAUJO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Tvarkykite savo vietą"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Palieskite ir laikykite foną, jei norite tvarkyti ekrano foną, valdiklius ir nustatymus."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Ekrano fonai, valdikliai ir nustatymai"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Jei norite tinkinti, palieskite ir palaikykite foną"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SUPRATAU"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Štai aplankas"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Kad sukurtumėte tokį patį, palieskite ir laikykite programą, tada perkelkite ją virš kitos programos."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Gerai"</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index b71a7df..75eb054 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"rakstīt sākuma ekrāna iestatījumus un saīsnes"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Ļauj lietotnei mainīt iestatījumus un saīsnes sākuma ekrānā."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Ielādējot logrīku, radās problēma."</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Notiek iestatīšana"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Šī ir sistēmas lietotne, un to nevar atinstalēt."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Mape bez nosaukuma"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"SĀKT NO SĀKUMA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Kārtojiet savu darbvietu"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Pieskarieties fonam un turiet to, lai pārvaldītu fona tapeti, logrīkus un iestatījumus."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Fona tapetes, logrīki un iestatījumi"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Lai pielāgotu, pieskarieties fonam un turiet to nospiestu."</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SAPRATU!"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Lūk, mape!"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Lai izveidotu tādu pašu, pieskarieties lietotnei un turiet to, pēc tam pārvietojiet to virs citas lietotnes."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Labi"</string>
diff --git a/res/values-mn-rMN/strings.xml b/res/values-mn-rMN/strings.xml
index 358cea3..34fb794 100644
--- a/res/values-mn-rMN/strings.xml
+++ b/res/values-mn-rMN/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"Нүүрний тохиргоо болон товчлолыг бичих"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Апп нь Нүүрэндэх товчлол болон тохиргоог өөрчилж чадна."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Виджет ачаалахад асуудал гарав"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Тохируулга"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Энэ апп нь системийн апп ба устгах боломжгүй."</string>
<string name="dream_name" msgid="1530253749244328964">"Пуужин хөөргөгч"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Нэргүй фолдер"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ШИНЭЭР ЭХЛЭХ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Өөрийнхөө зайг тохируулаарай"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Арын дэвсгэр дээр хүрээд & дарснаар ханын зураг, виджет болон тохиргоог өөрчилж болно."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Дэвсгэр зураг, виджет, & тохиргоо"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Тааруулахын тулд арын дэлгэцэнд хүрээд & барина уу"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"Ойлголоо"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Фолдер энд байна"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Үүнтэй адилханыг үүсгэхийн тулд апп дээр хүрч & бариад нөгөөхийн дээр зөөнө үү."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Тийм"</string>
diff --git a/res/values-ms-rMY/strings.xml b/res/values-ms-rMY/strings.xml
index 0c83d83..3c58762 100644
--- a/res/values-ms-rMY/strings.xml
+++ b/res/values-ms-rMY/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"tulis tetapan dan pintasan Laman Utama"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Membenarkan apl menukar tetapan dan pintasan di Laman Utama."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Masalah memuatkan widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Persediaan"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Ini ialah apl sistem dan tidak boleh dinyahpasang."</string>
<string name="dream_name" msgid="1530253749244328964">"Pelancar Roket"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Folder Tanpa Nama"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"MULAKAN YANG BAHARU"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Susun ruang anda"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Sentuh & tahan latar belakang untuk mengurus kertas dinding, widget dan tetapan."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Kertas dinding, widget & tetapan"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Sentuh & tahan latar belakang untuk memperibadikan"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"FAHAM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ini ada folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Untuk membuat satu folder seperti ini, sentuh & tahan apl, kemudian alihkan ke atas folder lain."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index f43eea7..ff8280e 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"angi startsideinnstillinger og -snarveier"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Lar appen endre innstillingene og snarveiene på startsiden."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem ved innlasting av modul"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Konfigurering"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Dette er en systemapp som ikke kan avinstalleres."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Mappe uten navn"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"START PÅ NYTT"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organiser plassen din"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Trykk og hold på bakgrunnen for å administrere bakgrunnen, moduler og innstillinger."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Bakgrunner, moduler og innstillinger"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Trykk og hold på bakgrunnen for å tilpasse den"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"SKJØNNER"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Dette er en mappe"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"For å opprette en som denne, trykker og holder du på en app og flytter den over en annen."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index a0add2f..470eb87 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"instellingen en snelkoppelingen op de startpagina schrijven"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"De app toestaan de instellingen en snelkoppelingen op de startpagina te wijzigen."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Probleem bij het laden van widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuratie"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Dit is een systeemapp die niet kan worden verwijderd."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Naamloze map"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"OPNIEUW BEGINNEN"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Uw ruimte indelen"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Blijf de achtergrond aanraken om de achtergrond, widgets en instellingen te beheren."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Achtergronden, widgets en instellingen"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Blijf de achtergrond aanraken om deze aan te passen"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Dit is een map"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Als u een map zoals deze wilt maken, blijft u een app aanraken en schuift u deze boven op een andere app."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 9d32b34..61a51e0 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"zapisywanie ustawień i skrótów na ekranie głównym"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Umożliwia aplikacji zmianę ustawień i skrótów na ekranie głównym."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problem podczas ładowania widżetu"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Konfiguracja"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"To aplikacja systemowa i nie można jej odinstalować."</string>
<string name="dream_name" msgid="1530253749244328964">"Wyrzutnia rakiet"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Folder bez nazwy"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ZACZNIJ OD NOWA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Uporządkuj obszar roboczy"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Kliknij i przytrzymaj tło, by zmienić tapetę, widżety lub ustawienia."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Tapety, widżety i ustawienia"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Kliknij i przytrzymaj tło, by dostosować"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Tu jest folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Aby utworzyć taki sam, kliknij i przytrzymaj aplikację, a następnie przenieś ją na następną."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
index 7753ab3..c20f57b 100644
--- a/res/values-port/dimens.xml
+++ b/res/values-port/dimens.xml
@@ -16,9 +16,6 @@
<resources>
<!-- AppsCustomize -->
- <integer name="apps_customize_cling_focused_x">1</integer>
- <integer name="apps_customize_cling_focused_y">1</integer>
-
<integer name="apps_customize_widget_cell_count_x">2</integer>
<integer name="apps_customize_widget_cell_count_y">3</integer>
</resources>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 4734def..2fe062a 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"escrever definições e atalhos do Ecrã principal"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permite à aplicação alterar as definições e os atalhos no Ecrã Principal."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema ao carregar o widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuração"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"É uma aplicação de sistema e não pode ser desinstalada."</string>
<string name="dream_name" msgid="1530253749244328964">"Lança-mísseis"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Pasta sem nome"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"COMEÇAR DO INÍCIO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizar o seu espaço"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Toque sem soltar no fundo para gerir a imagem de fundo, os widgets e as definições."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Imagens de fundo, widgets e definições"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Toque sem soltar no fundo para personalizar"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"COMPREENDI"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Eis uma pasta"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Para criar uma pasta, toque sem soltar numa aplicação e arraste-a para cima de outra aplicação."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index c1d8764..20b193a 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"gravar configurações e atalhos da tela inicial"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permite que o aplicativo altere as configurações e os atalhos na tela inicial."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema ao carregar o widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configuração"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Este é um aplicativo do sistema e não pode ser desinstalado."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Pasta sem nome"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"COMEÇAR DO ZERO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organize seu espaço"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Toque e mantenha pressionada a tela de fundo para gerenciar o plano de fundo, os widgets e as configurações."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Plano de fundo, widgets e configurações"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Toque e mantenha pressionado o segundo plano para personalizar"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ENTENDI"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Aqui está uma pasta"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Para criar uma pasta como esta, mantenha pressionado um aplicativo e mova-o para cima de outro."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Ok"</string>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 72180bf..04aebc8 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"scrie setări și comenzi rapide pentru ecranul de pornire"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Permite aplicației să modifice setările și comenzile rapide din ecranul de pornire."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problemă la încărcarea widgetului"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Configurați"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Aceasta este o aplicație de sistem și nu poate fi dezinstalată."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Dosar fără nume"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"REÎNCEPEȚI"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizați-vă spațiul"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Atingeți lung fundalul pentru a gestiona imaginea de fundal, widgeturile și setările."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Imagini de fundal, widgeturi și setări"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Atingeți lung fundalul pentru a-l personaliza"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"AM ÎNȚELES"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Iată un dosar"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Pentru a crea un dosar similar, atingeți și țineți degetul pe o aplicație, apoi mutați-o deasupra alteia."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 1ff78ff..b1d7713 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"Изменение настроек и ярлыков главного экрана"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Приложение сможет изменять настройки и ярлыки на главном экране."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Не удалось загрузить виджет"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Настройка"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Это системное приложение, его нельзя удалить."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Папка без названия"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ИСПОЛЬЗОВАТЬ СТАНДАРТНЫЙ МАКЕТ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Организация рабочего пространства"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Чтобы перейти к управлению обоями, виджетами и настройками, нажмите на фоновое изображение и удерживайте его."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Обои, виджеты и настройки"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Чтобы выполнить настройку, коснитесь фона и удерживайте его"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ОК"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Это папка"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Чтобы создать папку, нажмите и удерживайте значок приложения, а затем перетащите его на другой значок."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"ОК"</string>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index 80a61b7..a003679 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"zápis nastavení a odkazov plochy"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Povoľuje aplikácii zmeniť nastavenia a odkazy na ploche."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problém s načítaním miniaplikácií"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Nastavenie"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Toto je systémová aplikácia a nedá sa odinštalovať."</string>
<string name="dream_name" msgid="1530253749244328964">"Raketomet"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Nepomenovaný priečinok"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ZAČAŤ S PREDVOLENÝM ROZLOŽENÍM"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Usporiadajte svoj priestor"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Ak chcete spravovať tapetu, miniaplikácie a nastavenia, dotknite sa pozadia a podržte."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Pozadia, miniaplikácie a nastavenia"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Ak si chcete pozadie prispôsobiť, klepnite naň a podržte ho"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ROZUMIEM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Tu je priečinok"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Ak chcete vytvoriť takýto priečinok, dotknite sa príslušnej aplikácie a podržte ju. Potom ju presuňte na druhú aplikáciu."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 228876f..9c5bebd 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"zapis nastavitev in bližnjic na začetnem zaslonu"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Aplikaciji dovoli spreminjanje nastavitev in bližnjic na začetnem zaslonu."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Težava pri nalaganju pripomočka"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Nastavitev"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"To je sistemska aplikacija in je ni mogoče odstraniti."</string>
<string name="dream_name" msgid="1530253749244328964">"Raketno izstrelišče"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Neimenovana mapa"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"SVEŽ ZAČETEK"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organizirajte svoj prostor"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Če želite upravljati ozadje, pripomočke in nastavitve, se dotaknite ozadja in ga pridržite."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Ozadja, pripomočki in nastavitve"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Za prilagajanje se dotaknite ozadja in ga pridržite"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"V REDU"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"To je mapa"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Če želite ustvariti mapo, podobno tej, se dotaknite aplikacije in jo pridržite, nato pa jo premaknite nad drugo."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"V redu"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 4b8abfd..421f8d3 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"уписивање подешавања и пречица на почетном екрану"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Дозвољава апликацији да мења подешавања и пречице на почетном екрану."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Проблем при учитавању виџета"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Подешавање"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Ово је системска апликација и не може да се деинсталира."</string>
<string name="dream_name" msgid="1530253749244328964">"Лансер ракета"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Неименовани директоријум"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ПОЧНИТЕ ИСПОЧЕТКА"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Организујте простор"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Додирните позадину и задржите да бисте управљали позадином, виџетима и подешавањима."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Позадине, виџети и подешавања"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Додирните и задржите позадину да бисте прилагодили"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ВАЖИ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Ево једног директоријума"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Да бисте направили директоријум попут овога, додирните и задржите апликацију, па је превуците преко друге."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Потврди"</string>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index bdf2ca6..e149c9e 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"skriva inställningar och genvägar för startsidan"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Tillåter att appen ändrar inställningar och genvägar på startsidan."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Det gick inte att läsa in widgeten"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Konfiguration"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Det här är en systemapp som inte kan avinstalleras."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Namnlös mapp"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"BÖRJA OM"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Organisera ditt utrymme"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Tryck länge på bakgrunden om du vill hantera bakgrundsbilder, widgetar och inställningar."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Bakgrunder, widgetar och inställningar"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Tryck länge på bakgrunden om du vill anpassa den"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Det här är en mapp"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Skapa en till mapp av det här slaget genom att trycka och hålla ned en app och sedan dra den ovanpå en annan."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index 72764eb..07d0913 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"andika mipangilio ya skrini ya Mwanzo na njia za mkato"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Huruhusu programu kubadilisha mipangilio na njia za mkato katika skrini ya Mwanzo."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Tatizo la kupakia wijeti"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Sanidi"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Hii ni programu ya mfumo na haiwezi kuondolewa."</string>
<string name="dream_name" msgid="1530253749244328964">"Kizinduzi cha Roketi"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Folda isiyo na jina"</string>
@@ -98,6 +99,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ANZA UPYA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Panga nafasi yako"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Gusa na ushikilie mandharinyuma ili udhibiti mandhari, wijeti, na mipangilio."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Mandhari, wijeti, na mipangilio"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Gusa na ushikilie mandhari ili uweke mapendeleo"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"NIMEELEWA"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Hii ni folda"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Ili kuunda kama hii, gusa na ushikilie programu, kisha ipitishe juu ya nyingine."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"SAWA"</string>
diff --git a/res/values-sw340dp-land/dimens.xml b/res/values-sw340dp-land/dimens.xml
deleted file mode 100644
index 7901dc4..0000000
--- a/res/values-sw340dp-land/dimens.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 201 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>
-<!-- Clings -->
- <dimen name="folderClingMarginTop">50dp</dimen>
-</resources>
diff --git a/res/values-sw340dp-port/dimens.xml b/res/values-sw340dp-port/dimens.xml
deleted file mode 100644
index e360565..0000000
--- a/res/values-sw340dp-port/dimens.xml
+++ /dev/null
@@ -1,20 +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.
--->
-
-<resources>
-<!-- Clings -->
- <dimen name="folderClingMarginTop">70dp</dimen>
-</resources>
diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml
index 2ec2f14..15d5725 100644
--- a/res/values-sw600dp/config.xml
+++ b/res/values-sw600dp/config.xml
@@ -2,9 +2,6 @@
<bool name="is_tablet">true</bool>
<bool name="allow_rotation">true</bool>
- <!-- Whether or not to use custom clings if a custom workspace layout is passed in -->
- <bool name="config_useCustomClings">true</bool>
-
<!-- DragController -->
<integer name="config_flingToDeleteMinVelocity">-1000</integer>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 8d6c7f4..28679be 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -23,4 +23,13 @@
<dimen name="app_widget_preview_label_margin_top">8dp</dimen>
<dimen name="app_widget_preview_label_margin_left">@dimen/app_widget_preview_padding_left</dimen>
<dimen name="app_widget_preview_label_margin_right">@dimen/app_widget_preview_padding_right</dimen>
+
+<!-- Cling -->
+ <dimen name="cling_migration_logo_height">400dp</dimen>
+ <dimen name="cling_migration_logo_width">274dp</dimen>
+ <dimen name="cling_migration_bg_size">600dp</dimen>
+ <dimen name="cling_migration_bg_shift">-300dp</dimen>
+ <dimen name="cling_migration_content_margin">64dp</dimen>
+ <dimen name="cling_migration_content_width">280dp</dimen>
+
</resources>
diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml
index 433a5d4..ca13db0 100644
--- a/res/values-sw720dp-land/dimens.xml
+++ b/res/values-sw720dp-land/dimens.xml
@@ -18,15 +18,8 @@
<!-- AppsCustomize -->
<integer name="apps_customize_widget_cell_count_x">4</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>
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">100dip</dimen>
-
-<!-- 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-sw720dp-port/dimens.xml b/res/values-sw720dp-port/dimens.xml
index 9fe312b..6f594d5 100644
--- a/res/values-sw720dp-port/dimens.xml
+++ b/res/values-sw720dp-port/dimens.xml
@@ -19,12 +19,4 @@
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">40dp</dimen>
-
- <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>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 9ae155b..8be9964 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -25,4 +25,9 @@
the drag view should be offset from the position of the original view. -->
<dimen name="dragViewOffsetX">0dp</dimen>
<dimen name="dragViewOffsetY">0dp</dimen>
+
+<!-- Cling -->
+ <dimen name="cling_migration_content_margin">96dp</dimen>
+ <dimen name="cling_migration_content_width">320dp</dimen>
+
</resources>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index e00c551..beed898 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"เขียนการตั้งค่าและทางลัดหน้าแรกแล้ว"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"อนุญาตให้แอปเปลี่ยนการตั้งค่าและทางลัดในหน้าแรก"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"มีปัญหาขณะโหลดวิดเจ็ต"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"ตั้งค่า"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"นี่เป็นแอประบบและไม่สามารถถอนการติดตั้งได้"</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"โฟลเดอร์ที่ไม่มีชื่อ"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"เริ่มต้นใหม่"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"จัดระเบียบพื้นที่ของคุณ"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"แตะพื้นหลังค้างไว้เพื่อจัดการวอลเปเปอร์ วิดเจ็ต และการตั้งค่า"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"วอลเปเปอร์ วิดเจ็ต และการตั้งค่า"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"แตะพื้นหลังค้างไว้เพื่อกำหนดค่า"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"รับทราบ"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"นี่คือโฟลเดอร์"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"หากต้องการสร้างโฟลเดอร์ลักษณะนี้ แตะแอปค้างไว้ แล้วย้ายไปทับอีกแอปหนึ่ง"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"ตกลง"</string>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index 75b5ce1..7c6acd2 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"magsulat ng mga setting at shortcut ng Home"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Pinapayagan ang app na baguhin ang mga setting at shortcut sa Home."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Problema sa pag-load ng widget"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"I-setup"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Isa itong app ng system at hindi maaaring i-uninstall."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Walang Pangalang Folder"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"MAGSIMULA NANG BAGO"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Ayusin ang iyong espasyo"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Pindutin nang matagal ang background upang pamahalaan ang wallpaper, mga widget at setting"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Mga wallpaper, widget at setting"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Pindutin nang matagal ang background upang i-customize"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"NAKUHA KO"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Narito ang isang folder"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Upang gumawa ng katulad nito, pindutin nang matagal ang isang app, pagkatapos ay ilipat ito sa isa pang folder."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index d8ceb99..6c0bb69 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"Ana ekran ayarlarını ve kısayollarını yaz"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Uygulamaya, Ana ekrandaki ayarları ve kısayolları değiştirme izni verir."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Widget yüklenirken sorun oluştu"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Kurulum"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Bu bir sistem uygulamasıdır ve yüklemesi kaldırılamaz."</string>
<string name="dream_name" msgid="1530253749244328964">"Roket Fırlatıcı"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Adsız Klasör"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"VARSAYILANI KULLAN"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Alanınızı düzenleyin"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Duvar kağıdını, widget\'ları ve ayarları yönetmek için arka plana uzun basın."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Duvar kağıtları, widget\'lar ve ayarlar"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Özelleştirmek için arka plana dokunun ve basılı tutun"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"TAMAM"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"İşte bir klasör"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Buna benzer bir klasör oluşturmak için uygulamaya uzun basın ve sonra uygulamayı başka bir uygulamanın üzerine taşıyın."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"Tamam"</string>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 197b201..52f3761 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"записувати налаштування та ярлики головного екрана"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Дозволяє програмі змінювати налаштування та ярлики на головному екрані."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Проблема із завантаженням віджета"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Налаштування"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Це системна програма, її неможливо видалити."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Папка без назви"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"ПАНЕЛЬ ЗАПУСКУ ЗА УМОВЧАННЯМ"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Організуйте робочий простір"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Натисніть і утримуйте фон, щоб керувати фоновим малюнком, віджетами та налаштуваннями."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Фонові малюнки, віджети й налаштування"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Натисніть і втримуйте фон, щоб налаштувати робочу область"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"ЗРОЗУМІЛО"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Це папка"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Щоб створити папку, натисніть і утримуйте програму, а потім перетягніть її на іншу."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OК"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 164a2c7..4891230 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"ghi cài đặt và lối tắt trên Màn hình chính"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Cho phép ứng dụng thay đổi cài đặt và lối tắt trên Màn hình chính."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Sự cố khi tải tiện ích con"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Thiết lập"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Đây là ứng dụng hệ thống và không thể gỡ cài đặt."</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Thư mục chưa đặt tên"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"BẮT ĐẦU LÀM MỚI"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Sắp xếp không gian của bạn"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Chạm và giữ nền để quản lý hình nền, tiện ích con và cài đặt."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Hình nền, tiện ích và cài đặt"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Chạm và giữ nền để tùy chỉnh"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"OK"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Đây là một thư mục"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Để tạo thư mục như thế này, hãy chạm và giữ một ứng dụng, sau đó di chuyển ứng dụng đó lên trên một ứng dụng khác."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"OK"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index c29cfb0..3365581 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"写入主屏幕设置和快捷方式"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"允许应用更改主屏幕中的设置和快捷方式。"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"加载小部件时出现问题"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"设置"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"这是系统应用,无法卸载。"</string>
<string name="dream_name" msgid="1530253749244328964">"火箭发射器"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"未命名文件夹"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"使用全新配置"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"整理您的空间"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"触摸并按住背景,即可管理壁纸、小部件和设置。"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"壁纸、小部件和设置"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"触摸并按住背景,即可进行个性化设置"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"这是一个文件夹"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"要创建一个类似的文件夹,请触摸并按住某个应用,然后将其移至另一个应用上。"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"确定"</string>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index 254a070..e1c2063 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"寫入主畫面的設定和捷徑"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"允許應用程式更改主畫面中的設定和捷徑。"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"載入小工具時發生問題"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"設定"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"這是系統應用程式,無法將其解除安裝。"</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"未命名的資料夾"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"重新開始"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"管理您的空間"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"輕觸並按住背景,即可管理桌布、小工具和設定。"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"桌布、小工具和設定"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"輕觸並按住背景即可自訂"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"資料夾顯示如下"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"如要建立類似的資料夾,請輕觸並按住某個應用程式,然後疊到另一個應用程式之上。"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"確定"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index e017ae2..2d40059 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"寫入主螢幕設定和捷徑"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"允許應用程式變更主螢幕中的設定和捷徑。"</string>
<string name="gadget_error_text" msgid="6081085226050792095">"載入小工具時發生問題"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"設定"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"這是系統應用程式,不可解除安裝。"</string>
<string name="dream_name" msgid="1530253749244328964">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"未命名的資料夾"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"重新開始"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"管理您的空間"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"輕觸並按住背景,即可管理桌布、小工具和設定。"</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"桌布、小工具和設定"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"輕觸並按住背景即可自訂"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"資料夾顯示如下"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"如要建立類似的資料夾,請輕觸並按住應用程式,然後將應用程式疊放在另一個應用程式上。"</string>
<string name="cling_dismiss" msgid="8962359497601507581">"確定"</string>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index d3d2fbb..89cd5cc 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -77,6 +77,7 @@
<string name="permlab_write_settings" msgid="3574213698004620587">"bhala izilungiselelo zokuthi Ikhaya nezinqamuleli"</string>
<string name="permdesc_write_settings" msgid="5440712911516509985">"Ivumela uhlelo lokusebenza ukuthi lushintshe izilungiselelo nezinqamuleli Ekhaya."</string>
<string name="gadget_error_text" msgid="6081085226050792095">"Inkinga yokulayisha iwijethi"</string>
+ <string name="gadget_setup_text" msgid="8274003207686040488">"Ukumisa"</string>
<string name="uninstall_system_app_text" msgid="4172046090762920660">"Lolu uhlelo lokusebenza lwesistimu futhi alikwazi ukukhishwa."</string>
<string name="dream_name" msgid="1530253749244328964">"Isiqalisi se-Rocket"</string>
<string name="folder_hint_text" msgid="6617836969016293992">"Ifolda engenagama"</string>
@@ -96,6 +97,9 @@
<string name="migration_cling_use_default" msgid="2626475813981258626">"QALISA KABUSHA"</string>
<string name="workspace_cling_title" msgid="5626202359865825661">"Hlela isikhala sakho"</string>
<string name="workspace_cling_move_item" msgid="528201129978005352">"Thinta uphinde ubambe okungemuva ukuze uphathe isithombe sangemuva, amawijethi nezilungiselelo."</string>
+ <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"Izithombe zangemuva, amawijethi, nezilungiselelo"</string>
+ <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"Thinta uphinde ubambe ingemuva ukuze wenze ngokwezifiso"</string>
+ <string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"NGIYITHOLILE"</string>
<string name="folder_cling_title" msgid="3894908818693254164">"Nayi ifolda"</string>
<string name="folder_cling_create_folder" msgid="6158215559475836131">"Ukuze udale eyodwa efana nale, thinta uphinde ubambe uhlelo lokusebenza, bese ulidlulisa ngaphezulu kwelinye."</string>
<string name="cling_dismiss" msgid="8962359497601507581">"KULUNGILE"</string>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 552e84c..65f8f22 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -25,17 +25,8 @@
<attr name="sourceViewId" format="integer" />
</declare-styleable>
- <!-- Cling specific attributes. These attributes are used to customize
- the cling in XML files. -->
- <declare-styleable name="Cling">
- <!-- Used to identify how to draw the cling bg -->
- <attr name="drawIdentifier" format="string" />
- </declare-styleable>
-
- <!-- Page Indicator specific attributes. These attributes are used to customize
- the cling in XML files. -->
+ <!-- Page Indicator specific attributes. -->
<declare-styleable name="PageIndicator">
- <!-- Used to identify how to draw the cling bg -->
<attr name="windowSize" format="integer" />
</declare-styleable>
@@ -106,7 +97,6 @@
<declare-styleable name="BubbleTextView">
<!-- A spacing override for the icons within a page -->
<attr name="customShadows" format="boolean" />
- <attr name="glowColor" format="color" />
</declare-styleable>
<!-- AppsCustomizePagedView specific attributes. These attributes are used to
@@ -124,10 +114,6 @@
<attr name="widgetCountX" format="integer" />
<!-- Number of widgets vertically -->
<attr name="widgetCountY" format="integer" />
- <!-- The x index of the item to be focused in the cling -->
- <attr name="clingFocusedX" format="integer" />
- <!-- The y index of the item to be focused in the cling -->
- <attr name="clingFocusedY" format="integer" />
</declare-styleable>
<!-- XML attributes used by default_workspace.xml -->
@@ -157,10 +143,4 @@
<attr name="ringOutset" format="dimension" />
<attr name="indicatorSize" format="dimension" />
</declare-styleable>
-
- <!-- Only used in the device overlays -->
- <declare-styleable name="CustomClingTitleText">
- </declare-styleable>
- <declare-styleable name="CustomClingText">
- </declare-styleable>
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 5e9c6ec..29837ea 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -22,6 +22,7 @@
over the delete target or the info target -->
<color name="delete_target_hover_tint">#DAFF0000</color>
<color name="info_target_hover_tint">#DA0099CC</color>
+ <color name="cling_scrim_background">#80000000</color>
<color name="bubble_dark_background">#20000000</color>
<color name="focused_background">#80c6c5c5</color>
@@ -34,9 +35,7 @@
<color name="quantum_panel_text_color">#FF666666</color>
<color name="quantum_panel_text_shadow_color">#FFC4C4C4</color>
- <color name="folder_items_glow_color">#FFCCCCCC</color>
<color name="outline_color">#FFFFFFFF</color>
<color name="widget_text_panel">#FF374248</color>
- <color name="first_run_cling_circle_background_color">#64b1ea</color>
</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 19ae44c..96bd13b 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -93,9 +93,6 @@
<!-- Camera distance for the overscroll effect -->
<integer name="config_cameraDistance">8000</integer>
- <!-- Whether or not to use custom clings if a custom workspace layout is passed in -->
- <bool name="config_useCustomClings">false</bool>
-
<!-- Hotseat -->
<bool name="hotseat_transpose_layout_with_orientation">true</bool>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 893d7c0..2c9e689 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -29,21 +29,12 @@
<dimen name="dynamic_grid_overview_bar_spacer_width">68dp</dimen>
<!-- 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>
- <!-- entries for custom clings, will be set in overlays -->
- <add-resource type="dimen" name="custom_cling_margin_top" />
- <add-resource type="dimen" name="custom_cling_margin_right" />
- <add-resource type="dimen" name="custom_cling_margin_left" />
-
- <dimen name="cling_title_text_size">20sp</dimen>
- <dimen name="cling_text_size">14sp</dimen>
- <dimen name="cling_alt_title_text_size">24sp</dimen>
- <dimen name="cling_alt_text_size">16sp</dimen>
- <dimen name="cling_hint_text_size">14sp</dimen>
+ <dimen name="cling_migration_logo_height">240dp</dimen>
+ <dimen name="cling_migration_logo_width">165dp</dimen>
+ <dimen name="cling_migration_bg_size">400dp</dimen>
+ <dimen name="cling_migration_bg_shift">-200dp</dimen>
+ <dimen name="cling_migration_content_margin">16dp</dimen>
+ <dimen name="cling_migration_content_width">280dp</dimen>
<!-- Workspace -->
<dimen name="workspace_max_gap">16dp</dimen>
@@ -101,4 +92,8 @@
<!-- The amount that the preview contents are inset from the preview background -->
<dimen name="folder_preview_padding">4dp</dimen>
<dimen name="folder_name_padding">10dp</dimen>
+
+<!-- Sizes for managed profile badges -->
+ <dimen name="profile_badge_size">24dp</dimen>
+ <dimen name="profile_badge_margin">4dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index aa5f7b6..ff3509b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -243,6 +243,12 @@
<string name="workspace_cling_title">Organize your space</string>
<!-- The description of how to use the workspace [CHAR_LIMIT=70] -->
<string name="workspace_cling_move_item">Touch & hold background to manage wallpaper, widgets and settings.</string>
+ <!-- The title text for workspace longpress action [CHAR_LIMIT=40] -->
+ <string name="workspace_cling_longpress_title">Wallpapers, widgets, & settings</string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=70] -->
+ <string name="workspace_cling_longpress_description">Touch & hold background to customize</string>
+ <!-- The description of the button to dismiss the cling [CHAR_LIMIT=30] -->
+ <string name="workspace_cling_longpress_dismiss">GOT IT</string>
<!-- The title text for the Folder cling [CHAR_LIMIT=30] -->
<string name="folder_cling_title">Here\'s a folder</string>
<!-- The description of how to create a folder [CHAR_LIMIT=70] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 6079eee..56a205f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -18,53 +18,6 @@
-->
<resources>
- <style name="ClingButton">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:paddingTop">15dp</item>
- <item name="android:paddingBottom">15dp</item>
- <item name="android:paddingLeft">50dp</item>
- <item name="android:paddingRight">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">@dimen/cling_title_text_size</item>
- <item name="android:textColor">#ffffff</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">@dimen/cling_text_size</item>
- <item name="android:textColor">#80000000</item>
- <item name="android:lineSpacingMultiplier">1.1</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">@dimen/cling_alt_title_text_size</item>
- <item name="android:textColor">#49C0EC</item>
- </style>
- <style name="ClingAltText">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:textSize">@dimen/cling_alt_text_size</item>
- <item name="android:textColor">#49C0EC</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">@dimen/cling_hint_text_size</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>
@@ -88,22 +41,15 @@
<item name="android:background">@null</item>
<item name="android:textColor">@color/quantum_panel_text_color</item>
<item name="android:drawablePadding">@dimen/dynamic_grid_icon_drawable_padding</item>
- <item name="android:shadowRadius">2.0</item>
- <item name="android:shadowDx">0</item>
- <item name="android:shadowDy">2</item>
- <item name="android:shadowColor">#FFC4C4C4</item>
+ <item name="android:shadowRadius">0</item>
+ <item name="customShadows">false</item>
</style>
<style name="WorkspaceIcon.Folder">
<item name="android:background">@null</item>
<item name="android:textColor">@color/quantum_panel_text_color</item>
- <item name="android:shadowColor">@color/quantum_panel_text_shadow_color</item>
- <item name="android:shadowRadius">2.0</item>
- <item name="android:shadowDx">0</item>
- <item name="android:shadowDy">2</item>
-
+ <item name="android:shadowRadius">0</item>
<item name="customShadows">false</item>
- <item name="glowColor">@color/folder_items_glow_color</item>
</style>
<style name="SearchDropTargetBar">
@@ -174,10 +120,6 @@
</style>
<!-- Overridden in device overlays -->
- <style name="CustomClingTitleText">
- </style>
- <style name="CustomClingText">
- </style>
<style name="PagedViewWidgetImageView">
<item name="android:paddingLeft">@dimen/app_widget_preview_padding_left</item>
</style>
diff --git a/src/com/android/launcher3/AppsCustomizeCellLayout.java b/src/com/android/launcher3/AppsCustomizeCellLayout.java
index 76b81d2..a50fb68 100644
--- a/src/com/android/launcher3/AppsCustomizeCellLayout.java
+++ b/src/com/android/launcher3/AppsCustomizeCellLayout.java
@@ -68,4 +68,4 @@
children.getChildAt(j).setOnKeyListener(null);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index b2228f7..1bd2907 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -28,7 +28,6 @@
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
-import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@@ -44,12 +43,12 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
-import android.view.animation.DecelerateInterpolator;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.Toast;
import com.android.launcher3.DropTarget.DragObject;
+import com.android.launcher3.compat.AppWidgetManagerCompat;
import java.util.ArrayList;
import java.util.Collections;
@@ -144,8 +143,7 @@
*/
public class AppsCustomizePagedView extends PagedViewWithDraggableItems implements
View.OnClickListener, View.OnKeyListener, DragSource,
- PagedViewIcon.PressedCallback, PagedViewWidget.ShortPressListener,
- LauncherTransitionable {
+ PagedViewWidget.ShortPressListener, LauncherTransitionable {
static final String TAG = "AppsCustomizePagedView";
private static Rect sTmpRect = new Rect();
@@ -167,19 +165,12 @@
// Save and Restore
private int mSaveInstanceStateItemIndex = -1;
- private PagedViewIcon mPressedIcon;
// Content
private ArrayList<AppInfo> mApps;
private ArrayList<Object> mWidgets;
- // Cling
- private boolean mHasShownAllAppsCling;
- private int mClingFocusedX;
- private int mClingFocusedY;
-
// Caching
- private Canvas mCanvas;
private IconCache mIconCache;
// Dimens
@@ -227,17 +218,12 @@
mApps = new ArrayList<AppInfo>();
mWidgets = new ArrayList<Object>();
mIconCache = (LauncherAppState.getInstance()).getIconCache();
- mCanvas = new Canvas();
mRunningTasks = new ArrayList<AppsCustomizeAsyncTask>();
// Save the default widget preview background
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0);
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
mWidgetCountX = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountX, 2);
mWidgetCountY = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountY, 2);
- mClingFocusedX = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedX, 0);
- mClingFocusedY = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedY, 0);
a.recycle();
mWidgetSpacingLayout = new PagedViewCellLayout(getContext());
@@ -376,8 +362,20 @@
if (!isDataReady()) {
if ((LauncherAppState.isDisableAllApps() || !mApps.isEmpty()) && !mWidgets.isEmpty()) {
- setDataIsReady();
- onDataReady(getMeasuredWidth(), getMeasuredHeight());
+ post(new Runnable() {
+ // This code triggers requestLayout so must be posted outside of the
+ // layout pass.
+ public void run() {
+ boolean attached = true;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ attached = isAttachedToWindow();
+ }
+ if (attached) {
+ setDataIsReady();
+ onDataReady(getMeasuredWidth(), getMeasuredHeight());
+ }
+ }
+ });
}
}
}
@@ -394,7 +392,6 @@
if (!app.shouldShowAppOrWidgetProvider(widget.provider)) {
continue;
}
- widget.label = widget.label.trim();
if (widget.minWidth > 0 && widget.minHeight > 0) {
// Ensure that all widgets we show can be added on a workspace of this size
int[] spanXY = Launcher.getSpanForWidget(mLauncher, widget);
@@ -444,39 +441,29 @@
@Override
public void onClick(View v) {
// When we have exited all apps or are in transition, disregard clicks
- if (!mLauncher.isAllAppsVisible() ||
- mLauncher.getWorkspace().isSwitchingState()) return;
+ if (!mLauncher.isAllAppsVisible()
+ || mLauncher.getWorkspace().isSwitchingState()
+ || !(v instanceof PagedViewWidget)) return;
- if (v instanceof PagedViewIcon) {
- // Animate some feedback to the click
- final AppInfo appInfo = (AppInfo) v.getTag();
-
- // Lock the drawable state to pressed until we return to Launcher
- if (mPressedIcon != null) {
- mPressedIcon.lockDrawableState();
- }
- mLauncher.onClickPagedViewIcon(v, appInfo);
- } else if (v instanceof PagedViewWidget) {
- // Let the user know that they have to long press to add a widget
- if (mWidgetInstructionToast != null) {
- mWidgetInstructionToast.cancel();
- }
- mWidgetInstructionToast = Toast.makeText(getContext(),R.string.long_press_widget_to_add,
- Toast.LENGTH_SHORT);
- mWidgetInstructionToast.show();
-
- // Create a little animation to show that the widget can move
- float offsetY = getResources().getDimensionPixelSize(R.dimen.dragViewOffsetY);
- final ImageView p = (ImageView) v.findViewById(R.id.widget_preview);
- AnimatorSet bounce = LauncherAnimUtils.createAnimatorSet();
- ValueAnimator tyuAnim = LauncherAnimUtils.ofFloat(p, "translationY", offsetY);
- tyuAnim.setDuration(125);
- ValueAnimator tydAnim = LauncherAnimUtils.ofFloat(p, "translationY", 0f);
- tydAnim.setDuration(100);
- bounce.play(tyuAnim).before(tydAnim);
- bounce.setInterpolator(new AccelerateInterpolator());
- bounce.start();
+ // Let the user know that they have to long press to add a widget
+ if (mWidgetInstructionToast != null) {
+ mWidgetInstructionToast.cancel();
}
+ mWidgetInstructionToast = Toast.makeText(getContext(),R.string.long_press_widget_to_add,
+ Toast.LENGTH_SHORT);
+ mWidgetInstructionToast.show();
+
+ // Create a little animation to show that the widget can move
+ float offsetY = getResources().getDimensionPixelSize(R.dimen.dragViewOffsetY);
+ final ImageView p = (ImageView) v.findViewById(R.id.widget_preview);
+ AnimatorSet bounce = LauncherAnimUtils.createAnimatorSet();
+ ValueAnimator tyuAnim = LauncherAnimUtils.ofFloat(p, "translationY", offsetY);
+ tyuAnim.setDuration(125);
+ ValueAnimator tydAnim = LauncherAnimUtils.ofFloat(p, "translationY", 0f);
+ tydAnim.setDuration(100);
+ bounce.play(tyuAnim).before(tydAnim);
+ bounce.setInterpolator(new AccelerateInterpolator());
+ bounce.start();
}
public boolean onKey(View v, int keyCode, KeyEvent event) {
@@ -492,7 +479,6 @@
}
private void beginDraggingApplication(View v) {
- mLauncher.getWorkspace().onDragStartedWithItem(v);
mLauncher.getWorkspace().beginDragShared(v, this);
}
@@ -534,18 +520,9 @@
@Override
public void run() {
mWidgetLoadingId = mLauncher.getAppWidgetHost().allocateAppWidgetId();
- // Options will be null for platforms with JB or lower, so this serves as an
- // SDK level check.
- if (options == null) {
- if (AppWidgetManager.getInstance(mLauncher).bindAppWidgetIdIfAllowed(
- mWidgetLoadingId, info.componentName)) {
- mWidgetCleanupState = WIDGET_BOUND;
- }
- } else {
- if (AppWidgetManager.getInstance(mLauncher).bindAppWidgetIdIfAllowed(
- mWidgetLoadingId, info.componentName, options)) {
- mWidgetCleanupState = WIDGET_BOUND;
- }
+ if(AppWidgetManagerCompat.getInstance(mLauncher).bindAppWidgetIdIfAllowed(
+ mWidgetLoadingId, pInfo, options)) {
+ mWidgetCleanupState = WIDGET_BOUND;
}
}
};
@@ -673,9 +650,8 @@
int[] previewSizeBeforeScale = new int[1];
- preview = getWidgetPreviewLoader().generateWidgetPreview(createWidgetInfo.componentName,
- createWidgetInfo.previewImage, createWidgetInfo.icon, spanX, spanY,
- maxWidth, maxHeight, null, previewSizeBeforeScale);
+ preview = getWidgetPreviewLoader().generateWidgetPreview(createWidgetInfo.info,
+ spanX, spanY, maxWidth, maxHeight, null, previewSizeBeforeScale);
// Compare the size of the drag preview to the preview in the AppsCustomize tray
int previewWidthInAppsCustomize = Math.min(previewSizeBeforeScale[0],
@@ -692,15 +668,7 @@
} else {
PendingAddShortcutInfo createShortcutInfo = (PendingAddShortcutInfo) v.getTag();
Drawable icon = mIconCache.getFullResIcon(createShortcutInfo.shortcutActivityInfo);
- preview = Bitmap.createBitmap(icon.getIntrinsicWidth(),
- icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
-
- mCanvas.setBitmap(preview);
- mCanvas.save();
- WidgetPreviewLoader.renderDrawableToBitmap(icon, preview, 0, 0,
- icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
- mCanvas.restore();
- mCanvas.setBitmap(null);
+ preview = Utilities.createIconBitmap(icon, mLauncher);
createItemInfo.spanX = createItemInfo.spanY = 1;
}
@@ -726,7 +694,7 @@
protected boolean beginDragging(final View v) {
if (!super.beginDragging(v)) return false;
- if (v instanceof PagedViewIcon) {
+ if (v instanceof BubbleTextView) {
beginDraggingApplication(v);
} else if (v instanceof PagedViewWidget) {
if (!beginDraggingWidget(v)) {
@@ -741,9 +709,6 @@
public void run() {
// We don't enter spring-loaded mode if the drag has been cancelled
if (mLauncher.getDragController().isDragging()) {
- // Reset the alpha on the dragged icon before we drag
- resetDrawableState();
-
// Go into spring loaded mode (must happen before we startDrag())
mLauncher.enterSpringLoadedDragMode();
}
@@ -992,10 +957,10 @@
ArrayList<Bitmap> images = new ArrayList<Bitmap>();
for (int i = startIndex; i < endIndex; ++i) {
AppInfo info = mApps.get(i);
- PagedViewIcon icon = (PagedViewIcon) mLayoutInflater.inflate(
+ BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate(
R.layout.apps_customize_application, layout, false);
- icon.applyFromApplicationInfo(info, true, this);
- icon.setOnClickListener(this);
+ icon.applyFromApplicationInfo(info);
+ icon.setOnClickListener(mLauncher);
icon.setOnLongClickListener(this);
icon.setOnTouchListener(this);
icon.setOnKeyListener(this);
@@ -1559,23 +1524,6 @@
cancelAllTasks();
}
- @Override
- public void iconPressed(PagedViewIcon icon) {
- // Reset the previously pressed icon and store a reference to the pressed icon so that
- // we can reset it on return to Launcher (in Launcher.onResume())
- if (mPressedIcon != null) {
- mPressedIcon.resetDrawableState();
- }
- mPressedIcon = icon;
- }
-
- public void resetDrawableState() {
- if (mPressedIcon != null) {
- mPressedIcon.resetDrawableState();
- mPressedIcon = null;
- }
- }
-
/*
* We load an extra page on each side to prevent flashes from scrolling and loading of the
* widget previews in the background with the AsyncTasks.
diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java
index 4ea7b3d..00f0cf3 100644
--- a/src/com/android/launcher3/AutoInstallsLayout.java
+++ b/src/com/android/launcher3/AutoInstallsLayout.java
@@ -57,7 +57,7 @@
/** Marker action used to discover a package which defines launcher customization */
static final String ACTION_LAUNCHER_CUSTOMIZATION =
- "com.android.launcher3.action.LAUNCHER_CUSTOMIZATION";
+ "android.autoinstalls.config.action.PLAY_AUTO_INSTALL";
private static final String LAYOUT_RES = "default_layout";
@@ -298,7 +298,7 @@
return -1;
}
- mValues.put(Favorites.RESTORED, 1);
+ mValues.put(Favorites.RESTORED, ShortcutInfo.FLAG_AUTOINTALL_ICON);
final Intent intent = new Intent(Intent.ACTION_MAIN, null)
.addCategory(Intent.CATEGORY_LAUNCHER)
.setComponent(new ComponentName(packageName, className))
diff --git a/src/com/android/launcher3/BorderCropDrawable.java b/src/com/android/launcher3/BorderCropDrawable.java
new file mode 100644
index 0000000..caf497d
--- /dev/null
+++ b/src/com/android/launcher3/BorderCropDrawable.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+
+public class BorderCropDrawable extends Drawable {
+
+ private final Drawable mChild;
+ private final Rect mBoundsShift;
+ private final Rect mPadding;
+
+ BorderCropDrawable(Drawable child, boolean cropLeft,
+ boolean cropTop, boolean cropRight, boolean cropBottom) {
+ mChild = child;
+
+ mBoundsShift = new Rect();
+ mPadding = new Rect();
+ mChild.getPadding(mPadding);
+
+ if (cropLeft) {
+ mBoundsShift.left = -mPadding.left;
+ mPadding.left = 0;
+ }
+ if (cropTop) {
+ mBoundsShift.top = -mPadding.top;
+ mPadding.top = 0;
+ }
+ if (cropRight) {
+ mBoundsShift.right = mPadding.right;
+ mPadding.right = 0;
+ }
+ if (cropBottom) {
+ mBoundsShift.bottom = mPadding.bottom;
+ mPadding.bottom = 0;
+ }
+ }
+
+ @Override
+ protected void onBoundsChange(Rect bounds) {
+ mChild.setBounds(
+ bounds.left + mBoundsShift.left,
+ bounds.top + mBoundsShift.top,
+ bounds.right + mBoundsShift.right,
+ bounds.bottom + mBoundsShift.bottom);
+ }
+
+ @Override
+ public boolean getPadding(Rect padding) {
+ padding.set(mPadding);
+ return (padding.left | padding.top | padding.right | padding.bottom) != 0;
+ }
+
+ @Override
+ public void draw(Canvas canvas) {
+ mChild.draw(canvas);
+ }
+
+ @Override
+ public int getOpacity() {
+ return mChild.getOpacity();
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ mChild.setAlpha(alpha);
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ mChild.setColorFilter(cf);
+ }
+}
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 5c2bb99..a368796 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -23,14 +23,12 @@
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Rect;
import android.graphics.Region;
-import android.graphics.Region.Op;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.Log;
import android.util.SparseArray;
import android.util.TypedValue;
+import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.widget.TextView;
@@ -44,27 +42,15 @@
private static SparseArray<Theme> sPreloaderThemes = new SparseArray<>(2);
- static final float SHADOW_LARGE_RADIUS = 4.0f;
- static final float SHADOW_SMALL_RADIUS = 1.75f;
- static final float SHADOW_Y_OFFSET = 2.0f;
- static final int SHADOW_LARGE_COLOUR = 0xDD000000;
- static final int SHADOW_SMALL_COLOUR = 0xCC000000;
- static final float PADDING_H = 8.0f;
+ private static final float SHADOW_LARGE_RADIUS = 4.0f;
+ private static final float SHADOW_SMALL_RADIUS = 1.75f;
+ private static final float SHADOW_Y_OFFSET = 2.0f;
+ private static final int SHADOW_LARGE_COLOUR = 0xDD000000;
+ private static final int SHADOW_SMALL_COLOUR = 0xCC000000;
static final float PADDING_V = 3.0f;
- private static final String TAG = "BubbleTextView";
-
- private static final boolean DEBUG = false;
-
private HolographicOutlineHelper mOutlineHelper;
- private final Canvas mTempCanvas = new Canvas();
- private final Rect mTempRect = new Rect();
- private boolean mDidInvalidateForPressedState;
- private Bitmap mPressedOrFocusedBackground;
- private int mFocusedOutlineColor;
- private int mFocusedGlowColor;
- private int mPressedOutlineColor;
- private int mPressedGlowColor;
+ private Bitmap mPressedBackground;
private float mSlop;
@@ -72,14 +58,15 @@
private final boolean mCustomShadowsEnabled;
private boolean mIsTextVisible;
+ // TODO: Remove custom background handling code, as no instance of BubbleTextView use any
+ // background.
private boolean mBackgroundSizeChanged;
private final Drawable mBackground;
private boolean mStayPressed;
+ private boolean mIgnorePressedStateChange;
private CheckLongPressHelper mLongPressHelper;
- private CharSequence mDefaultText = "";
-
public BubbleTextView(Context context) {
this(context, null, 0);
}
@@ -91,11 +78,8 @@
public BubbleTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- Resources res = context.getResources();
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.BubbleTextView, defStyle, 0);
- setGlowColor(a.getColor(R.styleable.BubbleTextView_glowColor,
- res.getColor(R.color.outline_color)));
mCustomShadowsEnabled = a.getBoolean(R.styleable.BubbleTextView_customShadows, true);
a.recycle();
@@ -129,6 +113,11 @@
public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache,
boolean setDefaultPadding) {
+ applyFromShortcutInfo(info, iconCache, setDefaultPadding, false);
+ }
+
+ public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache,
+ boolean setDefaultPadding, boolean promiseStateChanged) {
Bitmap b = info.getIcon(iconCache);
LauncherAppState app = LauncherAppState.getInstance();
@@ -143,13 +132,30 @@
if (info.contentDescription != null) {
setContentDescription(info.contentDescription);
}
+ setText(info.title);
setTag(info);
- if (info.wasPromise) {
- applyState();
+ if (promiseStateChanged || info.isPromise()) {
+ applyState(promiseStateChanged);
}
}
+ public void applyFromApplicationInfo(AppInfo info) {
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
+ Drawable topDrawable = Utilities.createIconDrawable(info.iconBitmap);
+ topDrawable.setBounds(0, 0, grid.allAppsIconSizePx, grid.allAppsIconSizePx);
+ setCompoundDrawables(null, topDrawable, null, null);
+ setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
+ setText(info.title);
+ if (info.contentDescription != null) {
+ setContentDescription(info.contentDescription);
+ }
+ setTag(info);
+ }
+
+
@Override
protected boolean setFrame(int left, int top, int right, int bottom) {
if (getLeft() != left || getRight() != right || getTop() != top || getBottom() != bottom) {
@@ -169,98 +175,22 @@
LauncherModel.checkItemInfo((ItemInfo) tag);
}
super.setTag(tag);
- if (tag instanceof ShortcutInfo) {
- final ShortcutInfo info = (ShortcutInfo) tag;
- mDefaultText = info.title;
- setText(mDefaultText);
- }
}
@Override
- protected void drawableStateChanged() {
- if (isPressed()) {
- // In this case, we have already created the pressed outline on ACTION_DOWN,
- // so we just need to do an invalidate to trigger draw
- if (!mDidInvalidateForPressedState) {
- setCellLayoutPressedOrFocusedIcon();
- }
- } else {
- // Otherwise, either clear the pressed/focused background, or create a background
- // for the focused state
- final boolean backgroundEmptyBefore = mPressedOrFocusedBackground == null;
- if (!mStayPressed) {
- mPressedOrFocusedBackground = null;
- }
- if (isFocused()) {
- if (getLayout() == null) {
- // In some cases, we get focus before we have been layed out. Set the
- // background to null so that it will get created when the view is drawn.
- mPressedOrFocusedBackground = null;
- } else {
- mPressedOrFocusedBackground = createGlowingOutline(
- mTempCanvas, mFocusedGlowColor, mFocusedOutlineColor);
- }
- mStayPressed = false;
- setCellLayoutPressedOrFocusedIcon();
- }
- final boolean backgroundEmptyNow = mPressedOrFocusedBackground == null;
- if (!backgroundEmptyBefore && backgroundEmptyNow) {
- setCellLayoutPressedOrFocusedIcon();
- }
+ public void setPressed(boolean pressed) {
+ super.setPressed(pressed);
+
+ if (!mIgnorePressedStateChange) {
+ updateIconState();
}
+ }
- Drawable d = mBackground;
- if (d != null && d.isStateful()) {
- d.setState(getDrawableState());
+ private void updateIconState() {
+ Drawable top = getCompoundDrawables()[1];
+ if (top instanceof FastBitmapDrawable) {
+ ((FastBitmapDrawable) top).setPressed(isPressed() || mStayPressed);
}
- super.drawableStateChanged();
- }
-
- /**
- * Draw this BubbleTextView into the given Canvas.
- *
- * @param destCanvas the canvas to draw on
- * @param padding the horizontal and vertical padding to use when drawing
- */
- private void drawWithPadding(Canvas destCanvas, int padding) {
- final Rect clipRect = mTempRect;
- getDrawingRect(clipRect);
-
- // adjust the clip rect so that we don't include the text label
- clipRect.bottom =
- getExtendedPaddingTop() - (int) BubbleTextView.PADDING_V + getLayout().getLineTop(0);
-
- // Draw the View into the bitmap.
- // The translate of scrollX and scrollY is necessary when drawing TextViews, because
- // they set scrollX and scrollY to large values to achieve centered text
- destCanvas.save();
- destCanvas.scale(getScaleX(), getScaleY(),
- (getWidth() + padding) / 2, (getHeight() + padding) / 2);
- destCanvas.translate(-getScrollX() + padding / 2, -getScrollY() + padding / 2);
- destCanvas.clipRect(clipRect, Op.REPLACE);
- draw(destCanvas);
- destCanvas.restore();
- }
-
- public void setGlowColor(int color) {
- mFocusedOutlineColor = mFocusedGlowColor = mPressedOutlineColor = mPressedGlowColor = color;
- }
-
- /**
- * Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location.
- * Responsibility for the bitmap is transferred to the caller.
- */
- private Bitmap createGlowingOutline(Canvas canvas, int outlineColor, int glowColor) {
- final int padding = mOutlineHelper.mMaxOuterBlurRadius;
- final Bitmap b = Bitmap.createBitmap(
- getWidth() + padding, getHeight() + padding, Bitmap.Config.ARGB_8888);
-
- canvas.setBitmap(b);
- drawWithPadding(canvas, padding);
- mOutlineHelper.applyExtraThickExpensiveOutlineWithBlur(b, canvas, glowColor, outlineColor);
- canvas.setBitmap(null);
-
- return b;
}
@Override
@@ -271,20 +201,11 @@
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
- // So that the pressed outline is visible immediately when isPressed() is true,
+ // So that the pressed outline is visible immediately on setStayPressed(),
// we pre-create it on ACTION_DOWN (it takes a small but perceptible amount of time
// to create it)
- if (mPressedOrFocusedBackground == null) {
- mPressedOrFocusedBackground = createGlowingOutline(
- mTempCanvas, mPressedGlowColor, mPressedOutlineColor);
- }
- // Invalidate so the pressed state is visible, or set a flag so we know that we
- // have to call invalidate as soon as the state is "pressed"
- if (isPressed()) {
- mDidInvalidateForPressedState = true;
- setCellLayoutPressedOrFocusedIcon();
- } else {
- mDidInvalidateForPressedState = false;
+ if (mPressedBackground == null) {
+ mPressedBackground = mOutlineHelper.createMediumDropShadow(this);
}
mLongPressHelper.postCheckForLongPress();
@@ -294,7 +215,7 @@
// If we've touched down and up on an item, and it's still not "pressed", then
// destroy the pressed outline
if (!isPressed()) {
- mPressedOrFocusedBackground = null;
+ mPressedBackground = null;
}
mLongPressHelper.cancelLongPress();
@@ -311,34 +232,47 @@
void setStayPressed(boolean stayPressed) {
mStayPressed = stayPressed;
if (!stayPressed) {
- mPressedOrFocusedBackground = null;
+ mPressedBackground = null;
}
- setCellLayoutPressedOrFocusedIcon();
+
+ // Only show the shadow effect when persistent pressed state is set.
+ if (getParent() instanceof ShortcutAndWidgetContainer) {
+ CellLayout layout = (CellLayout) getParent().getParent();
+ layout.setPressedIcon(this, mPressedBackground, mOutlineHelper.shadowBitmapPadding);
+ }
+
+ updateIconState();
}
- void setCellLayoutPressedOrFocusedIcon() {
- // Disable pressed state when the icon is in preloader state.
- if ((getParent() instanceof ShortcutAndWidgetContainer) &&
- !(getCompoundDrawables()[1] instanceof PreloadIconDrawable)){
- ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) getParent();
- if (parent != null) {
- CellLayout layout = (CellLayout) parent.getParent();
- layout.setPressedOrFocusedIcon((mPressedOrFocusedBackground != null) ? this : null);
+ void clearPressedBackground() {
+ setPressed(false);
+ setStayPressed(false);
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (super.onKeyDown(keyCode, event)) {
+ // Pre-create shadow so show immediately on click.
+ if (mPressedBackground == null) {
+ mPressedBackground = mOutlineHelper.createMediumDropShadow(this);
}
+ return true;
}
+ return false;
}
- void clearPressedOrFocusedBackground() {
- mPressedOrFocusedBackground = null;
- setCellLayoutPressedOrFocusedIcon();
- }
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ // Unlike touch events, keypress event propagate pressed state change immediately,
+ // without waiting for onClickHandler to execute. Disable pressed state changes here
+ // to avoid flickering.
+ mIgnorePressedStateChange = true;
+ boolean result = super.onKeyUp(keyCode, event);
- Bitmap getPressedOrFocusedBackground() {
- return mPressedOrFocusedBackground;
- }
-
- int getPressedOrFocusedBackgroundPadding() {
- return mOutlineHelper.mMaxOuterBlurRadius / 2;
+ mPressedBackground = null;
+ mIgnorePressedStateChange = false;
+ updateIconState();
+ return result;
}
@Override
@@ -443,31 +377,13 @@
mLongPressHelper.cancelLongPress();
}
- public void applyState() {
+ public void applyState(boolean promiseStateChanged) {
if (getTag() instanceof ShortcutInfo) {
ShortcutInfo info = (ShortcutInfo) getTag();
- final int state = info.getState();
-
- final int progressLevel;
- if (DEBUG) Log.d(TAG, "applying icon state: " + state);
-
- switch(state) {
- case ShortcutInfo.PACKAGE_STATE_DEFAULT:
- progressLevel = 100;
- break;
-
- case ShortcutInfo.PACKAGE_STATE_INSTALLING:
- setText(R.string.package_state_installing);
- progressLevel = info.getProgress();
- break;
-
- case ShortcutInfo.PACKAGE_STATE_ERROR:
- case ShortcutInfo.PACKAGE_STATE_UNKNOWN:
- default:
- progressLevel = 0;
- setText(R.string.package_state_unknown);
- break;
- }
+ final boolean isPromise = info.isPromise();
+ final int progressLevel = isPromise ?
+ ((info.hasStatusFlag(ShortcutInfo.FLAG_INSTALL_SESSION_ACTIVE) ?
+ info.getInstallProgress() : 0)) : 100;
Drawable[] drawables = getCompoundDrawables();
Drawable top = drawables[1];
@@ -481,10 +397,9 @@
}
preloadDrawable.setLevel(progressLevel);
- if (state == ShortcutInfo.PACKAGE_STATE_DEFAULT) {
+ if (promiseStateChanged) {
preloadDrawable.maybePerformFinishedAnimation();
}
-
}
}
}
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 93006b3..0ff1ef4 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -72,6 +72,7 @@
private int mHeightGap;
private int mMaxGap;
private boolean mDropPending = false;
+ private boolean mIsDragTarget = true;
// These are temporary variables to prevent having to allocate a new object just to
// return an (x, y) value from helper functions. Do NOT use them to maintain other state.
@@ -122,7 +123,7 @@
private int mDragOutlineCurrent = 0;
private final Paint mDragOutlinePaint = new Paint();
- private BubbleTextView mPressedOrFocusedIcon;
+ private final FastBitmapView mTouchFeedbackView;
private HashMap<CellLayout.LayoutParams, Animator> mReorderAnimators = new
HashMap<CellLayout.LayoutParams, Animator>();
@@ -287,6 +288,9 @@
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap,
mCountX, mCountY);
+ mTouchFeedbackView = new FastBitmapView(context);
+ // Make the feedback view large enough to hold the blur bitmap.
+ addView(mTouchFeedbackView, (int) (grid.cellWidthPx * 1.5), (int) (grid.cellHeightPx * 1.5));
addView(mShortcutsAndWidgets);
}
@@ -333,14 +337,6 @@
return mDropPending;
}
- private void invalidateBubbleTextView(BubbleTextView icon) {
- final int padding = icon.getPressedOrFocusedBackgroundPadding();
- invalidate(icon.getLeft() + getPaddingLeft() - padding,
- icon.getTop() + getPaddingTop() - padding,
- icon.getRight() + getPaddingLeft() + padding,
- icon.getBottom() + getPaddingTop() + padding);
- }
-
void setOverScrollAmount(float r, boolean left) {
if (left && mOverScrollForegroundDrawable != mOverScrollLeft) {
mOverScrollForegroundDrawable = mOverScrollLeft;
@@ -354,24 +350,23 @@
invalidate();
}
- void setPressedOrFocusedIcon(BubbleTextView icon) {
- // We draw the pressed or focused BubbleTextView's background in CellLayout because it
- // requires an expanded clip rect (due to the glow's blur radius)
- BubbleTextView oldIcon = mPressedOrFocusedIcon;
- mPressedOrFocusedIcon = icon;
- if (oldIcon != null) {
- invalidateBubbleTextView(oldIcon);
- }
- if (mPressedOrFocusedIcon != null) {
- invalidateBubbleTextView(mPressedOrFocusedIcon);
- }
- }
-
- void setIsDragOverlapping(boolean isDragOverlapping) {
- if (mIsDragOverlapping != isDragOverlapping) {
- mIsDragOverlapping = isDragOverlapping;
- setUseActiveGlowBackground(mIsDragOverlapping);
- invalidate();
+ void setPressedIcon(BubbleTextView icon, Bitmap background, int padding) {
+ if (icon == null || background == null) {
+ mTouchFeedbackView.setBitmap(null);
+ mTouchFeedbackView.animate().cancel();
+ } else {
+ int offset = getMeasuredWidth() - getPaddingLeft() - getPaddingRight()
+ - (mCountX * mCellWidth);
+ mTouchFeedbackView.setTranslationX(icon.getLeft() + (int) Math.ceil(offset / 2f)
+ - padding);
+ mTouchFeedbackView.setTranslationY(icon.getTop() - padding);
+ if (mTouchFeedbackView.setBitmap(background)) {
+ mTouchFeedbackView.setAlpha(0);
+ mTouchFeedbackView.animate().alpha(1)
+ .setDuration(FastBitmapDrawable.CLICK_FEEDBACK_DURATION)
+ .setInterpolator(FastBitmapDrawable.CLICK_FEEDBACK_INTERPOLATOR)
+ .start();
+ }
}
}
@@ -383,6 +378,22 @@
mDrawBackground = false;
}
+ void disableDragTarget() {
+ mIsDragTarget = false;
+ }
+
+ boolean isDragTarget() {
+ return mIsDragTarget;
+ }
+
+ void setIsDragOverlapping(boolean isDragOverlapping) {
+ if (mIsDragOverlapping != isDragOverlapping) {
+ mIsDragOverlapping = isDragOverlapping;
+ setUseActiveGlowBackground(mIsDragOverlapping);
+ invalidate();
+ }
+ }
+
boolean getIsDragOverlapping() {
return mIsDragOverlapping;
}
@@ -422,23 +433,6 @@
}
}
- // We draw the pressed or focused BubbleTextView's background in CellLayout because it
- // requires an expanded clip rect (due to the glow's blur radius)
- if (mPressedOrFocusedIcon != null) {
- final int padding = mPressedOrFocusedIcon.getPressedOrFocusedBackgroundPadding();
- final Bitmap b = mPressedOrFocusedIcon.getPressedOrFocusedBackground();
- if (b != null) {
- int offset = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() -
- (mCountX * mCellWidth);
- int left = getPaddingLeft() + (int) Math.ceil(offset / 2f);
- int top = getPaddingTop();
- canvas.drawBitmap(b,
- mPressedOrFocusedIcon.getLeft() + left - padding,
- mPressedOrFocusedIcon.getTop() + top - padding,
- null);
- }
- }
-
if (DEBUG_VISUALIZE_OCCUPIED) {
int[] pt = new int[2];
ColorDrawable cd = new ColorDrawable(Color.RED);
@@ -946,6 +940,7 @@
}
public void setBackgroundAlphaMultiplier(float multiplier) {
+
if (mBackgroundAlphaMultiplier != multiplier) {
mBackgroundAlphaMultiplier = multiplier;
invalidate();
@@ -964,10 +959,7 @@
}
public void setShortcutAndWidgetAlpha(float alpha) {
- final int childCount = getChildCount();
- for (int i = 0; i < childCount; i++) {
- getChildAt(i).setAlpha(alpha);
- }
+ mShortcutsAndWidgets.setAlpha(alpha);
}
public ShortcutAndWidgetContainer getShortcutsAndWidgets() {
diff --git a/src/com/android/launcher3/Cling.java b/src/com/android/launcher3/Cling.java
deleted file mode 100644
index a6139cc..0000000
--- a/src/com/android/launcher3/Cling.java
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.launcher3;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.*;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.util.DisplayMetrics;
-import android.view.FocusFinder;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.animation.AccelerateInterpolator;
-import android.widget.FrameLayout;
-import android.widget.TextView;
-
-public class Cling extends FrameLayout implements Insettable, View.OnClickListener,
- View.OnLongClickListener, View.OnTouchListener {
-
- 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 MIGRATION_PORTRAIT = "migration_portrait";
- private static String MIGRATION_LANDSCAPE = "migration_landscape";
-
- private static String MIGRATION_WORKSPACE_PORTRAIT = "migration_workspace_portrait";
- private static String MIGRATION_WORKSPACE_LARGE_PORTRAIT = "migration_workspace_large_portrait";
- private static String MIGRATION_WORKSPACE_LANDSCAPE = "migration_workspace_landscape";
-
- 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 = 60;
- private static float FIRST_RUN_MAX_CIRCLE_RADIUS_DPS = 180;
- 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 static float MIGRATION_WORKSPACE_INNER_CIRCLE_RADIUS_DPS = 42;
- private static float MIGRATION_WORKSPACE_OUTER_CIRCLE_RADIUS_DPS = 46;
-
- private Launcher mLauncher;
- private boolean mIsInitialized;
- private String mDrawIdentifier;
- private Drawable mBackground;
-
- private int[] mTouchDownPt = new int[2];
-
- private Drawable mFocusedHotseatApp;
- private ComponentName mFocusedHotseatAppComponent;
- private Rect mFocusedHotseatAppBounds;
-
- private Paint mErasePaint;
- private Paint mBorderPaint;
- private Paint mBubblePaint;
- private Paint mDotPaint;
-
- private View mScrimView;
- private int mBackgroundColor;
-
- private final Rect mInsets = new Rect();
-
- public Cling(Context context) {
- this(context, null, 0);
- }
-
- public Cling(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public Cling(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Cling, defStyle, 0);
- mDrawIdentifier = a.getString(R.styleable.Cling_drawIdentifier);
- a.recycle();
-
- setClickable(true);
-
- }
-
- void init(Launcher l, View scrim) {
- if (!mIsInitialized) {
- mLauncher = l;
- mScrimView = scrim;
- mBackgroundColor = 0xcc000000;
- setOnLongClickListener(this);
- setOnClickListener(this);
- setOnTouchListener(this);
-
- mErasePaint = new Paint();
- mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
- mErasePaint.setColor(0xFFFFFF);
- mErasePaint.setAlpha(0);
- mErasePaint.setAntiAlias(true);
-
- mBorderPaint = new Paint();
- mBorderPaint.setColor(0xFFFFFFFF);
- mBorderPaint.setAntiAlias(true);
-
- int circleColor = getResources().getColor(
- R.color.first_run_cling_circle_background_color);
- mBubblePaint = new Paint();
- mBubblePaint.setColor(circleColor);
- mBubblePaint.setAntiAlias(true);
-
- mDotPaint = new Paint();
- mDotPaint.setColor(0x72BBED);
- mDotPaint.setAntiAlias(true);
-
- mIsInitialized = true;
- }
- }
-
- void setFocusedHotseatApp(int drawableId, int appRank, ComponentName cn, String title,
- String description) {
- // Get the app to draw
- Resources r = getResources();
- int appIconId = drawableId;
- Hotseat hotseat = mLauncher.getHotseat();
- // Skip the focused app in the large layouts
- if (!mDrawIdentifier.equals(WORKSPACE_LARGE) &&
- hotseat != null && appIconId > -1 && appRank > -1 && !title.isEmpty() &&
- !description.isEmpty()) {
- // Set the app bounds
- int x = hotseat.getCellXFromOrder(appRank);
- int y = hotseat.getCellYFromOrder(appRank);
- Rect pos = hotseat.getCellCoordinates(x, y);
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- mFocusedHotseatApp = getResources().getDrawable(appIconId);
- mFocusedHotseatAppComponent = cn;
- mFocusedHotseatAppBounds = new Rect(pos.left, pos.top,
- pos.left + Utilities.sIconTextureWidth,
- pos.top + Utilities.sIconTextureHeight);
- Utilities.scaleRectAboutCenter(mFocusedHotseatAppBounds,
- ((float) grid.hotseatIconSizePx / grid.iconSizePx));
-
- // Set the title
- TextView v = (TextView) findViewById(R.id.focused_hotseat_app_title);
- if (v != null) {
- v.setText(title);
- }
-
- // Set the description
- v = (TextView) findViewById(R.id.focused_hotseat_app_description);
- if (v != null) {
- v.setText(description);
- }
-
- // Show the bubble
- View bubble = findViewById(R.id.focused_hotseat_app_bubble);
- bubble.setVisibility(View.VISIBLE);
- }
- }
-
- void setOpenFolderRect(Rect r) {
- if (mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
- mDrawIdentifier.equals(FOLDER_LARGE)) {
- ViewGroup vg = (ViewGroup) findViewById(R.id.folder_bubble);
- ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) vg.getLayoutParams();
- lp.topMargin = r.top - mInsets.bottom;
- lp.leftMargin = r.right;
- vg.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
- vg.requestLayout();
- }
- }
-
- void updateMigrationWorkspaceBubblePosition() {
- DisplayMetrics metrics = new DisplayMetrics();
- mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
-
- // Get the page indicator bounds
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- Rect pageIndicatorBounds = grid.getWorkspacePageIndicatorBounds(mInsets);
-
- if (mDrawIdentifier.equals(MIGRATION_WORKSPACE_PORTRAIT)) {
- View bubble = findViewById(R.id.migration_workspace_cling_bubble);
- ViewGroup.MarginLayoutParams lp =
- (ViewGroup.MarginLayoutParams) bubble.getLayoutParams();
- lp.bottomMargin = grid.heightPx - pageIndicatorBounds.top;
- bubble.requestLayout();
- } else if (mDrawIdentifier.equals(MIGRATION_WORKSPACE_LARGE_PORTRAIT)) {
- View bubble = findViewById(R.id.content);
- ViewGroup.MarginLayoutParams lp =
- (ViewGroup.MarginLayoutParams) bubble.getLayoutParams();
- lp.bottomMargin = grid.heightPx - pageIndicatorBounds.top;
- bubble.requestLayout();
- } else if (mDrawIdentifier.equals(MIGRATION_WORKSPACE_LANDSCAPE)) {
- View bubble = findViewById(R.id.content);
- ViewGroup.MarginLayoutParams lp =
- (ViewGroup.MarginLayoutParams) bubble.getLayoutParams();
- if (grid.isLayoutRtl) {
- lp.leftMargin = pageIndicatorBounds.right;
- } else {
- lp.rightMargin = (grid.widthPx - pageIndicatorBounds.left);
- }
- bubble.requestLayout();
- }
- }
-
- void updateWorkspaceBubblePosition() {
- DisplayMetrics metrics = new DisplayMetrics();
- mLauncher.getWindowManager().getDefaultDisplay().getMetrics(metrics);
-
- // Get the cut-out bounds
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- Rect cutOutBounds = getWorkspaceCutOutBounds(metrics);
-
- if (mDrawIdentifier.equals(WORKSPACE_LARGE)) {
- View bubble = findViewById(R.id.workspace_cling_bubble);
- ViewGroup.MarginLayoutParams lp =
- (ViewGroup.MarginLayoutParams) bubble.getLayoutParams();
- lp.bottomMargin = grid.heightPx - cutOutBounds.top - mInsets.bottom;
- bubble.requestLayout();
- }
- }
-
- private Rect getWorkspaceCutOutBounds(DisplayMetrics metrics) {
- int halfWidth = metrics.widthPixels / 2;
- int halfHeight = metrics.heightPixels / 2;
- int yOffset = DynamicGrid.pxFromDp(WORKSPACE_CIRCLE_Y_OFFSET_DPS, metrics);
- if (mDrawIdentifier.equals(WORKSPACE_LARGE)) {
- yOffset = 0;
- }
- int radius = DynamicGrid.pxFromDp(WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics);
- return new Rect(halfWidth - radius, halfHeight - yOffset - radius, halfWidth + radius,
- halfHeight - yOffset + radius);
- }
-
- 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) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LARGE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LANDSCAPE)) {
- View content = getContent();
- content.setAlpha(0f);
- content.animate()
- .alpha(1f)
- .setDuration(duration)
- .setListener(null)
- .start();
- setAlpha(1f);
- } else {
- if (animate) {
- buildLayer();
- setAlpha(0f);
- animate()
- .alpha(1f)
- .setInterpolator(new AccelerateInterpolator())
- .setDuration(duration)
- .setListener(null)
- .start();
- } else {
- setAlpha(1f);
- }
- }
-
- // Show the scrim if necessary
- if (mScrimView != null) {
- mScrimView.setVisibility(View.VISIBLE);
- mScrimView.setAlpha(0f);
- mScrimView.animate()
- .alpha(1f)
- .setDuration(duration)
- .setListener(null)
- .start();
- }
-
- 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) ||
- mDrawIdentifier.equals(MIGRATION_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_LANDSCAPE)) {
- View content = getContent();
- content.animate()
- .alpha(0f)
- .setDuration(duration)
- .setListener(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();
- };
- })
- .start();
- } else {
- animate()
- .alpha(0f)
- .setDuration(duration)
- .setListener(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();
- };
- })
- .start();
- }
-
- // Show the scrim if necessary
- if (mScrimView != null) {
- mScrimView.animate()
- .alpha(0f)
- .setDuration(duration)
- .setListener(new AnimatorListenerAdapter() {
- public void onAnimationEnd(Animator animation) {
- mScrimView.setVisibility(View.GONE);
- };
- })
- .start();
- }
- }
-
- void cleanup() {
- mBackground = null;
- mIsInitialized = false;
- }
-
- void bringScrimToFront() {
- if (mScrimView != null) {
- mScrimView.bringToFront();
- }
- }
-
- @Override
- public void setInsets(Rect insets) {
- mInsets.set(insets);
- setPadding(insets.left, insets.top, insets.right, insets.bottom);
- }
-
- View getContent() {
- return findViewById(R.id.content);
- }
-
- String getDrawIdentifier() {
- return mDrawIdentifier;
- }
-
- @Override
- public View focusSearch(int direction) {
- return this.focusSearch(this, direction);
- }
-
- @Override
- public View focusSearch(View focused, int direction) {
- return FocusFinder.getInstance().findNextFocus(this, focused, direction);
- }
-
- @Override
- public boolean onHoverEvent(MotionEvent event) {
- return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)
- || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)
- || mDrawIdentifier.equals(WORKSPACE_LARGE)
- || mDrawIdentifier.equals(WORKSPACE_CUSTOM));
- }
-
- @Override
- public boolean onTouchEvent(android.view.MotionEvent event) {
- if (mDrawIdentifier.equals(FOLDER_PORTRAIT) ||
- mDrawIdentifier.equals(FOLDER_LANDSCAPE) ||
- mDrawIdentifier.equals(FOLDER_LARGE)) {
- Folder f = mLauncher.getWorkspace().getOpenFolder();
- if (f != null) {
- Rect r = new Rect();
- f.getHitRect(r);
- if (r.contains((int) event.getX(), (int) event.getY())) {
- return false;
- }
- }
- }
- return super.onTouchEvent(event);
- };
-
- @Override
- public boolean onTouch(View v, MotionEvent ev) {
- if (ev.getAction() == MotionEvent.ACTION_DOWN) {
- mTouchDownPt[0] = (int) ev.getX();
- mTouchDownPt[1] = (int) ev.getY();
- }
- return false;
- }
-
- @Override
- public void onClick(View v) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
- mDrawIdentifier.equals(WORKSPACE_LARGE)) {
- if (mFocusedHotseatAppBounds != null &&
- mFocusedHotseatAppBounds.contains(mTouchDownPt[0], mTouchDownPt[1])) {
- // Launch the activity that is being highlighted
- Intent intent = new Intent(Intent.ACTION_MAIN);
- intent.setComponent(mFocusedHotseatAppComponent);
- intent.addCategory(Intent.CATEGORY_LAUNCHER);
- mLauncher.startActivity(intent, null);
- mLauncher.getLauncherClings().dismissWorkspaceCling(this);
- }
- }
- }
-
- @Override
- public boolean onLongClick(View v) {
- if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
- mDrawIdentifier.equals(WORKSPACE_LARGE)) {
- mLauncher.getLauncherClings().dismissWorkspaceCling(null);
- return true;
- } else if (mDrawIdentifier.equals(MIGRATION_WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LARGE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LANDSCAPE)) {
- mLauncher.getLauncherClings().dismissMigrationWorkspaceCling(null);
- return true;
- }
- return false;
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- if (mIsInitialized) {
- canvas.save();
-
- // Get the page indicator bounds
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- Rect pageIndicatorBounds = grid.getWorkspacePageIndicatorBounds(mInsets);
-
- // Get the background override if there is one
- if (mBackground == null) {
- if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) {
- mBackground = getResources().getDrawable(R.drawable.bg_cling5);
- }
- }
- // Draw the background
- Bitmap eraseBg = null;
- Canvas eraseCanvas = null;
- if (mScrimView != null) {
- // Skip drawing the background
- mScrimView.setBackgroundColor(mBackgroundColor);
- } else if (mBackground != null) {
- mBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
- mBackground.draw(canvas);
- } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
- mDrawIdentifier.equals(WORKSPACE_LARGE) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LARGE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LANDSCAPE)) {
- // Initialize the draw buffer (to allow punching through)
- eraseBg = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(),
- Bitmap.Config.ARGB_8888);
- eraseCanvas = new Canvas(eraseBg);
- eraseCanvas.drawColor(mBackgroundColor);
- } else {
- canvas.drawColor(mBackgroundColor);
- }
-
- // 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 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);
- float maxRadius = DynamicGrid.pxFromDp(FIRST_RUN_MAX_CIRCLE_RADIUS_DPS, metrics);
- float radius = Math.min(maxRadius, (bubbleContent.getMeasuredWidth() + buffer) / 2);
- canvas.drawCircle(metrics.widthPixels / 2,
- bubbleRect.centerY(), radius,
- mBubblePaint);
- } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
- mDrawIdentifier.equals(WORKSPACE_LARGE)) {
- Rect cutOutBounds = getWorkspaceCutOutBounds(metrics);
- // Draw the outer circle
- mErasePaint.setAlpha(128);
- eraseCanvas.drawCircle(cutOutBounds.centerX(), cutOutBounds.centerY(),
- DynamicGrid.pxFromDp(WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics),
- mErasePaint);
- // Draw the inner circle
- mErasePaint.setAlpha(0);
- eraseCanvas.drawCircle(cutOutBounds.centerX(), cutOutBounds.centerY(),
- DynamicGrid.pxFromDp(WORKSPACE_INNER_CIRCLE_RADIUS_DPS, metrics),
- mErasePaint);
- canvas.drawBitmap(eraseBg, 0, 0, null);
- eraseCanvas.setBitmap(null);
- eraseBg = null;
-
- // Draw the focused hotseat app icon
- if (mFocusedHotseatAppBounds != null && mFocusedHotseatApp != null) {
- mFocusedHotseatApp.setBounds(mFocusedHotseatAppBounds.left,
- mFocusedHotseatAppBounds.top, mFocusedHotseatAppBounds.right,
- mFocusedHotseatAppBounds.bottom);
- mFocusedHotseatApp.setAlpha((int) (255 * alpha));
- mFocusedHotseatApp.draw(canvas);
- }
- } else if (mDrawIdentifier.equals(MIGRATION_WORKSPACE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LARGE_PORTRAIT) ||
- mDrawIdentifier.equals(MIGRATION_WORKSPACE_LANDSCAPE)) {
- int offset = DynamicGrid.pxFromDp(WORKSPACE_CIRCLE_Y_OFFSET_DPS, metrics);
- // Draw the outer circle
- eraseCanvas.drawCircle(pageIndicatorBounds.centerX(),
- pageIndicatorBounds.centerY(),
- DynamicGrid.pxFromDp(MIGRATION_WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics),
- mBorderPaint);
- // Draw the inner circle
- mErasePaint.setAlpha(0);
- eraseCanvas.drawCircle(pageIndicatorBounds.centerX(),
- pageIndicatorBounds.centerY(),
- DynamicGrid.pxFromDp(MIGRATION_WORKSPACE_INNER_CIRCLE_RADIUS_DPS, metrics),
- mErasePaint);
- canvas.drawBitmap(eraseBg, 0, 0, null);
- eraseCanvas.setBitmap(null);
- eraseBg = null;
- }
- canvas.restore();
- }
-
- // Draw the rest of the cling
- super.dispatchDraw(canvas);
- };
-}
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index fbdd7eb..05e8906 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -30,6 +30,8 @@
import android.graphics.Rect;
import android.graphics.drawable.TransitionDrawable;
import android.os.AsyncTask;
+import android.os.Build;
+import android.os.Bundle;
import android.os.UserManager;
import android.util.AttributeSet;
import android.view.View;
@@ -193,11 +195,14 @@
isVisible = false;
}
if (useUninstallLabel) {
- UserManager userManager = (UserManager)
- getContext().getSystemService(Context.USER_SERVICE);
- if (userManager.hasUserRestriction(UserManager.DISALLOW_APPS_CONTROL)
- || userManager.hasUserRestriction(UserManager.DISALLOW_UNINSTALL_APPS)) {
- isVisible = false;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+ UserManager userManager = (UserManager)
+ getContext().getSystemService(Context.USER_SERVICE);
+ Bundle restrictions = userManager.getUserRestrictions();
+ if (restrictions.getBoolean(UserManager.DISALLOW_APPS_CONTROL, false)
+ || restrictions.getBoolean(UserManager.DISALLOW_UNINSTALL_APPS, false)) {
+ isVisible = false;
+ }
}
}
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 8af2a7f..daf5556 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -69,7 +69,7 @@
float numRows;
float numColumns;
float numHotseatIcons;
- private float iconSize;
+ float iconSize;
private float iconTextSize;
private int iconDrawablePaddingOriginalPx;
private float hotseatIconSize;
@@ -130,6 +130,9 @@
float dragViewScale;
+ int allAppsShortEdgeCount = -1;
+ int allAppsLongEdgeCount = -1;
+
private ArrayList<DeviceProfileCallbacks> mCallbacks = new ArrayList<DeviceProfileCallbacks>();
DeviceProfile(String n, float w, float h, float r, float c,
@@ -152,6 +155,9 @@
defaultNoAllAppsLayoutId = dnalId;
}
+ DeviceProfile() {
+ }
+
DeviceProfile(Context context,
ArrayList<DeviceProfile> profiles,
float minWidth, float minHeight,
@@ -218,6 +224,7 @@
points.add(new DeviceProfileQuery(p, p.iconSize));
}
iconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
+
// AllApps uses the original non-scaled icon size
allAppsIconSizePx = DynamicGrid.pxFromDp(iconSize, dm);
@@ -240,6 +247,9 @@
// Hotseat
hotseatIconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
+ // If the partner customization apk contains any grid overrides, apply them
+ applyPartnerDeviceProfileOverrides(context, dm);
+
// Calculate the remaining vars
updateFromConfiguration(context, res, wPx, hPx, awPx, ahPx);
updateAvailableDimensions(context);
@@ -247,6 +257,33 @@
}
/**
+ * Apply any Partner customization grid overrides.
+ *
+ * Currently we support: all apps row / column count.
+ */
+ private void applyPartnerDeviceProfileOverrides(Context ctx, DisplayMetrics dm) {
+ Partner p = Partner.get(ctx.getPackageManager());
+ if (p != null) {
+ DeviceProfile partnerDp = p.getDeviceProfileOverride(dm);
+ if (partnerDp != null) {
+ if (partnerDp.numRows > 0 && partnerDp.numColumns > 0) {
+ numRows = partnerDp.numRows;
+ numColumns = partnerDp.numColumns;
+ }
+ if (partnerDp.allAppsShortEdgeCount > 0 && partnerDp.allAppsLongEdgeCount > 0) {
+ allAppsShortEdgeCount = partnerDp.allAppsShortEdgeCount;
+ allAppsLongEdgeCount = partnerDp.allAppsLongEdgeCount;
+ }
+ if (partnerDp.iconSize > 0) {
+ iconSize = partnerDp.iconSize;
+ // AllApps uses the original non-scaled icon size
+ allAppsIconSizePx = DynamicGrid.pxFromDp(iconSize, dm);
+ }
+ }
+ }
+ }
+
+ /**
* Determine the exact visual footprint of the all apps button, taking into account scaling
* and internal padding of the drawable.
*/
@@ -380,12 +417,17 @@
int maxRows = (isLandscape ? maxShortEdgeCellCount : maxLongEdgeCellCount);
int maxCols = (isLandscape ? maxLongEdgeCellCount : maxShortEdgeCellCount);
- allAppsNumRows = (availableHeightPx - pageIndicatorHeightPx) /
- (allAppsCellHeightPx + allAppsCellPaddingPx);
- allAppsNumRows = Math.max(minEdgeCellCount, Math.min(maxRows, allAppsNumRows));
- allAppsNumCols = (availableWidthPx) /
- (allAppsCellWidthPx + allAppsCellPaddingPx);
- allAppsNumCols = Math.max(minEdgeCellCount, Math.min(maxCols, allAppsNumCols));
+ if (allAppsShortEdgeCount > 0 && allAppsLongEdgeCount > 0) {
+ allAppsNumRows = isLandscape ? allAppsShortEdgeCount : allAppsLongEdgeCount;
+ allAppsNumCols = isLandscape ? allAppsLongEdgeCount : allAppsShortEdgeCount;
+ } else {
+ allAppsNumRows = (availableHeightPx - pageIndicatorHeightPx) /
+ (allAppsCellHeightPx + allAppsCellPaddingPx);
+ allAppsNumRows = Math.max(minEdgeCellCount, Math.min(maxRows, allAppsNumRows));
+ allAppsNumCols = (availableWidthPx) /
+ (allAppsCellWidthPx + allAppsCellPaddingPx);
+ allAppsNumCols = Math.max(minEdgeCellCount, Math.min(maxCols, allAppsNumCols));
+ }
}
void updateFromConfiguration(Context context, Resources resources, int wPx, int hPx,
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java
index 80f8dfc..a8a61ea 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -81,6 +81,14 @@
private Drawable mBackground;
private float mBackgroundAlpha = 0;
+ // Related to adjacent page hints
+ private boolean mInScrollArea;
+ private boolean mShowPageHints;
+ private Drawable mLeftHoverDrawable;
+ private Drawable mRightHoverDrawable;
+ private Drawable mLeftHoverDrawableActive;
+ private Drawable mRightHoverDrawableActive;
+
/**
* Used to create a new DragLayer from XML.
*
@@ -96,8 +104,10 @@
setOnHierarchyChangeListener(this);
final Resources res = getResources();
- mLeftHoverDrawable = res.getDrawable(R.drawable.page_hover_left_holo);
- mRightHoverDrawable = res.getDrawable(R.drawable.page_hover_right_holo);
+ mLeftHoverDrawable = res.getDrawable(R.drawable.page_hover_left);
+ mRightHoverDrawable = res.getDrawable(R.drawable.page_hover_right);
+ mLeftHoverDrawableActive = res.getDrawable(R.drawable.page_hover_left_active);
+ mRightHoverDrawableActive = res.getDrawable(R.drawable.page_hover_right_active);
mBackground = res.getDrawable(R.drawable.apps_customize_bg);
}
@@ -122,6 +132,10 @@
return true; // I'll take it from here
}
+ Rect getInsets() {
+ return mInsets;
+ }
+
@Override
public void addView(View child, int index, android.view.ViewGroup.LayoutParams params) {
super.addView(child, index, params);
@@ -190,8 +204,7 @@
}
Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
- if (currentFolder != null && !mLauncher.getLauncherClings().isFolderClingVisible() &&
- intercept) {
+ if (currentFolder != null && intercept) {
if (currentFolder.isEditingName()) {
if (!isEventOverFolderTextRegion(currentFolder, ev)) {
currentFolder.dismissEditingName();
@@ -849,10 +862,6 @@
}
}
- private boolean mInScrollArea;
- private Drawable mLeftHoverDrawable;
- private Drawable mRightHoverDrawable;
-
void onEnterScrollArea(int direction) {
mInScrollArea = true;
invalidate();
@@ -863,6 +872,16 @@
invalidate();
}
+ void showPageHints() {
+ mShowPageHints = true;
+ invalidate();
+ }
+
+ void hidePageHints() {
+ mShowPageHints = false;
+ invalidate();
+ }
+
/**
* Note: this is a reimplementation of View.isLayoutRtl() since that is currently hidden api.
*/
@@ -881,31 +900,48 @@
}
super.dispatchDraw(canvas);
+ }
- // Draw screen hover indicators above children.
- if (mInScrollArea && !LauncherAppState.getInstance().isScreenLarge()) {
+ private void drawPageHints(Canvas canvas) {
+ if (mShowPageHints) {
Workspace workspace = mLauncher.getWorkspace();
int width = getMeasuredWidth();
Rect childRect = new Rect();
- getDescendantRectRelativeToSelf(workspace.getChildAt(0), childRect);
+ getDescendantRectRelativeToSelf(workspace.getChildAt(workspace.getChildCount() - 1),
+ childRect);
int page = workspace.getNextPage();
final boolean isRtl = isLayoutRtl();
CellLayout leftPage = (CellLayout) workspace.getChildAt(isRtl ? page + 1 : page - 1);
CellLayout rightPage = (CellLayout) workspace.getChildAt(isRtl ? page - 1 : page + 1);
- if (leftPage != null && leftPage.getIsDragOverlapping()) {
- mLeftHoverDrawable.setBounds(0, childRect.top,
- mLeftHoverDrawable.getIntrinsicWidth(), childRect.bottom);
- mLeftHoverDrawable.draw(canvas);
- } else if (rightPage != null && rightPage.getIsDragOverlapping()) {
- mRightHoverDrawable.setBounds(width - mRightHoverDrawable.getIntrinsicWidth(),
+ if (leftPage != null && leftPage.isDragTarget()) {
+ Drawable left = mInScrollArea && leftPage.getIsDragOverlapping() ?
+ mLeftHoverDrawableActive : mLeftHoverDrawable;
+ left.setBounds(0, childRect.top,
+ left.getIntrinsicWidth(), childRect.bottom);
+ left.draw(canvas);
+ }
+ if (rightPage != null && rightPage.isDragTarget()) {
+ Drawable right = mInScrollArea && rightPage.getIsDragOverlapping() ?
+ mRightHoverDrawableActive : mRightHoverDrawable;
+ right.setBounds(width - right.getIntrinsicWidth(),
childRect.top, width, childRect.bottom);
- mRightHoverDrawable.draw(canvas);
+ right.draw(canvas);
}
}
}
+ protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
+ boolean ret = super.drawChild(canvas, child, drawingTime);
+
+ // We want to draw the page hints above the workspace, but below the drag view.
+ if (child instanceof Workspace) {
+ drawPageHints(canvas);
+ }
+ return ret;
+ }
+
public void setBackgroundAlpha(float alpha) {
if (alpha != mBackgroundAlpha) {
mBackgroundAlpha = alpha;
diff --git a/src/com/android/launcher3/FastBitmapDrawable.java b/src/com/android/launcher3/FastBitmapDrawable.java
index cf7c22e..ff02bbb 100644
--- a/src/com/android/launcher3/FastBitmapDrawable.java
+++ b/src/com/android/launcher3/FastBitmapDrawable.java
@@ -16,30 +16,62 @@
package com.android.launcher3;
+import android.animation.ObjectAnimator;
+import android.animation.TimeInterpolator;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.util.SparseArray;
class FastBitmapDrawable extends Drawable {
+ static final TimeInterpolator CLICK_FEEDBACK_INTERPOLATOR = new TimeInterpolator() {
+
+ @Override
+ public float getInterpolation(float input) {
+ if (input < 0.05f) {
+ return input / 0.05f;
+ } else if (input < 0.3f){
+ return 1;
+ } else {
+ return (1 - input) / 0.7f;
+ }
+ }
+ };
+ static final long CLICK_FEEDBACK_DURATION = 2000;
+
+ private static final int PRESSED_BRIGHTNESS = 100;
private static ColorMatrix sGhostModeMatrix;
private static final ColorMatrix sTempMatrix = new ColorMatrix();
+ /**
+ * Store the brightness colors filters to optimize animations during icon press. This
+ * only works for non-ghost-mode icons.
+ */
+ private static final SparseArray<ColorFilter> sCachedBrightnessFilter =
+ new SparseArray<ColorFilter>();
+
private static final int GHOST_MODE_MIN_COLOR_RANGE = 130;
private final Paint mPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
- private Bitmap mBitmap;
+ private final Bitmap mBitmap;
private int mAlpha;
private int mBrightness = 0;
private boolean mGhostModeEnabled = false;
+ private boolean mPressed = false;
+ private ObjectAnimator mPressedAnimator;
+
FastBitmapDrawable(Bitmap b) {
mAlpha = 255;
mBitmap = b;
@@ -81,12 +113,12 @@
@Override
public int getIntrinsicWidth() {
- return getBounds().width();
+ return mBitmap.getWidth();
}
@Override
public int getIntrinsicHeight() {
- return getBounds().height();
+ return mBitmap.getHeight();
}
@Override
@@ -114,6 +146,23 @@
}
}
+ public void setPressed(boolean pressed) {
+ if (mPressed != pressed) {
+ mPressed = pressed;
+ if (mPressed) {
+ mPressedAnimator = ObjectAnimator
+ .ofInt(this, "brightness", PRESSED_BRIGHTNESS)
+ .setDuration(CLICK_FEEDBACK_DURATION);
+ mPressedAnimator.setInterpolator(CLICK_FEEDBACK_INTERPOLATOR);
+ mPressedAnimator.start();
+ } else if (mPressedAnimator != null) {
+ mPressedAnimator.cancel();
+ setBrightness(0);
+ }
+ }
+ invalidateSelf();
+ }
+
public boolean isGhostModeEnabled() {
return mGhostModeEnabled;
}
@@ -122,14 +171,11 @@
return mBrightness;
}
- public void addBrightness(int amount) {
- setBrightness(mBrightness + amount);
- }
-
public void setBrightness(int brightness) {
if (mBrightness != brightness) {
mBrightness = brightness;
updateFilter();
+ invalidateSelf();
}
}
@@ -157,8 +203,13 @@
mPaint.setColorFilter(new ColorMatrixColorFilter(sTempMatrix));
}
} else if (mBrightness != 0) {
- setBrightnessMatrix(sTempMatrix, mBrightness);
- mPaint.setColorFilter(new ColorMatrixColorFilter(sTempMatrix));
+ ColorFilter filter = sCachedBrightnessFilter.get(mBrightness);
+ if (filter == null) {
+ filter = new PorterDuffColorFilter(Color.argb(mBrightness, 255, 255, 255),
+ PorterDuff.Mode.SRC_ATOP);
+ sCachedBrightnessFilter.put(mBrightness, filter);
+ }
+ mPaint.setColorFilter(filter);
} else {
mPaint.setColorFilter(null);
}
diff --git a/src/com/android/launcher3/FastBitmapView.java b/src/com/android/launcher3/FastBitmapView.java
new file mode 100644
index 0000000..0937eb7
--- /dev/null
+++ b/src/com/android/launcher3/FastBitmapView.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.view.View;
+
+public class FastBitmapView extends View {
+
+ private final Paint mPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
+ private Bitmap mBitmap;
+
+ public FastBitmapView(Context context) {
+ super(context);
+ }
+
+ /**
+ * Applies the new bitmap.
+ * @return true if the view was invalidated.
+ */
+ public boolean setBitmap(Bitmap b) {
+ if (b != mBitmap){
+ if (mBitmap != null) {
+ invalidate(0, 0, mBitmap.getWidth(), mBitmap.getHeight());
+ }
+ mBitmap = b;
+ if (mBitmap != null) {
+ invalidate(0, 0, mBitmap.getWidth(), mBitmap.getHeight());
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ if (mBitmap != null) {
+ canvas.drawBitmap(mBitmap, 0, 0, mPaint);
+ }
+ }
+}
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index df5e0fc..d529b39 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -17,13 +17,13 @@
package com.android.launcher3;
import android.content.res.Configuration;
+import android.util.Log;
import android.view.KeyEvent;
+import android.view.SoundEffectConstants;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ScrollView;
-import android.widget.TabHost;
-import android.widget.TabWidget;
import java.util.ArrayList;
import java.util.Collections;
@@ -89,7 +89,6 @@
final PagedViewGridLayout parent = (PagedViewGridLayout) w.getParent();
final PagedView container = (PagedView) parent.getParent();
- final AppsCustomizeTabHost tabHost = findTabHostParent(container);
final int widgetIndex = parent.indexOfChild(w);
final int widgetCount = parent.getChildCount();
final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parent));
@@ -246,7 +245,6 @@
// Note we have an extra parent because of the
// PagedViewCellLayout/PagedViewCellLayoutChildren relationship
final PagedView container = (PagedView) parentLayout.getParent();
- final AppsCustomizeTabHost tabHost = findTabHostParent(container);
final int iconIndex = itemContainer.indexOfChild(v);
final int itemCount = itemContainer.getChildCount();
final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parentLayout));
@@ -268,13 +266,17 @@
// Select the previous icon or the last icon on the previous page
if (iconIndex > 0) {
itemContainer.getChildAt(iconIndex - 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
} else {
if (pageIndex > 0) {
newParent = getAppsCustomizePage(container, pageIndex - 1);
if (newParent != null) {
container.snapToPage(pageIndex - 1);
child = newParent.getChildAt(newParent.getChildCount() - 1);
- if (child != null) child.requestFocus();
+ if (child != null) {
+ child.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
+ }
}
}
}
@@ -286,13 +288,17 @@
// Select the next icon or the first icon on the next page
if (iconIndex < (itemCount - 1)) {
itemContainer.getChildAt(iconIndex + 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
} else {
if (pageIndex < (pageCount - 1)) {
newParent = getAppsCustomizePage(container, pageIndex + 1);
if (newParent != null) {
container.snapToPage(pageIndex + 1);
child = newParent.getChildAt(0);
- if (child != null) child.requestFocus();
+ if (child != null) {
+ child.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
+ }
}
}
}
@@ -305,29 +311,25 @@
if (y > 0) {
int newiconIndex = ((y - 1) * countX) + x;
itemContainer.getChildAt(newiconIndex).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
- // Select the closest icon in the previous row, otherwise do nothing
+ // Select the closest icon in the next row, otherwise do nothing
if (y < (countY - 1)) {
int newiconIndex = Math.min(itemCount - 1, ((y + 1) * countX) + x);
- itemContainer.getChildAt(newiconIndex).requestFocus();
+ int newIconY = newiconIndex / countX;
+ if (newIconY != y) {
+ itemContainer.getChildAt(newiconIndex).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
+ }
}
}
wasHandled = true;
break;
- case KeyEvent.KEYCODE_ENTER:
- case KeyEvent.KEYCODE_DPAD_CENTER:
- if (handleKeyEvent) {
- // Simulate a click on the icon
- View.OnClickListener clickListener = (View.OnClickListener) container;
- clickListener.onClick(v);
- }
- wasHandled = true;
- break;
case KeyEvent.KEYCODE_PAGE_UP:
if (handleKeyEvent) {
// Select the first icon on the previous page, or the first icon on this page
@@ -337,10 +339,14 @@
if (newParent != null) {
container.snapToPage(pageIndex - 1);
child = newParent.getChildAt(0);
- if (child != null) child.requestFocus();
+ if (child != null) {
+ child.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
+ }
}
} else {
itemContainer.getChildAt(0).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
@@ -354,10 +360,14 @@
if (newParent != null) {
container.snapToPage(pageIndex + 1);
child = newParent.getChildAt(0);
- if (child != null) child.requestFocus();
+ if (child != null) {
+ child.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
+ }
}
} else {
itemContainer.getChildAt(itemCount - 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
wasHandled = true;
@@ -366,6 +376,7 @@
if (handleKeyEvent) {
// Select the first icon on this page
itemContainer.getChildAt(0).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
wasHandled = true;
break;
@@ -373,6 +384,7 @@
if (handleKeyEvent) {
// Select the last icon on this page
itemContainer.getChildAt(itemCount - 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
wasHandled = true;
break;
@@ -439,53 +451,56 @@
* Handles key events in the workspace hotseat (bottom of the screen).
*/
static boolean handleHotseatButtonKeyEvent(View v, int keyCode, KeyEvent e, int orientation) {
- final ViewGroup parent = (ViewGroup) v.getParent();
- final ViewGroup launcher = (ViewGroup) parent.getParent();
- final Workspace workspace = (Workspace) launcher.findViewById(R.id.workspace);
- final int buttonIndex = parent.indexOfChild(v);
- final int buttonCount = parent.getChildCount();
- final int pageIndex = workspace.getCurrentPage();
+ ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) v.getParent();
+ final CellLayout layout = (CellLayout) parent.getParent();
// NOTE: currently we don't special case for the phone UI in different
- // orientations, even though the hotseat is on the side in landscape mode. This
+ // orientations, even though the hotseat is on the side in landscape mode. This
// is to ensure that accessibility consistency is maintained across rotations.
-
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
boolean wasHandled = false;
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_LEFT:
if (handleKeyEvent) {
- // Select the previous button, otherwise snap to the previous page
- if (buttonIndex > 0) {
- parent.getChildAt(buttonIndex - 1).requestFocus();
- } else {
- workspace.snapToPage(pageIndex - 1);
+ ArrayList<View> views = getCellLayoutChildrenSortedSpatially(layout, parent);
+ int myIndex = views.indexOf(v);
+ // Select the previous button, otherwise do nothing
+ if (myIndex > 0) {
+ views.get(myIndex - 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (handleKeyEvent) {
- // Select the next button, otherwise snap to the next page
- if (buttonIndex < (buttonCount - 1)) {
- parent.getChildAt(buttonIndex + 1).requestFocus();
- } else {
- workspace.snapToPage(pageIndex + 1);
+ ArrayList<View> views = getCellLayoutChildrenSortedSpatially(layout, parent);
+ int myIndex = views.indexOf(v);
+ // Select the next button, otherwise do nothing
+ if (myIndex < views.size() - 1) {
+ views.get(myIndex + 1).requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_UP:
if (handleKeyEvent) {
- // Select the first bubble text view in the current page of the workspace
- final CellLayout layout = (CellLayout) workspace.getChildAt(pageIndex);
- final ShortcutAndWidgetContainer children = layout.getShortcutsAndWidgets();
- final View newIcon = getIconInDirection(layout, children, -1, 1);
- if (newIcon != null) {
- newIcon.requestFocus();
- } else {
- workspace.requestFocus();
+ final Workspace workspace = (Workspace)
+ v.getRootView().findViewById(R.id.workspace);
+ if (workspace != null) {
+ int pageIndex = workspace.getCurrentPage();
+ CellLayout topLayout = (CellLayout) workspace.getChildAt(pageIndex);
+ ShortcutAndWidgetContainer children = topLayout.getShortcutsAndWidgets();
+ final View newIcon = getIconInDirection(layout, children, -1, 1);
+ // Select the first bubble text view in the current page of the workspace
+ if (newIcon != null) {
+ newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
+ } else {
+ workspace.requestFocus();
+ }
}
}
wasHandled = true;
@@ -504,8 +519,8 @@
*/
private static ShortcutAndWidgetContainer getCellLayoutChildrenForIndex(
ViewGroup container, int i) {
- ViewGroup parent = (ViewGroup) container.getChildAt(i);
- return (ShortcutAndWidgetContainer) parent.getChildAt(0);
+ CellLayout parent = (CellLayout) container.getChildAt(i);
+ return parent.getShortcutsAndWidgets();
}
/**
@@ -629,6 +644,7 @@
View newIcon = getIconInDirection(layout, parent, v, -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
} else {
if (pageIndex > 0) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex - 1);
@@ -640,6 +656,7 @@
// Snap to the previous page
workspace.snapToPage(pageIndex - 1);
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
}
}
}
@@ -651,6 +668,7 @@
View newIcon = getIconInDirection(layout, parent, v, 1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
} else {
if (pageIndex < (pageCount - 1)) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex + 1);
@@ -661,6 +679,7 @@
// Snap to the next page
workspace.snapToPage(pageIndex + 1);
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
}
}
}
@@ -676,6 +695,7 @@
} else {
tabs.requestFocus();
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
@@ -684,9 +704,11 @@
View newIcon = getClosestIconOnLine(layout, parent, v, 1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
wasHandled = true;
} else if (hotseat != null) {
hotseat.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
break;
@@ -703,10 +725,12 @@
// Snap to the previous page
workspace.snapToPage(pageIndex - 1);
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
} else {
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
}
@@ -725,11 +749,13 @@
// Snap to the next page
workspace.snapToPage(pageIndex + 1);
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
} else {
View newIcon = getIconInDirection(layout, parent,
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
}
@@ -741,6 +767,7 @@
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
@@ -752,6 +779,7 @@
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
wasHandled = true;
@@ -781,6 +809,7 @@
View newIcon = getIconInDirection(layout, parent, v, -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
}
}
wasHandled = true;
@@ -794,6 +823,7 @@
} else {
title.requestFocus();
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
}
wasHandled = true;
break;
@@ -803,6 +833,7 @@
View newIcon = getClosestIconOnLine(layout, parent, v, -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
@@ -816,6 +847,7 @@
} else {
title.requestFocus();
}
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
wasHandled = true;
break;
@@ -825,6 +857,7 @@
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
@@ -836,6 +869,7 @@
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
+ v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
wasHandled = true;
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index c548a6f..1890af4 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -118,10 +118,6 @@
private FocusIndicatorView mFocusIndicatorHandler;
- private int DRAG_MODE_NONE = 0;
- private int DRAG_MODE_REORDER = 1;
- private int mDragMode = DRAG_MODE_NONE;
-
// We avoid measuring the scroll view with a 0 width or height, as this
// results in CellLayout being measured as UNSPECIFIED, which it does
// not support.
@@ -252,9 +248,6 @@
return false;
}
- mLauncher.getLauncherClings().dismissFolderCling(null);
-
- mLauncher.getWorkspace().onDragStartedWithItem(v);
mLauncher.getWorkspace().beginDragShared(v, this);
mCurrentDragInfo = item;
@@ -468,7 +461,7 @@
Animator openFolderAnim = null;
final Runnable onCompleteRunnable;
- if (!Utilities.isLmp()) {
+ if (!Utilities.isLmpOrAbove()) {
positionAndSizeAsIcon();
centerAboutIcon();
@@ -558,15 +551,6 @@
onCompleteRunnable.run();
}
- // Only show cling if we are not in the middle of a drag - this would be quite jarring.
- if (!mDragController.isDragging()) {
- Cling cling = mLauncher.getLauncherClings().showFoldersCling();
- if (cling != null) {
- cling.bringScrimToFront();
- bringToFront();
- cling.bringToFront();
- }
- }
setFocusOnFirstChild();
}
});
@@ -783,9 +767,6 @@
mReorderAlarm.setAlarm(REORDER_DELAY);
mPreviousTargetCell[0] = mTargetCell[0];
mPreviousTargetCell[1] = mTargetCell[1];
- mDragMode = DRAG_MODE_REORDER;
- } else {
- mDragMode = DRAG_MODE_NONE;
}
}
}
@@ -841,7 +822,6 @@
mOnExitAlarm.setAlarm(ON_EXIT_CLOSE_DELAY);
}
mReorderAlarm.cancelAlarm();
- mDragMode = DRAG_MODE_NONE;
}
public void onDropCompleted(final View target, final DragObject d,
@@ -1315,6 +1295,8 @@
mSuppressOnAdd = true;
mInfo.add(si);
mSuppressOnAdd = false;
+ // Clear the drag info, as it is no longer being dragged.
+ mCurrentDragInfo = null;
}
// This is used so the item doesn't immediately appear in the folder when added. In one case
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index 21efd71..a359f11 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -583,9 +583,10 @@
d.setBounds(0, 0, mIntrinsicIconSize, mIntrinsicIconSize);
if (d instanceof FastBitmapDrawable) {
FastBitmapDrawable fd = (FastBitmapDrawable) d;
- fd.addBrightness(params.overlayAlpha);
+ int oldBrightness = fd.getBrightness();
+ fd.setBrightness(params.overlayAlpha);
d.draw(canvas);
- fd.addBrightness(-params.overlayAlpha);
+ fd.setBrightness(oldBrightness);
} else {
d.setColorFilter(Color.argb(params.overlayAlpha, 255, 255, 255),
PorterDuff.Mode.SRC_ATOP);
diff --git a/src/com/android/launcher3/HideFromAccessibilityHelper.java b/src/com/android/launcher3/HideFromAccessibilityHelper.java
deleted file mode 100644
index 75cbb1b..0000000
--- a/src/com/android/launcher3/HideFromAccessibilityHelper.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3;
-
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.OnHierarchyChangeListener;
-
-import java.util.HashMap;
-
-public class HideFromAccessibilityHelper implements OnHierarchyChangeListener {
- private HashMap<View, Integer> mPreviousValues;
- boolean mHide;
- boolean mOnlyAllApps;
-
- public HideFromAccessibilityHelper() {
- mPreviousValues = new HashMap<View, Integer>();
- mHide = false;
- }
-
- public void setImportantForAccessibilityToNo(View v, boolean onlyAllApps) {
- mOnlyAllApps = onlyAllApps;
- setImportantForAccessibilityToNoHelper(v);
- mHide = true;
- }
-
- private void setImportantForAccessibilityToNoHelper(View v) {
- mPreviousValues.put(v, v.getImportantForAccessibility());
- v.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
-
- // Call method on children recursively
- if (v instanceof ViewGroup) {
- ViewGroup vg = (ViewGroup) v;
- vg.setOnHierarchyChangeListener(this);
- for (int i = 0; i < vg.getChildCount(); i++) {
- View child = vg.getChildAt(i);
-
- if (includeView(child)) {
- setImportantForAccessibilityToNoHelper(child);
- }
- }
- }
- }
-
- public void restoreImportantForAccessibility(View v) {
- if (mHide) {
- restoreImportantForAccessibilityHelper(v);
- }
- mHide = false;
- }
-
- private void restoreImportantForAccessibilityHelper(View v) {
- Integer important = mPreviousValues.get(v);
- v.setImportantForAccessibility(important);
- mPreviousValues.remove(v);
-
- // Call method on children recursively
- if (v instanceof ViewGroup) {
- ViewGroup vg = (ViewGroup) v;
-
- // We assume if a class implements OnHierarchyChangeListener, it listens
- // to changes to any of its children (happens to be the case in Launcher)
- if (vg instanceof OnHierarchyChangeListener) {
- vg.setOnHierarchyChangeListener((OnHierarchyChangeListener) vg);
- } else {
- vg.setOnHierarchyChangeListener(null);
- }
- for (int i = 0; i < vg.getChildCount(); i++) {
- View child = vg.getChildAt(i);
- if (includeView(child)) {
- restoreImportantForAccessibilityHelper(child);
- }
- }
- }
- }
-
- public void onChildViewAdded(View parent, View child) {
- if (mHide && includeView(child)) {
- setImportantForAccessibilityToNoHelper(child);
- }
- }
-
- public void onChildViewRemoved(View parent, View child) {
- if (mHide && includeView(child)) {
- restoreImportantForAccessibilityHelper(child);
- }
- }
-
- private boolean includeView(View v) {
- return !hasAncestorOfType(v, Cling.class) &&
- (!mOnlyAllApps || hasAncestorOfType(v, AppsCustomizeTabHost.class));
- }
-
- private boolean hasAncestorOfType(View v, Class c) {
- return v != null &&
- (v.getClass().equals(c) ||
- (v.getParent() instanceof ViewGroup &&
- hasAncestorOfType((ViewGroup) v.getParent(), c)));
- }
-}
\ No newline at end of file
diff --git a/src/com/android/launcher3/HolographicOutlineHelper.java b/src/com/android/launcher3/HolographicOutlineHelper.java
index d7b960a..b1e0e68 100644
--- a/src/com/android/launcher3/HolographicOutlineHelper.java
+++ b/src/com/android/launcher3/HolographicOutlineHelper.java
@@ -20,48 +20,49 @@
import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
+import android.graphics.Rect;
+import android.graphics.Region.Op;
public class HolographicOutlineHelper {
- private final Paint mHolographicPaint = new Paint();
+
+ private static final Rect sTempRect = new Rect();
+
+ private final Canvas mCanvas = new Canvas();
+ private final Paint mDrawPaint = new Paint();
private final Paint mBlurPaint = new Paint();
private final Paint mErasePaint = new Paint();
- public int mMaxOuterBlurRadius;
- public int mMinOuterBlurRadius;
+ private final BlurMaskFilter mMediumOuterBlurMaskFilter;
+ private final BlurMaskFilter mThinOuterBlurMaskFilter;
+ private final BlurMaskFilter mMediumInnerBlurMaskFilter;
- private BlurMaskFilter mExtraThickOuterBlurMaskFilter;
- private BlurMaskFilter mThickOuterBlurMaskFilter;
- private BlurMaskFilter mMediumOuterBlurMaskFilter;
- private BlurMaskFilter mThinOuterBlurMaskFilter;
- private BlurMaskFilter mThickInnerBlurMaskFilter;
- private BlurMaskFilter mExtraThickInnerBlurMaskFilter;
- private BlurMaskFilter mMediumInnerBlurMaskFilter;
+ private final BlurMaskFilter mShaowBlurMaskFilter;
+ private final int mShadowOffset;
- private static final int THICK = 0;
- private static final int MEDIUM = 1;
- private static final int EXTRA_THICK = 2;
+ /**
+ * Padding used when creating shadow bitmap;
+ */
+ final int shadowBitmapPadding;
static HolographicOutlineHelper INSTANCE;
private HolographicOutlineHelper(Context context) {
final float scale = LauncherAppState.getInstance().getScreenDensity();
- mMinOuterBlurRadius = (int) (scale * 1.0f);
- mMaxOuterBlurRadius = (int) (scale * 12.0f);
-
- mExtraThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 12.0f, BlurMaskFilter.Blur.OUTER);
- mThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.OUTER);
mMediumOuterBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.OUTER);
mThinOuterBlurMaskFilter = new BlurMaskFilter(scale * 1.0f, BlurMaskFilter.Blur.OUTER);
- mExtraThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.NORMAL);
- mThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL);
mMediumInnerBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.NORMAL);
- mHolographicPaint.setFilterBitmap(true);
- mHolographicPaint.setAntiAlias(true);
+ mShaowBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL);
+ mShadowOffset = (int) (scale * 2.0f);
+ shadowBitmapPadding = (int) (scale * 4.0f);
+
+ mDrawPaint.setFilterBitmap(true);
+ mDrawPaint.setAntiAlias(true);
mBlurPaint.setFilterBitmap(true);
mBlurPaint.setAntiAlias(true);
mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
@@ -77,37 +78,15 @@
}
/**
- * Returns the interpolated holographic highlight alpha for the effect we want when scrolling
- * pages.
- */
- public static float highlightAlphaInterpolator(float r) {
- float maxAlpha = 0.6f;
- return (float) Math.pow(maxAlpha * (1.0f - r), 1.5f);
- }
-
- /**
- * Returns the interpolated view alpha for the effect we want when scrolling pages.
- */
- public static float viewAlphaInterpolator(float r) {
- final float pivot = 0.95f;
- if (r < pivot) {
- return (float) Math.pow(r / pivot, 1.5f);
- } else {
- return 1.0f;
- }
- }
-
- /**
* Applies a more expensive and accurate outline to whatever is currently drawn in a specified
* bitmap.
*/
void applyExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor, int thickness) {
- applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, true,
- thickness);
+ int outlineColor) {
+ applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, true);
}
void applyExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor, boolean clipAlpha, int thickness) {
+ int outlineColor, boolean clipAlpha) {
// We start by removing most of the alpha channel so as to ignore shadows, and
// other types of partial transparency when defining the shape of the object
@@ -127,50 +106,18 @@
Bitmap glowShape = srcDst.extractAlpha();
// calculate the outer blur first
- BlurMaskFilter outerBlurMaskFilter;
- switch (thickness) {
- case EXTRA_THICK:
- outerBlurMaskFilter = mExtraThickOuterBlurMaskFilter;
- break;
- case THICK:
- outerBlurMaskFilter = mThickOuterBlurMaskFilter;
- break;
- case MEDIUM:
- outerBlurMaskFilter = mMediumOuterBlurMaskFilter;
- break;
- default:
- throw new RuntimeException("Invalid blur thickness");
- }
- mBlurPaint.setMaskFilter(outerBlurMaskFilter);
+ mBlurPaint.setMaskFilter(mMediumOuterBlurMaskFilter);
int[] outerBlurOffset = new int[2];
Bitmap thickOuterBlur = glowShape.extractAlpha(mBlurPaint, outerBlurOffset);
- if (thickness == EXTRA_THICK) {
- mBlurPaint.setMaskFilter(mMediumOuterBlurMaskFilter);
- } else {
- mBlurPaint.setMaskFilter(mThinOuterBlurMaskFilter);
- }
+ mBlurPaint.setMaskFilter(mThinOuterBlurMaskFilter);
int[] brightOutlineOffset = new int[2];
Bitmap brightOutline = glowShape.extractAlpha(mBlurPaint, brightOutlineOffset);
// calculate the inner blur
srcDstCanvas.setBitmap(glowShape);
srcDstCanvas.drawColor(0xFF000000, PorterDuff.Mode.SRC_OUT);
- BlurMaskFilter innerBlurMaskFilter;
- switch (thickness) {
- case EXTRA_THICK:
- innerBlurMaskFilter = mExtraThickInnerBlurMaskFilter;
- break;
- case THICK:
- innerBlurMaskFilter = mThickInnerBlurMaskFilter;
- break;
- case MEDIUM:
- innerBlurMaskFilter = mMediumInnerBlurMaskFilter;
- break;
- default:
- throw new RuntimeException("Invalid blur thickness");
- }
- mBlurPaint.setMaskFilter(innerBlurMaskFilter);
+ mBlurPaint.setMaskFilter(mMediumInnerBlurMaskFilter);
int[] thickInnerBlurOffset = new int[2];
Bitmap thickInnerBlur = glowShape.extractAlpha(mBlurPaint, thickInnerBlurOffset);
@@ -186,16 +133,16 @@
// draw the inner and outer blur
srcDstCanvas.setBitmap(srcDst);
srcDstCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
- mHolographicPaint.setColor(color);
+ mDrawPaint.setColor(color);
srcDstCanvas.drawBitmap(thickInnerBlur, thickInnerBlurOffset[0], thickInnerBlurOffset[1],
- mHolographicPaint);
+ mDrawPaint);
srcDstCanvas.drawBitmap(thickOuterBlur, outerBlurOffset[0], outerBlurOffset[1],
- mHolographicPaint);
+ mDrawPaint);
// draw the bright outline
- mHolographicPaint.setColor(outlineColor);
+ mDrawPaint.setColor(outlineColor);
srcDstCanvas.drawBitmap(brightOutline, brightOutlineOffset[0], brightOutlineOffset[1],
- mHolographicPaint);
+ mDrawPaint);
// cleanup
srcDstCanvas.setBitmap(null);
@@ -205,25 +152,52 @@
glowShape.recycle();
}
- void applyExtraThickExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor) {
- applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, EXTRA_THICK);
- }
+ Bitmap createMediumDropShadow(BubbleTextView view) {
+ final Bitmap result = Bitmap.createBitmap(
+ view.getWidth() + shadowBitmapPadding + shadowBitmapPadding,
+ view.getHeight() + shadowBitmapPadding + shadowBitmapPadding + mShadowOffset,
+ Bitmap.Config.ARGB_8888);
- void applyThickExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor) {
- applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, THICK);
- }
+ mCanvas.setBitmap(result);
- void applyMediumExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor, boolean clipAlpha) {
- applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, clipAlpha,
- MEDIUM);
- }
+ final Rect clipRect = sTempRect;
+ view.getDrawingRect(sTempRect);
+ // adjust the clip rect so that we don't include the text label
+ clipRect.bottom = view.getExtendedPaddingTop() - (int) BubbleTextView.PADDING_V
+ + view.getLayout().getLineTop(0);
- void applyMediumExpensiveOutlineWithBlur(Bitmap srcDst, Canvas srcDstCanvas, int color,
- int outlineColor) {
- applyExpensiveOutlineWithBlur(srcDst, srcDstCanvas, color, outlineColor, MEDIUM);
- }
+ // Draw the View into the bitmap.
+ // The translate of scrollX and scrollY is necessary when drawing TextViews, because
+ // they set scrollX and scrollY to large values to achieve centered text
+ mCanvas.save();
+ mCanvas.scale(view.getScaleX(), view.getScaleY(),
+ view.getWidth() / 2 + shadowBitmapPadding,
+ view.getHeight() / 2 + shadowBitmapPadding);
+ mCanvas.translate(-view.getScrollX() + shadowBitmapPadding,
+ -view.getScrollY() + shadowBitmapPadding);
+ mCanvas.clipRect(clipRect, Op.REPLACE);
+ view.draw(mCanvas);
+ mCanvas.restore();
+ int[] blurOffst = new int[2];
+ mBlurPaint.setMaskFilter(mShaowBlurMaskFilter);
+ Bitmap blurBitmap = result.extractAlpha(mBlurPaint, blurOffst);
+
+ mCanvas.save();
+ mCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
+ mCanvas.translate(blurOffst[0], blurOffst[1]);
+
+ mDrawPaint.setColor(Color.BLACK);
+ mDrawPaint.setAlpha(30);
+ mCanvas.drawBitmap(blurBitmap, 0, 0, mDrawPaint);
+
+ mDrawPaint.setAlpha(60);
+ mCanvas.drawBitmap(blurBitmap, 0, mShadowOffset, mDrawPaint);
+ mCanvas.restore();
+
+ mCanvas.setBitmap(null);
+ blurBitmap.recycle();
+
+ return result;
+ }
}
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 3d6befa..b08272f 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -64,7 +64,6 @@
public void setup(Launcher launcher) {
mLauncher = launcher;
- setOnKeyListener(new HotseatIconKeyEventListener());
}
CellLayout getLayout() {
@@ -155,6 +154,7 @@
allAppsButton.setCompoundDrawables(null, d, null, null);
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
+ allAppsButton.setOnKeyListener(new HotseatIconKeyEventListener());
if (mLauncher != null) {
allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
mLauncher.setAllAppsButton(allAppsButton);
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 06b7775..bb71d77 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -29,7 +29,9 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
+import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
+import android.text.TextUtils;
import android.util.Log;
import com.android.launcher3.compat.LauncherActivityInfoCompat;
@@ -61,7 +63,7 @@
// Empty class name is used for storing package default entry.
private static final String EMPTY_CLASS_NAME = ".";
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private static class CacheEntry {
public Bitmap icon;
@@ -146,6 +148,10 @@
return getFullResDefaultActivityIcon();
}
+ public int getFullResIconDpi() {
+ return mIconDpi;
+ }
+
public Drawable getFullResIcon(ResolveInfo info) {
return getFullResIcon(info.activityInfo);
}
@@ -224,7 +230,8 @@
Iterator<Entry<CacheKey, CacheEntry>> it = mCache.entrySet().iterator();
while (it.hasNext()) {
final CacheEntry e = it.next().getValue();
- if (e.icon.getWidth() < grid.iconSizePx || e.icon.getHeight() < grid.iconSizePx) {
+ if ((e.icon != null) && (e.icon.getWidth() < grid.iconSizePx
+ || e.icon.getHeight() < grid.iconSizePx)) {
it.remove();
}
}
@@ -250,18 +257,16 @@
return getIcon(intent, null, user, true);
}
- public Bitmap getIcon(Intent intent, String title, UserHandleCompat user, boolean usePkgIcon) {
+ private Bitmap getIcon(Intent intent, String title, UserHandleCompat user, boolean usePkgIcon) {
synchronized (mCache) {
- LauncherActivityInfoCompat launcherActInfo =
- mLauncherApps.resolveActivity(intent, user);
ComponentName component = intent.getComponent();
-
// null info means not installed, but if we have a component from the intent then
// we should still look in the cache for restored app icons.
if (component == null) {
return getDefaultIcon(user);
}
+ LauncherActivityInfoCompat launcherActInfo = mLauncherApps.resolveActivity(intent, user);
CacheEntry entry = cacheLocked(component, launcherActInfo, null, user, usePkgIcon);
if (title != null) {
entry.title = title;
@@ -271,6 +276,32 @@
}
}
+ /**
+ * Fill in "shortcutInfo" with the icon and label for "info."
+ */
+ public void getTitleAndIcon(ShortcutInfo shortcutInfo, Intent intent, UserHandleCompat user,
+ boolean usePkgIcon) {
+ synchronized (mCache) {
+ ComponentName component = intent.getComponent();
+ // null info means not installed, but if we have a component from the intent then
+ // we should still look in the cache for restored app icons.
+ if (component == null) {
+ shortcutInfo.setIcon(getDefaultIcon(user));
+ shortcutInfo.title = "";
+ shortcutInfo.usingFallbackIcon = true;
+ } else {
+ LauncherActivityInfoCompat launcherActInfo =
+ mLauncherApps.resolveActivity(intent, user);
+ CacheEntry entry = cacheLocked(component, launcherActInfo, null, user, usePkgIcon);
+
+ shortcutInfo.setIcon(entry.icon);
+ shortcutInfo.title = entry.title;
+ shortcutInfo.usingFallbackIcon = isDefaultIcon(entry.icon, user);
+ }
+ }
+ }
+
+
public Bitmap getDefaultIcon(UserHandleCompat user) {
if (!mDefaultIcons.containsKey(user)) {
mDefaultIcons.put(user, makeDefaultIcon(user));
@@ -328,10 +359,11 @@
if (usePackageIcon) {
CacheEntry packageEntry = getEntryForPackage(
componentName.getPackageName(), user);
- if (packageEntry != null && packageEntry.icon != null) {
+ if (packageEntry != null) {
if (DEBUG) Log.d(TAG, "using package default icon for " +
componentName.toShortString());
entry.icon = packageEntry.icon;
+ entry.title = packageEntry.title;
}
}
if (entry.icon == null) {
@@ -346,6 +378,24 @@
}
/**
+ * Adds a default package entry in the cache. This entry is not persisted and will be removed
+ * when the cache is flushed.
+ */
+ public void cachePackageInstallInfo(String packageName, UserHandleCompat user,
+ Bitmap icon, CharSequence title) {
+ remove(packageName, user);
+
+ CacheEntry entry = getEntryForPackage(packageName, user);
+ if (!TextUtils.isEmpty(title)) {
+ entry.title = title;
+ }
+ if (icon != null) {
+ entry.icon = Utilities.createIconBitmap(
+ new BitmapDrawable(mContext.getResources(), icon), mContext);
+ }
+ }
+
+ /**
* Gets an entry for the package, which can be used as a fallback entry for various components.
*/
private CacheEntry getEntryForPackage(String packageName, UserHandleCompat user) {
@@ -354,6 +404,7 @@
CacheEntry entry = mCache.get(cacheKey);
if (entry == null) {
entry = new CacheEntry();
+ entry.title = "";
mCache.put(cacheKey, entry);
try {
@@ -465,7 +516,7 @@
Log.w(TAG, "failed to decode pre-load icon for " + key);
}
} catch (FileNotFoundException e) {
- if (DEBUG) Log.d(TAG, "there is no restored icon for: " + key, e);
+ if (DEBUG) Log.d(TAG, "there is no restored icon for: " + key);
} catch (IOException e) {
Log.w(TAG, "failed to read pre-load icon for: " + key, e);
} finally {
diff --git a/src/com/android/launcher3/ItemInfo.java b/src/com/android/launcher3/ItemInfo.java
index 8f96f74..09b77f7 100644
--- a/src/com/android/launcher3/ItemInfo.java
+++ b/src/com/android/launcher3/ItemInfo.java
@@ -146,10 +146,6 @@
throw new RuntimeException("Unexpected Intent");
}
- protected Intent getRestoredIntent() {
- throw new RuntimeException("Unexpected Intent");
- }
-
/**
* Write the fields of this item to the DB
*
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 88a60d0..42ec4fb 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -22,6 +22,7 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
+import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.Activity;
@@ -58,6 +59,7 @@
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
+import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
@@ -71,6 +73,7 @@
import android.text.method.TextKeyListener;
import android.util.DisplayMetrics;
import android.util.Log;
+import android.view.ContextThemeWrapper;
import android.view.Display;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
@@ -91,6 +94,7 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
+import android.view.animation.Interpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.Advanceable;
import android.widget.FrameLayout;
@@ -100,6 +104,7 @@
import com.android.launcher3.DropTarget.DragObject;
import com.android.launcher3.PagedView.PageSwitchListener;
+import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.LauncherActivityInfoCompat;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.PackageInstallerCompat;
@@ -126,7 +131,6 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-
/**
* Default launcher application.
*/
@@ -256,9 +260,8 @@
private DragLayer mDragLayer;
private DragController mDragController;
private View mWeightWatcher;
- private LauncherClings mLauncherClings;
- private AppWidgetManager mAppWidgetManager;
+ private AppWidgetManagerCompat mAppWidgetManager;
private LauncherAppWidgetHost mAppWidgetHost;
private ItemInfo mPendingAddInfo = new ItemInfo();
@@ -434,12 +437,11 @@
mIconCache = app.getIconCache();
mIconCache.flushInvalidIcons(grid);
mDragController = new DragController(this);
- mLauncherClings = new LauncherClings(this);
mInflater = getLayoutInflater();
mStats = new Stats(this);
- mAppWidgetManager = AppWidgetManager.getInstance(this);
+ mAppWidgetManager = AppWidgetManagerCompat.getInstance(this);
mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
mAppWidgetHost.startListening();
@@ -499,19 +501,7 @@
showIntroScreen();
} else {
showFirstRunActivity();
- }
-
- // The two first run cling paths are mutually exclusive, if the launcher is preinstalled
- // on the device, then we always show the first run cling experience (or if there is no
- // launcher2). Otherwise, we prompt the user upon started for migration
- if (mLauncherClings.shouldShowFirstRunOrMigrationClings()) {
- if (mModel.canMigrateFromOldLauncherDb(this)) {
- mLauncherClings.showMigrationCling();
- } else {
- mLauncherClings.showFirstRunCling();
- }
- } else {
- mLauncherClings.removeFirstRunAndMigrationClings();
+ showFirstRunClings();
}
}
@@ -699,19 +689,20 @@
}
}
- /**
- * Copied from View -- the View version of the method isn't called
- * anywhere else in our process and only exists for API level 17+,
- * so it's ok to keep our own version with no API requirement.
- */
public static int generateViewId() {
- for (;;) {
- final int result = sNextGeneratedId.get();
- // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
- int newValue = result + 1;
- if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.
- if (sNextGeneratedId.compareAndSet(result, newValue)) {
- return result;
+ if (Build.VERSION.SDK_INT >= 17) {
+ return View.generateViewId();
+ } else {
+ // View.generateViewId() is not available. The following fallback logic is a copy
+ // of its implementation.
+ for (;;) {
+ final int result = sNextGeneratedId.get();
+ // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
+ int newValue = result + 1;
+ if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.
+ if (sNextGeneratedId.compareAndSet(result, newValue)) {
+ return result;
+ }
}
}
}
@@ -732,8 +723,13 @@
* a configuration step, this allows the proper animations to run after other transitions.
*/
private long completeAdd(PendingAddArguments args) {
+ long screenId = args.screenId;
+ if (args.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+ // When the screen id represents an actual screen (as opposed to a rank) we make sure
+ // that the drop page actually exists.
+ screenId = ensurePendingDropLayoutExists(args.screenId);
+ }
- long screenId = ensurePendingDropLayoutExists(args.screenId);
switch (args.requestCode) {
case REQUEST_CREATE_SHORTCUT:
completeAddShortcut(args.intent, args.container, screenId, args.cellX,
@@ -825,7 +821,12 @@
}
} else {
if (!workspaceLocked) {
- mPendingAddInfo.screenId = ensurePendingDropLayoutExists(mPendingAddInfo.screenId);
+ if (mPendingAddInfo.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+ // When the screen id represents an actual screen (as opposed to a rank)
+ // we make sure that the drop page actually exists.
+ mPendingAddInfo.screenId =
+ ensurePendingDropLayoutExists(mPendingAddInfo.screenId);
+ }
final CellLayout dropLayout = mWorkspace.getScreenWithId(mPendingAddInfo.screenId);
dropLayout.setDropPending(true);
@@ -1026,10 +1027,6 @@
// Resets the previous workspace icon press state
mWaitingForResume.setStayPressed(false);
}
- if (mAppsCustomizeContent != null) {
- // Resets the previous all apps icon press state
- mAppsCustomizeContent.resetDrawableState();
- }
// It is possible that widgets can receive updates while launcher is not in the foreground.
// Consequently, the widgets will be inflated in the orientation of the foreground activity
@@ -1138,7 +1135,9 @@
@Override
public Object onRetainNonConfigurationInstance() {
// Flag the loader to stop early before switching
- mModel.stopLoader();
+ if (mModel.isCurrentCallbacks(this)) {
+ mModel.stopLoader();
+ }
if (mAppsCustomizeContent != null) {
mAppsCustomizeContent.surrender();
}
@@ -1574,6 +1573,7 @@
launcherInfo.spanY = spanXY[1];
launcherInfo.minSpanX = mPendingAddInfo.minSpanX;
launcherInfo.minSpanY = mPendingAddInfo.minSpanY;
+ launcherInfo.user = mAppWidgetManager.getUser(appWidgetInfo);
LauncherModel.addItemToDatabase(this, launcherInfo,
container, screenId, cellXY[0], cellXY[1], false);
@@ -1664,7 +1664,7 @@
// TODO(sansid): use the APIs directly when compiling against L sdk.
// Currently we use reflection to access the flags and the API to set the transparency
// on the System bars.
- if (Utilities.isLmp()) {
+ if (Utilities.isLmpOrAbove()) {
try {
getWindow().getAttributes().systemUiVisibility |=
(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
@@ -1852,10 +1852,6 @@
return mModel;
}
- public LauncherClings getLauncherClings() {
- return mLauncherClings;
- }
-
protected SharedPreferences getSharedPrefs() {
return mSharedPrefs;
}
@@ -2004,8 +2000,13 @@
// Stop callbacks from LauncherModel
LauncherAppState app = (LauncherAppState.getInstance());
- mModel.stopLoader();
- app.setLauncher(null);
+
+ // It's possible to receive onDestroy after a new Launcher activity has
+ // been created. In this case, don't interfere with the new Launcher.
+ if (mModel.isCurrentCallbacks(this)) {
+ mModel.stopLoader();
+ app.setLauncher(null);
+ }
try {
mAppWidgetHost.stopListening();
@@ -2072,14 +2073,25 @@
sourceBounds = mSearchDropTargetBar.getSearchBarBounds();
}
- startSearch(initialQuery, selectInitialQuery,
+ boolean clearTextImmediately = startSearch(initialQuery, selectInitialQuery,
appSearchData, sourceBounds);
+ if (clearTextImmediately) {
+ clearTypedText();
+ }
}
- public void startSearch(String initialQuery,
+ /**
+ * Start a text search.
+ *
+ * @return {@code true} if the search will start immediately, so any further keypresses
+ * will be handled directly by the search UI. {@code false} if {@link Launcher} should continue
+ * to buffer keypresses.
+ */
+ public boolean startSearch(String initialQuery,
boolean selectInitialQuery, Bundle appSearchData, Rect sourceBounds) {
startGlobalSearch(initialQuery, selectInitialQuery,
appSearchData, sourceBounds);
+ return false;
}
/**
@@ -2199,10 +2211,9 @@
mPendingAddWidgetId = appWidgetId;
// Launch over to configure widget, if needed
- Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
- intent.setComponent(appWidgetInfo.configure);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
- Utilities.startActivityForResultSafely(this, intent, REQUEST_CREATE_APPWIDGET);
+ mAppWidgetManager.startConfigActivity(appWidgetInfo, appWidgetId, this,
+ mAppWidgetHost, REQUEST_CREATE_APPWIDGET);
+
} else {
// Otherwise just add it
Runnable onComplete = new Runnable() {
@@ -2286,14 +2297,8 @@
appWidgetId = getAppWidgetHost().allocateAppWidgetId();
Bundle options = info.bindOptions;
- boolean success = false;
- if (options != null) {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- info.componentName, options);
- } else {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- info.componentName);
- }
+ boolean success = mAppWidgetManager.bindAppWidgetIdIfAllowed(
+ appWidgetId, info.info, options);
if (success) {
addAppWidgetImpl(appWidgetId, info, null, info.info);
} else {
@@ -2301,6 +2306,8 @@
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, info.componentName);
+ mAppWidgetManager.getUser(mPendingAddWidgetInfo)
+ .addToIntent(intent, AppWidgetManager.EXTRA_APPWIDGET_PROVIDER_PROFILE);
// TODO: we need to make sure that this accounts for the options bundle.
// intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options);
startActivityForResult(intent, REQUEST_BIND_APPWIDGET);
@@ -2451,6 +2458,8 @@
}
} else if (v == mAllAppsButton) {
onClickAllAppsButton(v);
+ } else if (tag instanceof AppInfo) {
+ startAppShortcutOrInfoActivity(v);
} else if (tag instanceof LauncherAppWidgetInfo) {
if (v instanceof PendingAppWidgetHostView) {
onClickPendingWidget((PendingAppWidgetHostView) v);
@@ -2458,6 +2467,10 @@
}
}
+ public void onClickPagedViewIcon(View v) {
+ startAppShortcutOrInfoActivity(v);
+ }
+
public boolean onTouch(View v, MotionEvent event) {
return false;
}
@@ -2465,9 +2478,9 @@
/**
* Event handler for the app widget view which has not fully restored.
*/
- public void onClickPendingWidget(PendingAppWidgetHostView v) {
+ public void onClickPendingWidget(final PendingAppWidgetHostView v) {
+ final LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
if (v.isReadyForClickSetup()) {
- LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
int widgetId = info.appWidgetId;
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(widgetId);
if (appWidgetInfo != null) {
@@ -2475,11 +2488,22 @@
mPendingAddInfo.copyFrom(info);
mPendingAddWidgetId = widgetId;
- Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
- intent.setComponent(appWidgetInfo.configure);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, info.appWidgetId);
- Utilities.startActivityForResultSafely(this, intent, REQUEST_RECONFIGURE_APPWIDGET);
+ AppWidgetManagerCompat.getInstance(this).startConfigActivity(appWidgetInfo,
+ info.appWidgetId, this, mAppWidgetHost, REQUEST_RECONFIGURE_APPWIDGET);
}
+ } else if (info.installProgress < 0) {
+ // The install has not been queued
+ final String packageName = info.providerName.getPackageName();
+ showBrokenAppInstallDialog(packageName,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ startActivitySafely(v, LauncherModel.getMarketIntent(packageName), info);
+ }
+ });
+ } else {
+ // Download has started.
+ final String packageName = info.providerName.getPackageName();
+ startActivitySafely(v, LauncherModel.getMarketIntent(packageName), info);
}
}
@@ -2538,15 +2562,21 @@
}
}
- /**
- * Event handler for a paged view icon click.
- * @param v The view that was clicked.
- * @param appInfo The {link AppInfo} of the view.
- */
- public void onClickPagedViewIcon(View v, AppInfo appInfo) {
- if (LOGD) Log.d(TAG, "onClickPagedViewIcon");
- startActivitySafely(v, appInfo.intent, appInfo);
- getStats().recordLaunch(appInfo.intent);
+ private void showBrokenAppInstallDialog(final String packageName,
+ DialogInterface.OnClickListener onSearchClickListener) {
+ new AlertDialog.Builder(new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault))
+ .setTitle(R.string.abandoned_promises_title)
+ .setMessage(R.string.abandoned_promise_explanation)
+ .setPositiveButton(R.string.abandoned_search, onSearchClickListener)
+ .setNeutralButton(R.string.abandoned_clean_this,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ final UserHandleCompat user = UserHandleCompat.myUserHandle();
+ mWorkspace.removeAbandonedPromise(packageName, user);
+ }
+ })
+ .create().show();
+ return;
}
/**
@@ -2579,48 +2609,43 @@
}
// Check for abandoned promise
- if (shortcut.isAbandoned() && v instanceof BubbleTextView) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.abandoned_promises_title);
- builder.setMessage(R.string.abandoned_promise_explanation);
- builder.setPositiveButton(R.string.abandoned_search,
+ if ((v instanceof BubbleTextView)
+ && shortcut.isPromise()
+ && !shortcut.hasStatusFlag(ShortcutInfo.FLAG_INSTALL_SESSION_ACTIVE)) {
+ showBrokenAppInstallDialog(
+ shortcut.getTargetComponent().getPackageName(),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
- startAppShortcutActivity(v);
- }
- }
- );
- builder.setNeutralButton(R.string.abandoned_clean_this,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- final BubbleTextView bubble = (BubbleTextView) v;
- final UserHandleCompat user = UserHandleCompat.myUserHandle();
- mWorkspace.removeAbandonedPromise(bubble, user);
+ startAppShortcutOrInfoActivity(v);
}
});
- builder.create().show();
return;
}
// Start activities
- startAppShortcutActivity(v);
+ startAppShortcutOrInfoActivity(v);
}
- private void startAppShortcutActivity(View v) {
+ private void startAppShortcutOrInfoActivity(View v) {
Object tag = v.getTag();
- if (!(tag instanceof ShortcutInfo)) {
- throw new IllegalArgumentException("Input must be a Shortcut");
- }
- final ShortcutInfo shortcut = (ShortcutInfo) tag;
- final Intent intent = shortcut.intent;
+ final ShortcutInfo shortcut;
+ final Intent intent;
+ if (tag instanceof ShortcutInfo) {
+ shortcut = (ShortcutInfo) tag;
+ intent = shortcut.intent;
+ int[] pos = new int[2];
+ v.getLocationOnScreen(pos);
+ intent.setSourceBounds(new Rect(pos[0], pos[1],
+ pos[0] + v.getWidth(), pos[1] + v.getHeight()));
- int[] pos = new int[2];
- v.getLocationOnScreen(pos);
- intent.setSourceBounds(new Rect(pos[0], pos[1],
- pos[0] + v.getWidth(), pos[1] + v.getHeight()));
+ } else if (tag instanceof AppInfo) {
+ shortcut = null;
+ intent = ((AppInfo) tag).intent;
+ } else {
+ throw new IllegalArgumentException("Input must be a Shortcut or AppInfo");
+ }
boolean success = startActivitySafely(v, intent, tag);
-
mStats.recordLaunch(intent, shortcut);
if (success && v instanceof BubbleTextView) {
@@ -2803,7 +2828,7 @@
Bundle optsBundle = null;
if (useLaunchAnimation) {
- ActivityOptions opts = Utilities.isLmp() ?
+ ActivityOptions opts = Utilities.isLmpOrAbove() ?
ActivityOptions.makeCustomAnimation(this, R.anim.task_open_enter, R.anim.no_anim) :
ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
optsBundle = opts.toBundle();
@@ -2914,7 +2939,7 @@
ObjectAnimator oa = LauncherAnimUtils.ofPropertyValuesHolder(mFolderIconImageView, alpha,
scaleX, scaleY);
- if (Utilities.isLmp()) {
+ if (Utilities.isLmpOrAbove()) {
oa.setInterpolator(new LogDecelerateInterpolator(100, 0));
}
oa.setDuration(getResources().getInteger(R.integer.config_folderExpandDuration));
@@ -2987,9 +3012,6 @@
folder.dismissEditingName();
}
closeFolder(folder);
-
- // Dismiss the folder cling
- mLauncherClings.dismissFolderCling(null);
}
}
@@ -3191,7 +3213,7 @@
mStateAnimation = null;
}
- boolean material = Utilities.isLmp();
+ boolean material = Utilities.isLmpOrAbove();
final Resources res = getResources();
@@ -3205,19 +3227,23 @@
final View fromView = mWorkspace;
final AppsCustomizeTabHost toView = mAppsCustomizeTabHost;
+ final ArrayList<View> layerViews = new ArrayList<View>();
+
Workspace.State workspaceState = contentType == AppsCustomizePagedView.ContentType.Widgets ?
Workspace.State.OVERVIEW_HIDDEN : Workspace.State.NORMAL_HIDDEN;
Animator workspaceAnim =
- mWorkspace.getChangeStateAnimation(workspaceState, animated);
+ mWorkspace.getChangeStateAnimation(workspaceState, animated, layerViews);
if (!LauncherAppState.isDisableAllApps()
|| contentType == AppsCustomizePagedView.ContentType.Widgets) {
// Set the content type for the all apps/widgets space
mAppsCustomizeTabHost.setContentTypeImmediate(contentType);
}
- if (animated) {
- mStateAnimation = LauncherAnimUtils.createAnimatorSet();
+ // If for some reason our views aren't initialized, don't animate
+ boolean initialized = getAllAppsButton() != null;
+ if (animated && initialized) {
+ mStateAnimation = LauncherAnimUtils.createAnimatorSet();
final AppsCustomizePagedView content = (AppsCustomizePagedView)
toView.findViewById(R.id.apps_customize_pane_content);
@@ -3234,28 +3260,46 @@
}
// Hide the real page background, and swap in the fake one
- revealView.setVisibility(View.VISIBLE);
content.setPageBackgroundsVisible(false);
+ revealView.setVisibility(View.VISIBLE);
+ // We need to hide this view as the animation start will be posted.
+ revealView.setAlpha(0);
int width = revealView.getMeasuredWidth();
int height = revealView.getMeasuredHeight();
-
float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4);
+
revealView.setTranslationY(0);
+ revealView.setTranslationX(0);
// Get the y delta between the center of the page and the center of the all apps button
int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView,
getAllAppsButton(), null);
- float yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
- float initAlpha = isWidgetTray ? 0.3f : 1f;
+ float alpha = 0;
+ float xDrift = 0;
+ float yDrift = 0;
+ if (material) {
+ alpha = isWidgetTray ? 0.3f : 1f;
+ yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
+ xDrift = isWidgetTray ? 0 : allAppsToPanelDelta[0];
+ } else {
+ yDrift = 2 * height / 3;
+ xDrift = 0;
+ }
+ final float initAlpha = alpha;
+
revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ layerViews.add(revealView);
PropertyValuesHolder panelAlpha = PropertyValuesHolder.ofFloat("alpha", initAlpha, 1f);
- PropertyValuesHolder panelDrift =
+ PropertyValuesHolder panelDriftY =
PropertyValuesHolder.ofFloat("translationY", yDrift, 0);
+ PropertyValuesHolder panelDriftX =
+ PropertyValuesHolder.ofFloat("translationX", xDrift, 0);
- ObjectAnimator panelAlphaAndDrift =
- LauncherAnimUtils.ofPropertyValuesHolder(revealView, panelAlpha, panelDrift);
+ ObjectAnimator panelAlphaAndDrift = ObjectAnimator.ofPropertyValuesHolder(revealView,
+ panelAlpha, panelDriftY, panelDriftX);
+
panelAlphaAndDrift.setDuration(revealDuration);
panelAlphaAndDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
@@ -3264,15 +3308,17 @@
if (page != null) {
page.setVisibility(View.VISIBLE);
page.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ layerViews.add(page);
- ObjectAnimator pageDrift = LauncherAnimUtils.ofFloat(page, "translationY", yDrift, 0);
+ ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0);
+ page.setTranslationY(yDrift);
pageDrift.setDuration(revealDuration);
pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
pageDrift.setStartDelay(itemsAlphaStagger);
mStateAnimation.play(pageDrift);
page.setAlpha(0f);
- ObjectAnimator itemsAlpha = LauncherAnimUtils.ofFloat(page, "alpha", 0f, 1f);
+ ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0f, 1f);
itemsAlpha.setDuration(revealDuration);
itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f));
itemsAlpha.setStartDelay(itemsAlphaStagger);
@@ -3282,7 +3328,7 @@
View pageIndicators = toView.findViewById(R.id.apps_customize_page_indicator);
pageIndicators.setAlpha(0.01f);
ObjectAnimator indicatorsAlpha =
- LauncherAnimUtils.ofFloat(pageIndicators, "alpha", 1f);
+ ObjectAnimator.ofFloat(pageIndicators, "alpha", 1f);
indicatorsAlpha.setDuration(revealDuration);
mStateAnimation.play(indicatorsAlpha);
@@ -3291,7 +3337,7 @@
int allAppsButtonSize = LauncherAppState.getInstance().
getDynamicGrid().getDeviceProfile().allAppsButtonVisualSize;
float startRadius = isWidgetTray ? 0 : allAppsButtonSize / 2;
- Animator reveal = LauncherAnimUtils.createCircularReveal(revealView, width / 2,
+ Animator reveal = ViewAnimationUtils.createCircularReveal(revealView, width / 2,
height / 2, startRadius, revealRadius);
reveal.setDuration(revealDuration);
reveal.setInterpolator(new LogDecelerateInterpolator(100, 0));
@@ -3308,7 +3354,6 @@
}
}
});
-
mStateAnimation.play(reveal);
}
@@ -3331,29 +3376,14 @@
}
}
- @Override
- public void onAnimationStart(Animator animation) {
- // Prepare the position
- toView.bringToFront();
- toView.setVisibility(View.VISIBLE);
- }
});
- boolean delayAnim = false;
if (workspaceAnim != null) {
mStateAnimation.play(workspaceAnim);
}
+
dispatchOnLauncherTransitionPrepare(fromView, animated, false);
dispatchOnLauncherTransitionPrepare(toView, animated, false);
-
- // If any of the objects being animated haven't been measured/laid out
- // yet, delay the animation until we get a layout pass
- if ((((LauncherTransitionable) toView).getContent().getMeasuredWidth() == 0) ||
- (mWorkspace.getMeasuredWidth() == 0) ||
- (toView.getMeasuredWidth() == 0)) {
- delayAnim = true;
- }
-
final AnimatorSet stateAnimation = mStateAnimation;
final Runnable startAnimRunnable = new Runnable() {
public void run() {
@@ -3363,22 +3393,26 @@
return;
dispatchOnLauncherTransitionStart(fromView, animated, false);
dispatchOnLauncherTransitionStart(toView, animated, false);
- LauncherAnimUtils.startAnimationAfterNextDraw(mStateAnimation, toView);
+
+ revealView.setAlpha(initAlpha);
+ if (Utilities.isLmpOrAbove()) {
+ for (int i = 0; i < layerViews.size(); i++) {
+ View v = layerViews.get(i);
+ if (v != null) {
+ boolean attached = true;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ attached = v.isAttachedToWindow();
+ }
+ if (attached) v.buildLayer();
+ }
+ }
+ }
+ mStateAnimation.start();
}
};
- if (delayAnim) {
- toView.bringToFront();
- toView.setVisibility(View.VISIBLE);
- final ViewTreeObserver observer = toView.getViewTreeObserver();
- observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
- public void onGlobalLayout() {
- startAnimRunnable.run();
- toView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
- }
- });
- } else {
- startAnimRunnable.run();
- }
+ toView.bringToFront();
+ toView.setVisibility(View.VISIBLE);
+ toView.post(startAnimRunnable);
} else {
toView.setTranslationX(0.0f);
toView.setTranslationY(0.0f);
@@ -3416,7 +3450,7 @@
mStateAnimation = null;
}
- boolean material = Utilities.isLmp();
+ boolean material = Utilities.isLmpOrAbove();
Resources res = getResources();
final int duration = res.getInteger(R.integer.config_appsCustomizeZoomOutTime);
@@ -3430,125 +3464,168 @@
final View fromView = mAppsCustomizeTabHost;
final View toView = mWorkspace;
Animator workspaceAnim = null;
+ final ArrayList<View> layerViews = new ArrayList<View>();
+
if (toState == Workspace.State.NORMAL) {
workspaceAnim = mWorkspace.getChangeStateAnimation(
- toState, animated);
+ toState, animated, layerViews);
} else if (toState == Workspace.State.SPRING_LOADED ||
toState == Workspace.State.OVERVIEW) {
workspaceAnim = mWorkspace.getChangeStateAnimation(
- toState, animated);
+ toState, animated, layerViews);
}
- showHotseat(animated);
- if (animated) {
+ // If for some reason our views aren't initialized, don't animate
+ boolean initialized = getAllAppsButton() != null;
+
+ if (animated && initialized) {
mStateAnimation = LauncherAnimUtils.createAnimatorSet();
+ if (workspaceAnim != null) {
+ mStateAnimation.play(workspaceAnim);
+ }
final AppsCustomizePagedView content = (AppsCustomizePagedView)
fromView.findViewById(R.id.apps_customize_pane_content);
final View page = content.getPageAt(content.getNextPage());
+
+ // We need to hide side pages of the Apps / Widget tray to avoid some ugly edge cases
+ int count = content.getChildCount();
+ for (int i = 0; i < count; i++) {
+ View child = content.getChildAt(i);
+ if (child != page) {
+ child.setVisibility(View.INVISIBLE);
+ }
+ }
final View revealView = fromView.findViewById(R.id.fake_page);
- AppsCustomizePagedView.ContentType contentType = content.getContentType();
- final boolean isWidgetTray = contentType == AppsCustomizePagedView.ContentType.Widgets;
+ // hideAppsCustomizeHelper is called in some cases when it is already hidden
+ // don't perform all these no-op animations. In particularly, this was causing
+ // the all-apps button to pop in and out.
+ if (fromView.getVisibility() == View.VISIBLE) {
+ AppsCustomizePagedView.ContentType contentType = content.getContentType();
+ final boolean isWidgetTray =
+ contentType == AppsCustomizePagedView.ContentType.Widgets;
- if (isWidgetTray) {
- revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark));
- } else {
- revealView.setBackground(res.getDrawable(R.drawable.quantum_panel));
- }
-
- int width = revealView.getMeasuredWidth();
- int height = revealView.getMeasuredHeight();
- float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4);
-
- // Hide the real page background, and swap in the fake one
- revealView.setVisibility(View.VISIBLE);
- content.setPageBackgroundsVisible(false);
-
- final View allAppsButton = getAllAppsButton();
- revealView.setTranslationY(0);
- int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView,
- allAppsButton, null);
- float yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
-
- revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-
- // The vertical motion of the apps panel should be delayed by one frame
- // from the conceal animation in order to give the right feel. We correpsondingly
- // shorten the duration so that the slide and conceal end at the same time.
- ObjectAnimator panelDrift = LauncherAnimUtils.ofFloat(revealView, "translationY", 0, yDrift);
- panelDrift.setDuration(revealDuration - SINGLE_FRAME_DELAY);
- panelDrift.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
- panelDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
- mStateAnimation.play(panelDrift);
-
- if (isWidgetTray) {
- ObjectAnimator panelAlpha = LauncherAnimUtils.ofFloat(revealView, "alpha", 1f, 0.4f);
- panelAlpha.setDuration(revealDuration);
- panelAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0));
- mStateAnimation.play(panelAlpha);
- }
-
- if (page != null) {
- page.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-
- ObjectAnimator pageDrift = LauncherAnimUtils.ofFloat(page, "translationY",
- 0, yDrift);
- pageDrift.setDuration(revealDuration - SINGLE_FRAME_DELAY);
- pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
- pageDrift.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
- mStateAnimation.play(pageDrift);
-
- page.setAlpha(1f);
- ObjectAnimator itemsAlpha = LauncherAnimUtils.ofFloat(page, "alpha", 1f, 0f);
- itemsAlpha.setDuration(100);
- itemsAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0));
- mStateAnimation.play(itemsAlpha);
- }
-
- View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator);
- pageIndicators.setAlpha(1f);
- ObjectAnimator indicatorsAlpha =
- LauncherAnimUtils.ofFloat(pageIndicators, "alpha", 0f);
- indicatorsAlpha.setDuration(revealDuration);
- indicatorsAlpha.setInterpolator(new DecelerateInterpolator(1.5f));
- mStateAnimation.play(indicatorsAlpha);
-
- width = revealView.getMeasuredWidth();
-
- if (material) {
- if (!isWidgetTray) {
- allAppsButton.setVisibility(View.INVISIBLE);
+ if (isWidgetTray) {
+ revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark));
+ } else {
+ revealView.setBackground(res.getDrawable(R.drawable.quantum_panel));
}
- int allAppsButtonSize = LauncherAppState.getInstance().
- getDynamicGrid().getDeviceProfile().allAppsButtonVisualSize;
- float finalRadius = isWidgetTray ? 0 : allAppsButtonSize / 2;
- Animator reveal =
- LauncherAnimUtils.createCircularReveal(revealView, width / 2,
- height / 2, revealRadius, finalRadius);
- reveal.setInterpolator(new LogDecelerateInterpolator(100, 0));
- reveal.setDuration(revealDuration);
- reveal.setStartDelay(itemsAlphaStagger);
- reveal.addListener(new AnimatorListenerAdapter() {
- public void onAnimationEnd(Animator animation) {
- revealView.setVisibility(View.INVISIBLE);
- if (!isWidgetTray) {
- allAppsButton.setVisibility(View.VISIBLE);
- }
+ int width = revealView.getMeasuredWidth();
+ int height = revealView.getMeasuredHeight();
+ float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4);
+
+ // Hide the real page background, and swap in the fake one
+ revealView.setVisibility(View.VISIBLE);
+ content.setPageBackgroundsVisible(false);
+
+ final View allAppsButton = getAllAppsButton();
+ revealView.setTranslationY(0);
+ int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView,
+ allAppsButton, null);
+
+ float xDrift = 0;
+ float yDrift = 0;
+ if (material) {
+ yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
+ xDrift = isWidgetTray ? 0 : allAppsToPanelDelta[0];
+ } else {
+ yDrift = 5 * height / 4;
+ xDrift = 0;
+ }
+
+ revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ TimeInterpolator decelerateInterpolator = material ?
+ new LogDecelerateInterpolator(100, 0) :
+ new LogDecelerateInterpolator(30, 0);
+
+ // The vertical motion of the apps panel should be delayed by one frame
+ // from the conceal animation in order to give the right feel. We correpsondingly
+ // shorten the duration so that the slide and conceal end at the same time.
+ ObjectAnimator panelDriftY = LauncherAnimUtils.ofFloat(revealView, "translationY",
+ 0, yDrift);
+ panelDriftY.setDuration(revealDuration - SINGLE_FRAME_DELAY);
+ panelDriftY.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
+ panelDriftY.setInterpolator(decelerateInterpolator);
+ mStateAnimation.play(panelDriftY);
+
+ ObjectAnimator panelDriftX = LauncherAnimUtils.ofFloat(revealView, "translationX",
+ 0, xDrift);
+ panelDriftX.setDuration(revealDuration - SINGLE_FRAME_DELAY);
+ panelDriftX.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
+ panelDriftX.setInterpolator(decelerateInterpolator);
+ mStateAnimation.play(panelDriftX);
+
+ if (isWidgetTray || !material) {
+ float finalAlpha = material ? 0.4f : 0f;
+ revealView.setAlpha(1f);
+ ObjectAnimator panelAlpha = LauncherAnimUtils.ofFloat(revealView, "alpha",
+ 1f, finalAlpha);
+ panelAlpha.setDuration(revealDuration);
+ panelAlpha.setInterpolator(material ? decelerateInterpolator :
+ new AccelerateInterpolator(1.5f));
+ mStateAnimation.play(panelAlpha);
+ }
+
+ if (page != null) {
+ page.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+
+ ObjectAnimator pageDrift = LauncherAnimUtils.ofFloat(page, "translationY",
+ 0, yDrift);
+ page.setTranslationY(0);
+ pageDrift.setDuration(revealDuration - SINGLE_FRAME_DELAY);
+ pageDrift.setInterpolator(decelerateInterpolator);
+ pageDrift.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
+ mStateAnimation.play(pageDrift);
+
+ page.setAlpha(1f);
+ ObjectAnimator itemsAlpha = LauncherAnimUtils.ofFloat(page, "alpha", 1f, 0f);
+ itemsAlpha.setDuration(100);
+ itemsAlpha.setInterpolator(decelerateInterpolator);
+ mStateAnimation.play(itemsAlpha);
+ }
+
+ View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator);
+ pageIndicators.setAlpha(1f);
+ ObjectAnimator indicatorsAlpha =
+ LauncherAnimUtils.ofFloat(pageIndicators, "alpha", 0f);
+ indicatorsAlpha.setDuration(revealDuration);
+ indicatorsAlpha.setInterpolator(new DecelerateInterpolator(1.5f));
+ mStateAnimation.play(indicatorsAlpha);
+
+ width = revealView.getMeasuredWidth();
+
+ if (material) {
+ if (!isWidgetTray) {
+ allAppsButton.setVisibility(View.INVISIBLE);
}
- });
+ int allAppsButtonSize = LauncherAppState.getInstance().
+ getDynamicGrid().getDeviceProfile().allAppsButtonVisualSize;
+ float finalRadius = isWidgetTray ? 0 : allAppsButtonSize / 2;
+ Animator reveal =
+ LauncherAnimUtils.createCircularReveal(revealView, width / 2,
+ height / 2, revealRadius, finalRadius);
+ reveal.setInterpolator(new LogDecelerateInterpolator(100, 0));
+ reveal.setDuration(revealDuration);
+ reveal.setStartDelay(itemsAlphaStagger);
- mStateAnimation.play(reveal);
- }
+ reveal.addListener(new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animation) {
+ revealView.setVisibility(View.INVISIBLE);
+ if (!isWidgetTray) {
+ allAppsButton.setVisibility(View.VISIBLE);
+ }
+ }
+ });
- dispatchOnLauncherTransitionPrepare(fromView, animated, true);
- dispatchOnLauncherTransitionPrepare(toView, animated, true);
- mAppsCustomizeContent.stopScrolling();
+ mStateAnimation.play(reveal);
+ }
- if (workspaceAnim != null) {
- mStateAnimation.play(workspaceAnim);
+ dispatchOnLauncherTransitionPrepare(fromView, animated, true);
+ dispatchOnLauncherTransitionPrepare(toView, animated, true);
+ mAppsCustomizeContent.stopScrolling();
}
mStateAnimation.addListener(new AnimatorListenerAdapter() {
@@ -3566,13 +3643,51 @@
page.setLayerType(View.LAYER_TYPE_NONE, null);
}
content.setPageBackgroundsVisible(true);
+ // Unhide side pages
+ int count = content.getChildCount();
+ for (int i = 0; i < count; i++) {
+ View child = content.getChildAt(i);
+ child.setVisibility(View.VISIBLE);
+ }
+
+ // Reset page transforms
+ if (page != null) {
+ page.setTranslationX(0);
+ page.setTranslationY(0);
+ page.setAlpha(1);
+ }
+ content.setCurrentPage(content.getNextPage());
+
mAppsCustomizeContent.updateCurrentPageScroll();
}
});
- dispatchOnLauncherTransitionStart(fromView, animated, true);
- dispatchOnLauncherTransitionStart(toView, animated, true);
- LauncherAnimUtils.startAnimationAfterNextDraw(mStateAnimation, toView);
+ final AnimatorSet stateAnimation = mStateAnimation;
+ final Runnable startAnimRunnable = new Runnable() {
+ public void run() {
+ // Check that mStateAnimation hasn't changed while
+ // we waited for a layout/draw pass
+ if (mStateAnimation != stateAnimation)
+ return;
+ dispatchOnLauncherTransitionStart(fromView, animated, false);
+ dispatchOnLauncherTransitionStart(toView, animated, false);
+
+ if (Utilities.isLmpOrAbove()) {
+ for (int i = 0; i < layerViews.size(); i++) {
+ View v = layerViews.get(i);
+ if (v != null) {
+ boolean attached = true;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ attached = v.isAttachedToWindow();
+ }
+ if (attached) v.buildLayer();
+ }
+ }
+ }
+ mStateAnimation.start();
+ }
+ };
+ fromView.post(startAnimRunnable);
} else {
fromView.setVisibility(View.GONE);
dispatchOnLauncherTransitionPrepare(fromView, animated, true);
@@ -3717,25 +3832,6 @@
}
/**
- * Shows the hotseat area.
- */
- void showHotseat(boolean animated) {
- if (!LauncherAppState.getInstance().isScreenLarge()) {
- if (animated) {
- if (mHotseat.getAlpha() != 1f) {
- int duration = 0;
- if (mSearchDropTargetBar != null) {
- duration = mSearchDropTargetBar.getTransitionInDuration();
- }
- mHotseat.animate().alpha(1f).setDuration(duration);
- }
- } else {
- mHotseat.setAlpha(1f);
- }
- }
- }
-
- /**
* Hides the hotseat area.
*/
void hideHotseat(boolean animated) {
@@ -4383,15 +4479,9 @@
Bundle options =
AppsCustomizePagedView.getDefaultOptionsForWidget(this, pendingInfo);
- boolean success = false;
int newWidgetId = mAppWidgetHost.allocateAppWidgetId();
- if (options != null) {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(newWidgetId,
- appWidgetInfo.provider, options);
- } else {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(newWidgetId,
- appWidgetInfo.provider);
- }
+ boolean success = mAppWidgetManager.bindAppWidgetIdIfAllowed(
+ newWidgetId, appWidgetInfo, options);
// TODO consider showing a permission dialog when the widget is clicked.
if (!success) {
@@ -4520,6 +4610,7 @@
mIntentsOnWorkspaceFromUpgradePath = mWorkspace.getUniqueComponents(true, null);
}
PackageInstallerCompat.getInstance(this).onFinishBind();
+ mModel.recheckRestoredItems(this);
}
private void sendLoadingCompleteBroadcastIfNecessary() {
@@ -4629,6 +4720,24 @@
}
/**
+ * Packages were restored
+ */
+ public void bindAppsRestored(final ArrayList<AppInfo> apps) {
+ Runnable r = new Runnable() {
+ public void run() {
+ bindAppsRestored(apps);
+ }
+ };
+ if (waitUntilResume(r)) {
+ return;
+ }
+
+ if (mWorkspace != null) {
+ mWorkspace.updateShortcutsAndWidgets(apps);
+ }
+ }
+
+ /**
* Update the state of a package, typically related to install state.
*
* Implementation of the method from LauncherModel.Callbacks.
@@ -4641,6 +4750,18 @@
}
/**
+ * Update the label and icon of all the icons in a package
+ *
+ * Implementation of the method from LauncherModel.Callbacks.
+ */
+ @Override
+ public void updatePackageBadge(String packageName) {
+ if (mWorkspace != null) {
+ mWorkspace.updatePackageBadge(packageName, UserHandleCompat.myUserHandle());
+ }
+ }
+
+ /**
* A package was uninstalled. We take both the super set of packageNames
* in addition to specific applications to remove, the reason being that
* this can be called when a package is updated as well. In that scenario,
@@ -4762,7 +4883,7 @@
* @param hint the hint to be displayed in the search bar.
*/
protected void onSearchBarHintChanged(String hint) {
- mLauncherClings.updateSearchBarHint(hint);
+
}
protected boolean isLauncherPreinstalled() {
@@ -4813,28 +4934,6 @@
return "";
}
- public void dismissFirstRunCling(View v) {
- mLauncherClings.dismissFirstRunCling(v);
- }
- public void dismissMigrationClingCopyApps(View v) {
- mLauncherClings.dismissMigrationClingCopyApps(v);
- }
- public void dismissMigrationClingUseDefault(View v) {
- mLauncherClings.dismissMigrationClingUseDefault(v);
- }
- public void dismissMigrationWorkspaceCling(View v) {
- mLauncherClings.dismissMigrationWorkspaceCling(v);
- }
- public void dismissWorkspaceCling(View v) {
- mLauncherClings.dismissWorkspaceCling(v);
- }
- public void dismissFolderCling(View v) {
- mLauncherClings.dismissFolderCling(v);
- }
- public void markFolderClingDismissedIfNecessary() {
- mLauncherClings.markFolderClingDismissedIfNecessary();
- }
-
/**
* To be overridden by subclasses to indicate that there is an activity to launch
* before showing the standard launcher experience.
@@ -4919,10 +5018,12 @@
@Override
public void run() {
mDragLayer.dismissOverlayView();
+ showFirstRunClings();
}
}, ACTIVITY_START_DELAY);
} else {
mDragLayer.dismissOverlayView();
+ showFirstRunClings();
}
changeWallpaperVisiblity(true);
}
@@ -4933,6 +5034,20 @@
editor.apply();
}
+ private void showFirstRunClings() {
+ // The two first run cling paths are mutually exclusive, if the launcher is preinstalled
+ // on the device, then we always show the first run cling experience (or if there is no
+ // launcher2). Otherwise, we prompt the user upon started for migration
+ LauncherClings launcherClings = new LauncherClings(this);
+ if (launcherClings.shouldShowFirstRunOrMigrationClings()) {
+ if (mModel.canMigrateFromOldLauncherDb(this)) {
+ launcherClings.showMigrationCling();
+ } else {
+ launcherClings.showLongPressCling(true);
+ }
+ }
+ }
+
void showWorkspaceSearchAndHotseat() {
if (mWorkspace != null) mWorkspace.setAlpha(1f);
if (mHotseat != null) mHotseat.setAlpha(1f);
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 4ab4e4b..246278f 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -38,7 +38,7 @@
private static final String TAG = "LauncherAppState";
private static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs";
- private static final boolean DEBUG = true; // STOPSHIP(cwren) temporary for debugging
+ private static final boolean DEBUG = false;
private final AppFilter mAppFilter;
private final BuildInfo mBuildInfo;
@@ -161,7 +161,7 @@
return mModel;
}
- IconCache getIconCache() {
+ public IconCache getIconCache() {
return mIconCache;
}
@@ -260,4 +260,11 @@
public void setPackageState(ArrayList<PackageInstallInfo> installInfo) {
mModel.setPackageState(installInfo);
}
+
+ /**
+ * Updates the icons and label of all icons for the provided package name.
+ */
+ public void updatePackageBadge(String packageName) {
+ mModel.updatePackageBadge(packageName);
+ }
}
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java
index 4755482..5c6535a 100644
--- a/src/com/android/launcher3/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java
@@ -46,6 +46,11 @@
public static final int FLAG_UI_NOT_READY = 4;
/**
+ * Indicates that the widget restore has started.
+ */
+ public static final int FLAG_RESTORE_STARTED = 8;
+
+ /**
* Indicates that the widget hasn't been instantiated yet.
*/
static final int NO_ID = -1;
@@ -70,7 +75,7 @@
/**
* Indicates the installation progress of the widget provider
*/
- int installProgress;
+ int installProgress = -1;
private boolean mHasNotifiedInitialWidgetSizeChanged;
diff --git a/src/com/android/launcher3/LauncherBackupAgentHelper.java b/src/com/android/launcher3/LauncherBackupAgentHelper.java
index 7dd8cde..c20c693 100644
--- a/src/com/android/launcher3/LauncherBackupAgentHelper.java
+++ b/src/com/android/launcher3/LauncherBackupAgentHelper.java
@@ -17,13 +17,16 @@
package com.android.launcher3;
import android.app.backup.BackupAgentHelper;
+import android.app.backup.BackupDataInput;
import android.app.backup.BackupManager;
-import android.app.backup.SharedPreferencesBackupHelper;
import android.content.Context;
-import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.os.ParcelFileDescriptor;
import android.provider.Settings;
import android.util.Log;
+import java.io.IOException;
+
public class LauncherBackupAgentHelper extends BackupAgentHelper {
private static final String TAG = "LauncherBackupAgentHelper";
@@ -54,7 +57,7 @@
// modifies the file outside the normal codepaths, so it looks like another
// process. This forces a reload of the file, in case this process persists.
String spKey = LauncherAppState.getSharedPreferencesKey();
- SharedPreferences sp = getSharedPreferences(spKey, Context.MODE_MULTI_PROCESS);
+ getSharedPreferences(spKey, Context.MODE_MULTI_PROCESS);
super.onDestroy();
}
@@ -71,4 +74,21 @@
addHelper(LauncherBackupHelper.LAUNCHER_PREFIX,
new LauncherBackupHelper(this, restoreEnabled));
}
+
+ @Override
+ public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
+ throws IOException {
+ super.onRestore(data, appVersionCode, newState);
+
+ // If no favorite was migrated, clear the data and start fresh.
+ final Cursor c = getContentResolver().query(
+ LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, null, null, null, null);
+ boolean hasData = c.moveToNext();
+ c.close();
+
+ if (!hasData) {
+ if (VERBOSE) Log.v(TAG, "Nothing was restored, clearing DB");
+ LauncherAppState.getLauncherProvider().createEmptyDB();
+ }
+ }
}
diff --git a/src/com/android/launcher3/LauncherBackupHelper.java b/src/com/android/launcher3/LauncherBackupHelper.java
index 64e82c7..201f3e9 100644
--- a/src/com/android/launcher3/LauncherBackupHelper.java
+++ b/src/com/android/launcher3/LauncherBackupHelper.java
@@ -148,11 +148,12 @@
private HashMap<ComponentName, AppWidgetProviderInfo> mWidgetMap;
- private ArrayList<Key> mKeys;
+ private final ArrayList<Key> mKeys;
public LauncherBackupHelper(Context context, boolean restoreEnabled) {
mContext = context;
mRestoreEnabled = restoreEnabled;
+ mKeys = new ArrayList<Key>();
}
private void dataChanged() {
@@ -218,9 +219,6 @@
@Override
public void restoreEntity(BackupDataInputStream data) {
if (VERBOSE) Log.v(TAG, "restoreEntity");
- if (mKeys == null) {
- mKeys = new ArrayList<Key>();
- }
byte[] buffer = new byte[512];
String backupKey = data.getKey();
int dataSize = data.size();
@@ -299,36 +297,26 @@
Set<String> savedIds = getSavedIdsByType(Key.FAVORITE, in);
if (DEBUG) Log.d(TAG, "favorite savedIds.size()=" + savedIds.size());
- // Don't backup apps in other profiles for now.
- UserHandleCompat myUserHandle = UserHandleCompat.myUserHandle();
- long userSerialNumber =
- UserManagerCompat.getInstance(mContext).getSerialNumberForUser(myUserHandle);
-
// persist things that have changed since the last backup
ContentResolver cr = mContext.getContentResolver();
+ // Don't backup apps in other profiles for now.
Cursor cursor = cr.query(Favorites.CONTENT_URI, FAVORITE_PROJECTION,
- null, null, null);
+ getUserSelectionArg(), null, null);
Set<String> currentIds = new HashSet<String>(cursor.getCount());
try {
cursor.moveToPosition(-1);
while(cursor.moveToNext()) {
final long id = cursor.getLong(ID_INDEX);
- final long profileId = cursor.getLong(PROFILE_ID_INDEX);
- if (userSerialNumber == profileId) {
- final long updateTime = cursor.getLong(ID_MODIFIED);
- Key key = getKey(Key.FAVORITE, id);
- keys.add(key);
- final String backupKey = keyToBackupKey(key);
- currentIds.add(backupKey);
- if (!savedIds.contains(backupKey) || updateTime >= in.t) {
- byte[] blob = packFavorite(cursor);
- writeRowToBackup(key, blob, out, data);
- } else {
- if (VERBOSE) Log.v(TAG, "favorite " + id + " was too old: " + updateTime);
- }
+ final long updateTime = cursor.getLong(ID_MODIFIED);
+ Key key = getKey(Key.FAVORITE, id);
+ keys.add(key);
+ final String backupKey = keyToBackupKey(key);
+ currentIds.add(backupKey);
+ if (!savedIds.contains(backupKey) || updateTime >= in.t) {
+ byte[] blob = packFavorite(cursor);
+ writeRowToBackup(key, blob, out, data);
} else {
- if (VERBOSE) Log.v(TAG, "favorite " + id + " is for other profile: "
- + profileId);
+ if (VERBOSE) Log.v(TAG, "favorite " + id + " was too old: " + updateTime);
}
}
} finally {
@@ -364,7 +352,7 @@
try {
ContentResolver cr = mContext.getContentResolver();
ContentValues values = unpackFavorite(buffer, 0, dataSize);
- cr.insert(Favorites.CONTENT_URI, values);
+ cr.insert(Favorites.CONTENT_URI_NO_NOTIFICATION, values);
} catch (InvalidProtocolBufferNanoException e) {
Log.e(TAG, "failed to decode favorite", e);
}
@@ -469,20 +457,19 @@
}
final ContentResolver cr = mContext.getContentResolver();
final int dpi = mContext.getResources().getDisplayMetrics().densityDpi;
+ final UserHandleCompat myUserHandle = UserHandleCompat.myUserHandle();
// read the old ID set
Set<String> savedIds = getSavedIdsByType(Key.ICON, in);
if (DEBUG) Log.d(TAG, "icon savedIds.size()=" + savedIds.size());
// Don't backup apps in other profiles for now.
- UserHandleCompat myUserHandle = UserHandleCompat.myUserHandle();
- long userSerialNumber =
- UserManagerCompat.getInstance(mContext).getSerialNumberForUser(myUserHandle);
int startRows = out.rows;
if (DEBUG) Log.d(TAG, "starting here: " + startRows);
+
String where = "(" + Favorites.ITEM_TYPE + "=" + Favorites.ITEM_TYPE_APPLICATION + " OR " +
Favorites.ITEM_TYPE + "=" + Favorites.ITEM_TYPE_SHORTCUT + ") AND " +
- Favorites.PROFILE_ID + "=" + userSerialNumber;
+ getUserSelectionArg();
Cursor cursor = cr.query(Favorites.CONTENT_URI, FAVORITE_PROJECTION,
where, null, null);
Set<String> currentIds = new HashSet<String>(cursor.getCount());
@@ -617,7 +604,8 @@
int startRows = out.rows;
if (DEBUG) Log.d(TAG, "starting here: " + startRows);
- String where = Favorites.ITEM_TYPE + "=" + Favorites.ITEM_TYPE_APPWIDGET;
+ String where = Favorites.ITEM_TYPE + "=" + Favorites.ITEM_TYPE_APPWIDGET + " AND "
+ + getUserSelectionArg();
Cursor cursor = cr.query(Favorites.CONTENT_URI, FAVORITE_PROJECTION,
where, null, null);
Set<String> currentIds = new HashSet<String>(cursor.getCount());
@@ -1192,6 +1180,11 @@
return true;
}
+ private String getUserSelectionArg() {
+ return Favorites.PROFILE_ID + '=' + UserManagerCompat.getInstance(mContext)
+ .getSerialNumberForUser(UserHandleCompat.myUserHandle());
+ }
+
private class KeyParsingException extends Throwable {
private KeyParsingException(Throwable cause) {
super(cause);
diff --git a/src/com/android/launcher3/LauncherClings.java b/src/com/android/launcher3/LauncherClings.java
index 00586bd..458d81f 100644
--- a/src/com/android/launcher3/LauncherClings.java
+++ b/src/com/android/launcher3/LauncherClings.java
@@ -18,31 +18,29 @@
import android.accounts.Account;
import android.accounts.AccountManager;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.app.ActivityManager;
-import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.UserManager;
import android.provider.Settings;
+import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
+import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityManager;
-import android.widget.TextView;
-class LauncherClings {
- private static final String FIRST_RUN_CLING_DISMISSED_KEY = "cling_gel.first_run.dismissed";
+class LauncherClings implements OnClickListener {
private static final String MIGRATION_CLING_DISMISSED_KEY = "cling_gel.migration.dismissed";
- private static final String MIGRATION_WORKSPACE_CLING_DISMISSED_KEY =
- "cling_gel.migration_workspace.dismissed";
private static final String WORKSPACE_CLING_DISMISSED_KEY = "cling_gel.workspace.dismissed";
- private static final String FOLDER_CLING_DISMISSED_KEY = "cling_gel.folder.dismissed";
+
+ private static final String TAG_CROP_TOP_AND_SIDES = "crop_bg_top_and_sides";
private static final boolean DISABLE_CLINGS = false;
@@ -54,33 +52,163 @@
private Launcher mLauncher;
private LayoutInflater mInflater;
- private HideFromAccessibilityHelper mHideFromAccessibilityHelper
- = new HideFromAccessibilityHelper();
/** Ctor */
public LauncherClings(Launcher launcher) {
mLauncher = launcher;
- mInflater = mLauncher.getLayoutInflater();
+ mInflater = LayoutInflater.from(new
+ ContextThemeWrapper(mLauncher, android.R.style.Theme_DeviceDefault));
}
- /** Initializes a cling */
- private Cling initCling(int clingId, int scrimId, boolean animate,
- boolean dimNavBarVisibilty) {
- Cling cling = (Cling) mLauncher.findViewById(clingId);
- View scrim = null;
- if (scrimId > 0) {
- scrim = mLauncher.findViewById(scrimId);
+ @Override
+ public void onClick(View v) {
+ int id = v.getId();
+ if (id == R.id.cling_dismiss_migration_use_default) {
+ // Disable the migration cling
+ dismissMigrationCling();
+ } else if (id == R.id.cling_dismiss_migration_copy_apps) {
+ // Copy the shortcuts from the old database
+ LauncherModel model = mLauncher.getModel();
+ model.resetLoadedState(false, true);
+ model.startLoader(false, PagedView.INVALID_RESTORE_PAGE,
+ LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE
+ | LauncherModel.LOADER_FLAG_MIGRATE_SHORTCUTS);
+ // Set the flag to skip the folder cling
+ String spKey = LauncherAppState.getSharedPreferencesKey();
+ SharedPreferences sp = mLauncher.getSharedPreferences(spKey, Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = sp.edit();
+ editor.putBoolean(Launcher.USER_HAS_MIGRATED, true);
+ editor.apply();
+ // Disable the migration cling
+ dismissMigrationCling();
+ } else if (id == R.id.cling_dismiss_longpress_info) {
+ dismissLongPressCling();
}
- if (cling != null) {
- cling.init(mLauncher, scrim);
- cling.show(animate, SHOW_CLING_DURATION);
+ }
- if (dimNavBarVisibilty) {
- cling.setSystemUiVisibility(cling.getSystemUiVisibility() |
- View.SYSTEM_UI_FLAG_LOW_PROFILE);
+ /**
+ * Shows the migration cling.
+ *
+ * This flow is mutually exclusive with showFirstRunCling, and only runs if this Launcher
+ * package was not preinstalled and there exists a db to migrate from.
+ */
+ public void showMigrationCling() {
+ mLauncher.hideWorkspaceSearchAndHotseat();
+
+ ViewGroup root = (ViewGroup) mLauncher.findViewById(R.id.launcher);
+ View inflated = mInflater.inflate(R.layout.migration_cling, root);
+ inflated.findViewById(R.id.cling_dismiss_migration_copy_apps).setOnClickListener(this);
+ inflated.findViewById(R.id.cling_dismiss_migration_use_default).setOnClickListener(this);
+ }
+
+ private void dismissMigrationCling() {
+ mLauncher.showWorkspaceSearchAndHotseat();
+ Runnable dismissCb = new Runnable() {
+ public void run() {
+ Runnable cb = new Runnable() {
+ public void run() {
+ // Show the longpress cling next
+ showLongPressCling(false);
+ }
+ };
+ dismissCling(mLauncher.findViewById(R.id.migration_cling), cb,
+ MIGRATION_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ }
+ };
+ mLauncher.getWorkspace().post(dismissCb);
+ }
+
+ public void showLongPressCling(boolean showWelcome) {
+ ViewGroup root = (ViewGroup) mLauncher.findViewById(R.id.launcher);
+ View cling = mInflater.inflate(R.layout.longpress_cling, root, false);
+
+ cling.setOnLongClickListener(new OnLongClickListener() {
+
+ @Override
+ public boolean onLongClick(View v) {
+ mLauncher.getWorkspace().enterOverviewMode();
+ dismissLongPressCling();
+ return true;
+ }
+ });
+
+ final ViewGroup content = (ViewGroup) cling.findViewById(R.id.cling_content);
+ mInflater.inflate(showWelcome ? R.layout.longpress_cling_welcome_content
+ : R.layout.longpress_cling_content, content);
+ content.findViewById(R.id.cling_dismiss_longpress_info).setOnClickListener(this);
+
+ if (TAG_CROP_TOP_AND_SIDES.equals(content.getTag())) {
+ Drawable bg = new BorderCropDrawable(mLauncher.getResources().getDrawable(R.drawable.cling_bg),
+ true, true, true, false);
+ content.setBackground(bg);
+ }
+
+ root.addView(cling);
+
+ if (showWelcome) {
+ // This is the first cling being shown. No need to animate.
+ return;
+ }
+
+ // Animate
+ content.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
+
+ @Override
+ public void onGlobalLayout() {
+ content.getViewTreeObserver().removeOnGlobalLayoutListener(this);
+
+ ObjectAnimator anim;
+ if (TAG_CROP_TOP_AND_SIDES.equals(content.getTag())) {
+ content.setTranslationY(-content.getMeasuredHeight());
+ anim = LauncherAnimUtils.ofFloat(content, "translationY", 0);
+ } else {
+ content.setScaleX(0);
+ content.setScaleY(0);
+ PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1);
+ PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1);
+ anim = LauncherAnimUtils.ofPropertyValuesHolder(content, scaleX, scaleY);
+ }
+
+ anim.setDuration(SHOW_CLING_DURATION);
+ anim.setInterpolator(new LogDecelerateInterpolator(100, 0));
+ anim.start();
+ }
+ });
+ }
+
+ private void dismissLongPressCling() {
+ Runnable dismissCb = new Runnable() {
+ public void run() {
+ dismissCling(mLauncher.findViewById(R.id.longpress_cling), null,
+ WORKSPACE_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ }
+ };
+ mLauncher.getWorkspace().post(dismissCb);
+ }
+
+ /** Hides the specified Cling */
+ private void dismissCling(final View cling, final Runnable postAnimationCb,
+ final String flag, int duration) {
+ // 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) {
+ final Runnable cleanUpClingCb = new Runnable() {
+ public void run() {
+ cling.setVisibility(View.GONE);
+ mLauncher.getSharedPrefs().edit()
+ .putBoolean(flag, true)
+ .apply();
+ if (postAnimationCb != null) {
+ postAnimationCb.run();
+ }
+ }
+ };
+ if (duration <= 0) {
+ cleanUpClingCb.run();
+ } else {
+ cling.animate().alpha(0).setDuration(duration).withEndAction(cleanUpClingCb);
}
}
- return cling;
}
/** Returns whether the clings are enabled or should be shown */
@@ -118,346 +246,18 @@
return true;
}
- /** Returns whether the folder cling is visible. */
- public boolean isFolderClingVisible() {
- Cling cling = (Cling) mLauncher.findViewById(R.id.folder_cling);
- if (cling != null) {
- return cling.getVisibility() == View.VISIBLE;
- }
- return false;
- }
-
- private boolean skipCustomClingIfNoAccounts() {
- Cling cling = (Cling) mLauncher.findViewById(R.id.workspace_cling);
- boolean customCling = cling.getDrawIdentifier().equals("workspace_custom");
- if (customCling) {
- AccountManager am = AccountManager.get(mLauncher);
- if (am == null) return false;
- Account[] accounts = am.getAccountsByType("com.google");
- return accounts.length == 0;
- }
- return false;
- }
-
- /** Updates the first run cling custom content hint */
- private void setCustomContentHintVisibility(Cling cling, String ccHintStr, boolean visible,
- boolean animate) {
- final TextView ccHint = (TextView) cling.findViewById(R.id.custom_content_hint);
- if (ccHint != null) {
- if (visible && !ccHintStr.isEmpty()) {
- ccHint.setText(ccHintStr);
- ccHint.setVisibility(View.VISIBLE);
- if (animate) {
- ccHint.setAlpha(0f);
- ccHint.animate().alpha(1f)
- .setDuration(SHOW_CLING_DURATION)
- .start();
- } else {
- ccHint.setAlpha(1f);
- }
- } else {
- if (animate) {
- ccHint.animate().alpha(0f)
- .setDuration(SHOW_CLING_DURATION)
- .setListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- ccHint.setVisibility(View.GONE);
- }
- })
- .start();
- } else {
- ccHint.setAlpha(0f);
- ccHint.setVisibility(View.GONE);
- }
- }
- }
- }
-
- /** Updates the first run cling custom content hint */
- public void updateCustomContentHintVisibility() {
- Cling cling = (Cling) mLauncher.findViewById(R.id.first_run_cling);
- String ccHintStr = mLauncher.getFirstRunCustomContentHint();
-
- if (mLauncher.getWorkspace().hasCustomContent()) {
- // Show the custom content hint if ccHintStr is not empty
- if (cling != null) {
- setCustomContentHintVisibility(cling, ccHintStr, true, true);
- }
- } else {
- // Hide the custom content hint
- if (cling != null) {
- setCustomContentHintVisibility(cling, ccHintStr, false, true);
- }
- }
- }
-
- /** Updates the first run cling search bar hint. */
- public void updateSearchBarHint(String hint) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.first_run_cling);
- if (cling != null && cling.getVisibility() == View.VISIBLE && !hint.isEmpty()) {
- TextView sbHint = (TextView) cling.findViewById(R.id.search_bar_hint);
- sbHint.setText(hint);
- sbHint.setVisibility(View.VISIBLE);
- }
- }
-
public boolean shouldShowFirstRunOrMigrationClings() {
SharedPreferences sharedPrefs = mLauncher.getSharedPrefs();
return areClingsEnabled() &&
- !sharedPrefs.getBoolean(FIRST_RUN_CLING_DISMISSED_KEY, false) &&
+ !sharedPrefs.getBoolean(WORKSPACE_CLING_DISMISSED_KEY, false) &&
!sharedPrefs.getBoolean(MIGRATION_CLING_DISMISSED_KEY, false);
}
- public void removeFirstRunAndMigrationClings() {
- removeCling(R.id.first_run_cling);
- removeCling(R.id.migration_cling);
- }
-
- /**
- * Shows the first run cling.
- *
- * This flow is mutually exclusive with showMigrationCling, and only runs if this Launcher
- * package was preinstalled or there is no db to migrate from.
- */
- public void showFirstRunCling() {
- if (!skipCustomClingIfNoAccounts()) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.first_run_cling);
- if (cling != null) {
- String sbHintStr = mLauncher.getFirstRunClingSearchBarHint();
- String ccHintStr = mLauncher.getFirstRunCustomContentHint();
- if (!sbHintStr.isEmpty()) {
- TextView sbHint = (TextView) cling.findViewById(R.id.search_bar_hint);
- sbHint.setText(sbHintStr);
- sbHint.setVisibility(View.VISIBLE);
- }
- setCustomContentHintVisibility(cling, ccHintStr, true, false);
- }
- initCling(R.id.first_run_cling, 0, false, true);
- } else {
- removeFirstRunAndMigrationClings();
- }
- }
-
- /**
- * Shows the migration cling.
- *
- * This flow is mutually exclusive with showFirstRunCling, and only runs if this Launcher
- * package was not preinstalled and there exists a db to migrate from.
- */
- public void showMigrationCling() {
- mLauncher.hideWorkspaceSearchAndHotseat();
-
- Cling c = initCling(R.id.migration_cling, 0, false, true);
- c.bringScrimToFront();
- c.bringToFront();
- }
-
- public void showMigrationWorkspaceCling() {
- // Enable the clings only if they have not been dismissed before
- if (areClingsEnabled() && !mLauncher.getSharedPrefs().getBoolean(
- MIGRATION_WORKSPACE_CLING_DISMISSED_KEY, false)) {
- Cling c = initCling(R.id.migration_workspace_cling, 0, false, true);
- c.updateMigrationWorkspaceBubblePosition();
- c.bringScrimToFront();
- c.bringToFront();
- } else {
- removeCling(R.id.migration_workspace_cling);
- }
- }
-
- public void showWorkspaceCling() {
- // Enable the clings only if they have not been dismissed before
- if (areClingsEnabled() && !mLauncher.getSharedPrefs().getBoolean(
- WORKSPACE_CLING_DISMISSED_KEY, false)) {
- Cling c = initCling(R.id.workspace_cling, 0, false, true);
- c.updateWorkspaceBubblePosition();
- if (mLauncher.shouldClingFocusHotseatApp()) {
- // Set the focused hotseat app
- c.setFocusedHotseatApp(mLauncher.getFirstRunFocusedHotseatAppDrawableId(),
- mLauncher.getFirstRunFocusedHotseatAppRank(),
- mLauncher.getFirstRunFocusedHotseatAppComponentName(),
- mLauncher.getFirstRunFocusedHotseatAppBubbleTitle(),
- mLauncher.getFirstRunFocusedHotseatAppBubbleDescription());
- }
- } else {
- removeCling(R.id.workspace_cling);
- }
- }
-
- public Cling showFoldersCling() {
- SharedPreferences sharedPrefs = mLauncher.getSharedPrefs();
- // Enable the clings only if they have not been dismissed before
- if (areClingsEnabled() &&
- !sharedPrefs.getBoolean(FOLDER_CLING_DISMISSED_KEY, false) &&
- !sharedPrefs.getBoolean(Launcher.USER_HAS_MIGRATED, false)) {
- Cling cling = initCling(R.id.folder_cling, R.id.cling_scrim,
- true, true);
- Folder openFolder = mLauncher.getWorkspace().getOpenFolder();
- if (openFolder != null) {
- Rect openFolderRect = new Rect();
- openFolder.getHitRect(openFolderRect);
- cling.setOpenFolderRect(openFolderRect);
- openFolder.bringToFront();
- }
- return cling;
- } else {
- removeCling(R.id.folder_cling);
- return null;
- }
- }
-
public static void synchonouslyMarkFirstRunClingDismissed(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(
LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
- editor.putBoolean(LauncherClings.FIRST_RUN_CLING_DISMISSED_KEY, true);
+ editor.putBoolean(WORKSPACE_CLING_DISMISSED_KEY, true);
editor.commit();
}
-
- /** Removes the cling outright from the DragLayer */
- private void removeCling(int id) {
- final View cling = mLauncher.findViewById(id);
- if (cling != null) {
- final ViewGroup parent = (ViewGroup) cling.getParent();
- parent.post(new Runnable() {
- @Override
- public void run() {
- parent.removeView(cling);
- }
- });
- mHideFromAccessibilityHelper.restoreImportantForAccessibility(mLauncher.getDragLayer());
- }
- }
-
- /** Hides the specified Cling */
- 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) {
- final Runnable cleanUpClingCb = new Runnable() {
- public void run() {
- cling.cleanup();
- SharedPreferences.Editor editor = mLauncher.getSharedPrefs().edit();
- editor.putBoolean(flag, true);
- editor.apply();
- if (postAnimationCb != null) {
- postAnimationCb.run();
- }
- }
- };
- if (duration <= 0) {
- cleanUpClingCb.run();
- } else {
- cling.hide(duration, cleanUpClingCb);
- }
- mHideFromAccessibilityHelper.restoreImportantForAccessibility(mLauncher.getDragLayer());
-
- if (restoreNavBarVisibilty) {
- cling.setSystemUiVisibility(cling.getSystemUiVisibility() &
- ~View.SYSTEM_UI_FLAG_LOW_PROFILE);
- }
- }
- }
-
- public void dismissFirstRunCling(View v) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.first_run_cling);
- Runnable cb = new Runnable() {
- public void run() {
- // Show the workspace cling next
- showWorkspaceCling();
- }
- };
- dismissCling(cling, cb, FIRST_RUN_CLING_DISMISSED_KEY,
- DISMISS_CLING_DURATION, false);
-
- // Fade out the search bar for the workspace cling coming up
- mLauncher.getSearchBar().hideSearchBar(true);
- }
-
- private void dismissMigrationCling() {
- mLauncher.showWorkspaceSearchAndHotseat();
- Runnable dismissCb = new Runnable() {
- public void run() {
- Cling cling = (Cling) mLauncher.findViewById(R.id.migration_cling);
- Runnable cb = new Runnable() {
- public void run() {
- // Show the migration workspace cling next
- showMigrationWorkspaceCling();
- }
- };
- dismissCling(cling, cb, MIGRATION_CLING_DISMISSED_KEY,
- DISMISS_CLING_DURATION, true);
- }
- };
- mLauncher.getWorkspace().post(dismissCb);
- }
-
- private void dismissAnyWorkspaceCling(Cling cling, String key, View v) {
- Runnable cb = null;
- if (v == null) {
- cb = new Runnable() {
- public void run() {
- mLauncher.getWorkspace().enterOverviewMode();
- }
- };
- }
- dismissCling(cling, cb, key, DISMISS_CLING_DURATION, true);
-
- // Fade in the search bar
- mLauncher.getSearchBar().showSearchBar(true);
- }
-
- public void markFolderClingDismissedIfNecessary() {
- SharedPreferences prefs = mLauncher.getSharedPrefs();
- if (!prefs.getBoolean(FOLDER_CLING_DISMISSED_KEY, false)) {
- SharedPreferences.Editor editor = prefs.edit();
- editor.putBoolean(FOLDER_CLING_DISMISSED_KEY, true);
- editor.apply();
- }
- }
-
- public void dismissMigrationClingCopyApps(View v) {
- // Copy the shortcuts from the old database
- LauncherModel model = mLauncher.getModel();
- model.resetLoadedState(false, true);
- model.startLoader(false, PagedView.INVALID_RESTORE_PAGE,
- LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE
- | LauncherModel.LOADER_FLAG_MIGRATE_SHORTCUTS);
-
- // Set the flag to skip the folder cling
- String spKey = LauncherAppState.getSharedPreferencesKey();
- SharedPreferences sp = mLauncher.getSharedPreferences(spKey, Context.MODE_PRIVATE);
- SharedPreferences.Editor editor = sp.edit();
- editor.putBoolean(Launcher.USER_HAS_MIGRATED, true);
- editor.apply();
-
- // Disable the migration cling
- dismissMigrationCling();
- }
-
- public void dismissMigrationClingUseDefault(View v) {
- // Don't need to do anything special here. We've already loaded the default workspace,
- // (which is the default loader behavior triggered from Launcher#onCreate.).
-
- // Disable the migration cling
- dismissMigrationCling();
- }
-
- public void dismissMigrationWorkspaceCling(View v) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.migration_workspace_cling);
- dismissAnyWorkspaceCling(cling, MIGRATION_WORKSPACE_CLING_DISMISSED_KEY, v);
- }
-
- public void dismissWorkspaceCling(View v) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.workspace_cling);
- dismissAnyWorkspaceCling(cling, WORKSPACE_CLING_DISMISSED_KEY, v);
- }
-
- public void dismissFolderCling(View v) {
- Cling cling = (Cling) mLauncher.findViewById(R.id.folder_cling);
- dismissCling(cling, null, FOLDER_CLING_DISMISSED_KEY,
- DISMISS_CLING_DURATION, true);
- }
}
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 4c9d1a7..c64506d 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -30,7 +30,6 @@
import android.content.Intent.ShortcutIconResource;
import android.content.IntentFilter;
import android.content.SharedPreferences;
-import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
@@ -52,15 +51,17 @@
import android.util.Log;
import android.util.Pair;
-import com.android.launcher3.InstallWidgetReceiver.WidgetMimeTypeHandlerData;
+import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.LauncherActivityInfoCompat;
import com.android.launcher3.compat.LauncherAppsCompat;
+import com.android.launcher3.compat.PackageInstallerCompat;
import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.compat.UserManagerCompat;
import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
+import java.security.InvalidParameterException;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
@@ -84,7 +85,8 @@
public class LauncherModel extends BroadcastReceiver
implements LauncherAppsCompat.OnAppsChangedCallbackCompat {
static final boolean DEBUG_LOADERS = false;
- private static final boolean DEBUG_RECEIVER = true; // STOPSHIP(cwren) temporary for debugging
+ private static final boolean DEBUG_RECEIVER = false;
+ private static final boolean REMOVE_UNRESTORED_ICONS = true;
static final String TAG = "Launcher.Model";
@@ -196,7 +198,9 @@
ArrayList<ItemInfo> addAnimated,
ArrayList<AppInfo> addedApps);
public void bindAppsUpdated(ArrayList<AppInfo> apps);
+ public void bindAppsRestored(ArrayList<AppInfo> apps);
public void updatePackageState(ArrayList<PackageInstallInfo> installInfo);
+ public void updatePackageBadge(String packageName);
public void bindComponentsRemoved(ArrayList<String> packageNames,
ArrayList<AppInfo> appInfos, UserHandleCompat user);
public void bindPackagesUpdated(ArrayList<Object> widgetsAndShortcuts);
@@ -346,6 +350,19 @@
mHandler.post(r);
}
+ public void updatePackageBadge(final String packageName) {
+ // Process the updated package badge
+ Runnable r = new Runnable() {
+ public void run() {
+ Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
+ if (callbacks != null) {
+ callbacks.updatePackageBadge(packageName);
+ }
+ }
+ };
+ mHandler.post(r);
+ }
+
public void addAppsToAllApps(final Context ctx, final ArrayList<AppInfo> allAppsApps) {
final Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
@@ -360,7 +377,7 @@
Iterator<AppInfo> iter = allAppsApps.iterator();
while (iter.hasNext()) {
ItemInfo a = iter.next();
- if (LauncherModel.appWasRestored(ctx, a.getIntent(), a.user)) {
+ if (LauncherModel.appWasPromise(ctx, a.getIntent(), a.user)) {
restoredAppsFinal.add((AppInfo) a);
}
}
@@ -429,7 +446,7 @@
if (LauncherModel.shortcutExists(context, name, launchIntent)) {
// Only InstallShortcutReceiver sends us shortcutInfos, ignore them
if (a instanceof AppInfo &&
- LauncherModel.appWasRestored(context, launchIntent, a.user)) {
+ LauncherModel.appWasPromise(context, launchIntent, a.user)) {
restoredAppsFinal.add((AppInfo) a);
}
continue;
@@ -885,33 +902,14 @@
}
/**
- * Returns true if the shortcuts already exists in the database.
- * we identify a shortcut by the component name of the intent
- * and the user.
+ * Returns true if the promise shortcuts with the same package name exists on the workspace.
*/
- static boolean appWasRestored(Context context, Intent intent, UserHandleCompat user) {
- final ContentResolver cr = context.getContentResolver();
+ static boolean appWasPromise(Context context, Intent intent, UserHandleCompat user) {
final ComponentName component = intent.getComponent();
if (component == null) {
return false;
}
- String componentName = component.flattenToString();
- String shortName = component.flattenToShortString();
- long serialNumber = UserManagerCompat.getInstance(context)
- .getSerialNumberForUser(user);
- final String where = "(intent glob \"*component=" + componentName + "*\" or " +
- "intent glob \"*component=" + shortName + "*\")" +
- "and restored = 1 and profileId = " + serialNumber;
- Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
- new String[]{"intent", "restored", "profileId"}, where, null, null);
- boolean result = false;
- try {
- result = c.moveToFirst();
- } finally {
- c.close();
- }
- Log.d(TAG, "shortcutWasRestored is " + result + " for " + componentName);
- return result;
+ return !getItemsByPackageName(component.getPackageName(), user).isEmpty();
}
/**
@@ -1078,45 +1076,77 @@
| ((int) screen & 0xFF) << 16 | (localCellX & 0xFF) << 8 | (localCellY & 0xFF);
}
+ private static ArrayList<ItemInfo> getItemsByPackageName(
+ final String pn, final UserHandleCompat user) {
+ ItemInfoFilter filter = new ItemInfoFilter() {
+ @Override
+ public boolean filterItem(ItemInfo parent, ItemInfo info, ComponentName cn) {
+ return cn.getPackageName().equals(pn) && info.user.equals(user);
+ }
+ };
+ return filterItemInfos(sBgItemsIdMap.values(), filter);
+ }
+
+ /**
+ * Removes all the items from the database corresponding to the specified package.
+ */
+ static void deletePackageFromDatabase(Context context, final String pn,
+ final UserHandleCompat user) {
+ deleteItemsFromDatabase(context, getItemsByPackageName(pn, user));
+ }
+
/**
* Removes the specified item from the database
* @param context
* @param item
*/
static void deleteItemFromDatabase(Context context, final ItemInfo item) {
+ ArrayList<ItemInfo> items = new ArrayList<ItemInfo>();
+ items.add(item);
+ deleteItemsFromDatabase(context, items);
+ }
+
+ /**
+ * Removes the specified items from the database
+ * @param context
+ * @param item
+ */
+ static void deleteItemsFromDatabase(Context context, final ArrayList<ItemInfo> items) {
final ContentResolver cr = context.getContentResolver();
- final Uri uriToDelete = LauncherSettings.Favorites.getContentUri(item.id, false);
Runnable r = new Runnable() {
public void run() {
- cr.delete(uriToDelete, null, null);
+ for (ItemInfo item : items) {
+ final Uri uri = LauncherSettings.Favorites.getContentUri(item.id, false);
+ cr.delete(uri, null, null);
- // Lock on mBgLock *after* the db operation
- synchronized (sBgLock) {
- switch (item.itemType) {
- case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
- sBgFolders.remove(item.id);
- for (ItemInfo info: sBgItemsIdMap.values()) {
- if (info.container == item.id) {
- // We are deleting a folder which still contains items that
- // think they are contained by that folder.
- String msg = "deleting a folder (" + item + ") which still " +
- "contains items (" + info + ")";
- Log.e(TAG, msg);
+ // Lock on mBgLock *after* the db operation
+ synchronized (sBgLock) {
+ switch (item.itemType) {
+ case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
+ sBgFolders.remove(item.id);
+ for (ItemInfo info: sBgItemsIdMap.values()) {
+ if (info.container == item.id) {
+ // We are deleting a folder which still contains items that
+ // think they are contained by that folder.
+ String msg = "deleting a folder (" + item + ") which still " +
+ "contains items (" + info + ")";
+ Log.e(TAG, msg);
+ }
}
- }
- sBgWorkspaceItems.remove(item);
- break;
- case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
- case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
- sBgWorkspaceItems.remove(item);
- break;
- case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
- sBgAppWidgets.remove((LauncherAppWidgetInfo) item);
- break;
+ sBgWorkspaceItems.remove(item);
+ break;
+ case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
+ case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+ sBgWorkspaceItems.remove(item);
+ break;
+ case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
+ sBgAppWidgets.remove((LauncherAppWidgetInfo) item);
+ break;
+ }
+ sBgItemsIdMap.remove(item.id);
+ sBgDbIconCache.remove(item);
}
- sBgItemsIdMap.remove(item.id);
- sBgDbIconCache.remove(item);
}
}
};
@@ -1356,6 +1386,10 @@
return isLaunching;
}
+ public boolean isCurrentCallbacks(Callbacks callbacks) {
+ return (mCallbacks != null && mCallbacks.get() == callbacks);
+ }
+
public void startLoader(boolean isLaunching, int synchronousBindPage) {
startLoader(isLaunching, synchronousBindPage, LOADER_FLAG_NONE);
}
@@ -1871,10 +1905,12 @@
synchronized (sBgLock) {
clearSBgDataStructures();
+ final HashSet<String> installingPkgs = PackageInstallerCompat
+ .getInstance(mContext).updateAndGetActiveSessionCache();
final ArrayList<Long> itemsToRemove = new ArrayList<Long>();
final ArrayList<Long> restoredRows = new ArrayList<Long>();
- final Uri contentUri = LauncherSettings.Favorites.CONTENT_URI;
+ final Uri contentUri = LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION;
if (DEBUG_LOADERS) Log.d(TAG, "loading model from " + contentUri);
final Cursor c = contentResolver.query(contentUri, null, null, null, null);
@@ -1944,6 +1980,7 @@
intentDescription = c.getString(intentIndex);
long serialNumber = c.getInt(profileIdIndex);
user = mUserManager.getUserForSerialNumber(serialNumber);
+ int promiseType = c.getInt(restoredIndex);
if (user == null) {
// User has been deleted remove the item.
itemsToRemove.add(id);
@@ -1965,17 +2002,58 @@
restored = false;
}
} else if (validPkg) {
- // The app is installed but the component is no
- // longer available.
- Launcher.addDumpLog(TAG,
- "Invalid component removed: " + cn, true);
- itemsToRemove.add(id);
- continue;
+ intent = null;
+ if ((promiseType & ShortcutInfo.FLAG_AUTOINTALL_ICON) != 0) {
+ // We allow auto install apps to have their intent
+ // updated after an install.
+ intent = manager.getLaunchIntentForPackage(
+ cn.getPackageName());
+ if (intent != null) {
+ ContentValues values = new ContentValues();
+ values.put(LauncherSettings.Favorites.INTENT,
+ intent.toUri(0));
+ String where = BaseColumns._ID + "= ?";
+ String[] args = {Long.toString(id)};
+ contentResolver.update(contentUri, values, where, args);
+ }
+ }
+
+ if (intent == null) {
+ // The app is installed but the component is no
+ // longer available.
+ Launcher.addDumpLog(TAG,
+ "Invalid component removed: " + cn, true);
+ itemsToRemove.add(id);
+ continue;
+ } else {
+ // no special handling necessary for this item
+ restoredRows.add(id);
+ restored = false;
+ }
} else if (restored) {
// Package is not yet available but might be
// installed later.
Launcher.addDumpLog(TAG,
"package not yet restored: " + cn, true);
+
+ if ((promiseType & ShortcutInfo.FLAG_RESTORE_STARTED) != 0) {
+ // Restore has started once.
+ } else if (installingPkgs.contains(cn.getPackageName())) {
+ // App restore has started. Update the flag
+ promiseType |= ShortcutInfo.FLAG_RESTORE_STARTED;
+ ContentValues values = new ContentValues();
+ values.put(LauncherSettings.Favorites.RESTORED,
+ promiseType);
+ String where = BaseColumns._ID + "= ?";
+ String[] args = {Long.toString(id)};
+ contentResolver.update(contentUri, values, where, args);
+
+ } else if (REMOVE_UNRESTORED_ICONS) {
+ Launcher.addDumpLog(TAG,
+ "Unrestored package removed: " + cn, true);
+ itemsToRemove.add(id);
+ continue;
+ }
} else if (isSdCardReady) {
// Do not wait for external media load anymore.
// Log the invalid package, and remove it
@@ -1997,6 +2075,10 @@
allowMissingTarget = true;
// Add the icon on the workspace anyway.
}
+ } else if (cn == null) {
+ // For shortcuts with no component, keep them as they are
+ restoredRows.add(id);
+ restored = false;
}
} catch (URISyntaxException e) {
Launcher.addDumpLog(TAG,
@@ -2009,7 +2091,7 @@
Launcher.addDumpLog(TAG,
"constructing info for partially restored package",
true);
- info = getRestoredItemInfo(c, titleIndex, intent);
+ info = getRestoredItemInfo(c, titleIndex, intent, promiseType);
intent = getRestoredItemIntent(c, context, intent);
} else {
// Don't restore items for other profiles.
@@ -2179,6 +2261,19 @@
appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId,
component);
appWidgetInfo.restoreStatus = restoreStatus;
+
+ if ((restoreStatus & LauncherAppWidgetInfo.FLAG_RESTORE_STARTED) != 0) {
+ // Restore has started once.
+ } else if (installingPkgs.contains(component.getPackageName())) {
+ // App restore has started. Update the flag
+ appWidgetInfo.restoreStatus |=
+ LauncherAppWidgetInfo.FLAG_RESTORE_STARTED;
+ } else if (REMOVE_UNRESTORED_ICONS) {
+ Launcher.addDumpLog(TAG,
+ "Unrestored widget removed: " + component, true);
+ itemsToRemove.add(id);
+ continue;
+ }
}
appWidgetInfo.id = id;
@@ -2207,19 +2302,17 @@
break;
}
- if (isProviderReady) {
- String providerName = provider.provider.flattenToString();
- if (!providerName.equals(savedProvider) ||
- (appWidgetInfo.restoreStatus != restoreStatus)) {
- ContentValues values = new ContentValues();
- values.put(LauncherSettings.Favorites.APPWIDGET_PROVIDER,
- providerName);
- values.put(LauncherSettings.Favorites.RESTORED,
- appWidgetInfo.restoreStatus);
- String where = BaseColumns._ID + "= ?";
- String[] args = {Long.toString(id)};
- contentResolver.update(contentUri, values, where, args);
- }
+ String providerName = appWidgetInfo.providerName.flattenToString();
+ if (!providerName.equals(savedProvider) ||
+ (appWidgetInfo.restoreStatus != restoreStatus)) {
+ ContentValues values = new ContentValues();
+ values.put(LauncherSettings.Favorites.APPWIDGET_PROVIDER,
+ providerName);
+ values.put(LauncherSettings.Favorites.RESTORED,
+ appWidgetInfo.restoreStatus);
+ String where = BaseColumns._ID + "= ?";
+ String[] args = {Long.toString(id)};
+ contentResolver.update(contentUri, values, where, args);
}
sBgItemsIdMap.put(appWidgetInfo.id, appWidgetInfo);
sBgAppWidgets.add(appWidgetInfo);
@@ -2244,7 +2337,7 @@
if (itemsToRemove.size() > 0) {
ContentProviderClient client = contentResolver.acquireContentProviderClient(
- LauncherSettings.Favorites.CONTENT_URI);
+ contentUri);
// Remove dead items
for (long id : itemsToRemove) {
if (DEBUG_LOADERS) {
@@ -2262,7 +2355,7 @@
if (restoredRows.size() > 0) {
ContentProviderClient updater = contentResolver.acquireContentProviderClient(
- LauncherSettings.Favorites.CONTENT_URI);
+ contentUri);
// Update restored items that no longer require special handling
try {
StringBuilder selectionBuilder = new StringBuilder();
@@ -2272,7 +2365,7 @@
selectionBuilder.append(")");
ContentValues values = new ContentValues();
values.put(LauncherSettings.Favorites.RESTORED, 0);
- updater.update(LauncherSettings.Favorites.CONTENT_URI,
+ updater.update(LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION,
values, selectionBuilder.toString(), null);
} catch (RemoteException e) {
Log.w(TAG, "Could not update restored rows");
@@ -2852,11 +2945,69 @@
packagesRemoved.toArray(new String[packagesRemoved.size()]), user));
}
}
- sPendingPackages.clear();
+ sPendingPackages.clear();
}
}
}
+ /**
+ * Workaround to re-check unrestored items, in-case they were installed but the Package-ADD
+ * runnable was missed by the launcher.
+ */
+ public void recheckRestoredItems(final Context context) {
+ Runnable r = new Runnable() {
+
+ @Override
+ public void run() {
+ LauncherAppsCompat launcherApps = LauncherAppsCompat.getInstance(context);
+ HashSet<String> installedPackages = new HashSet<String>();
+ UserHandleCompat user = UserHandleCompat.myUserHandle();
+ synchronized(sBgLock) {
+ for (ItemInfo info : sBgItemsIdMap.values()) {
+ if (info instanceof ShortcutInfo) {
+ ShortcutInfo si = (ShortcutInfo) info;
+ if (si.isPromise() && si.getTargetComponent() != null
+ && launcherApps.isPackageEnabledForProfile(
+ si.getTargetComponent().getPackageName(), user)) {
+ installedPackages.add(si.getTargetComponent().getPackageName());
+ }
+ } else if (info instanceof LauncherAppWidgetInfo) {
+ LauncherAppWidgetInfo widget = (LauncherAppWidgetInfo) info;
+ if (widget.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
+ && launcherApps.isPackageEnabledForProfile(
+ widget.providerName.getPackageName(), user)) {
+ installedPackages.add(widget.providerName.getPackageName());
+ }
+ }
+ }
+ }
+
+ if (!installedPackages.isEmpty()) {
+ final ArrayList<AppInfo> restoredApps = new ArrayList<AppInfo>();
+ for (String pkg : installedPackages) {
+ for (LauncherActivityInfoCompat info : launcherApps.getActivityList(pkg, user)) {
+ restoredApps.add(new AppInfo(context, info, user, mIconCache, null));
+ }
+ }
+
+ final Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
+ if (!restoredApps.isEmpty()) {
+ mHandler.post(new Runnable() {
+ public void run() {
+ Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
+ if (callbacks == cb && cb != null) {
+ callbacks.bindAppsRestored(restoredApps);
+ }
+ }
+ });
+ }
+
+ }
+ }
+ };
+ sWorker.post(r);
+ }
+
private class PackageUpdatedTask implements Runnable {
int mOp;
String[] mPackages;
@@ -2983,17 +3134,12 @@
}
// Remove all the components associated with this package
for (String pn : removedPackageNames) {
- ArrayList<ItemInfo> infos = getItemInfoForPackageName(pn, mUser);
- for (ItemInfo i : infos) {
- deleteItemFromDatabase(context, i);
- }
+ deletePackageFromDatabase(context, pn, mUser);
}
// Remove all the specific components
for (AppInfo a : removedApps) {
ArrayList<ItemInfo> infos = getItemInfoForComponentName(a.componentName, mUser);
- for (ItemInfo i : infos) {
- deleteItemFromDatabase(context, i);
- }
+ deleteItemsFromDatabase(context, infos);
}
if (!removedPackageNames.isEmpty() || !removedApps.isEmpty()) {
// Remove any queued items from the install queue
@@ -3040,11 +3186,11 @@
public static ArrayList<Object> getSortedWidgetsAndShortcuts(Context context) {
PackageManager packageManager = context.getPackageManager();
final ArrayList<Object> widgetsAndShortcuts = new ArrayList<Object>();
- widgetsAndShortcuts.addAll(AppWidgetManager.getInstance(context).getInstalledProviders());
+ widgetsAndShortcuts.addAll(AppWidgetManagerCompat.getInstance(context).getAllProviders());
+
Intent shortcutsIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT);
widgetsAndShortcuts.addAll(packageManager.queryIntentActivities(shortcutsIntent, 0));
- Collections.sort(widgetsAndShortcuts,
- new LauncherModel.WidgetAndShortcutNameComparator(packageManager));
+ Collections.sort(widgetsAndShortcuts, new WidgetAndShortcutNameComparator(context));
return widgetsAndShortcuts;
}
@@ -3079,21 +3225,31 @@
* Make an ShortcutInfo object for a restored application or shortcut item that points
* to a package that is not yet installed on the system.
*/
- public ShortcutInfo getRestoredItemInfo(Cursor cursor, int titleIndex, Intent intent) {
+ public ShortcutInfo getRestoredItemInfo(Cursor cursor, int titleIndex, Intent intent,
+ int promiseType) {
final ShortcutInfo info = new ShortcutInfo();
- if (cursor != null) {
- info.title = cursor.getString(titleIndex);
- } else {
- info.title = "";
- }
info.user = UserHandleCompat.myUserHandle();
+ mIconCache.getTitleAndIcon(info, intent, info.user, true);
+
+ if ((promiseType & ShortcutInfo.FLAG_RESTORED_ICON) != 0) {
+ String title = (cursor != null) ? cursor.getString(titleIndex) : null;
+ if (!TextUtils.isEmpty(title)) {
+ info.title = title;
+ }
+ info.status = ShortcutInfo.FLAG_RESTORED_ICON;
+ } else if ((promiseType & ShortcutInfo.FLAG_AUTOINTALL_ICON) != 0) {
+ if (TextUtils.isEmpty(info.title)) {
+ info.title = (cursor != null) ? cursor.getString(titleIndex) : "";
+ }
+ info.status = ShortcutInfo.FLAG_AUTOINTALL_ICON;
+ } else {
+ throw new InvalidParameterException("Invalid restoreType " + promiseType);
+ }
+
info.contentDescription = mUserManager.getBadgedLabelForUser(
info.title.toString(), info.user);
- info.setIcon(mIconCache.getIcon(intent, info.title.toString(), info.user, false));
info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
- info.restoredIntent = intent;
- info.wasPromise = true;
- info.setState(ShortcutInfo.PACKAGE_STATE_UNKNOWN);
+ info.promisedIntent = intent;
return info;
}
@@ -3102,17 +3258,17 @@
* to the market page for the item.
*/
private Intent getRestoredItemIntent(Cursor c, Context context, Intent intent) {
- final boolean debug = false;
ComponentName componentName = intent.getComponent();
- Intent marketIntent = new Intent(Intent.ACTION_VIEW);
- Uri marketUri = new Uri.Builder()
+ return getMarketIntent(componentName.getPackageName());
+ }
+
+ static Intent getMarketIntent(String packageName) {
+ return new Intent(Intent.ACTION_VIEW)
+ .setData(new Uri.Builder()
.scheme("market")
.authority("details")
- .appendQueryParameter("id", componentName.getPackageName())
- .build();
- if (debug) Log.d(TAG, "manufactured intent uri: " + marketUri.toString());
- marketIntent.setData(marketUri);
- return marketIntent;
+ .appendQueryParameter("id", packageName)
+ .build());
}
/**
@@ -3208,20 +3364,14 @@
for (ItemInfo i : infos) {
if (i instanceof ShortcutInfo) {
ShortcutInfo info = (ShortcutInfo) i;
- ComponentName cn = info.intent.getComponent();
- if (info.restoredIntent != null) {
- cn = info.restoredIntent.getComponent();
- }
+ ComponentName cn = info.getTargetComponent();
if (cn != null && f.filterItem(null, info, cn)) {
filtered.add(info);
}
} else if (i instanceof FolderInfo) {
FolderInfo info = (FolderInfo) i;
for (ShortcutInfo s : info.contents) {
- ComponentName cn = s.intent.getComponent();
- if (s.restoredIntent != null) {
- cn = s.restoredIntent.getComponent();
- }
+ ComponentName cn = s.getTargetComponent();
if (cn != null && f.filterItem(info, s, cn)) {
filtered.add(s);
}
@@ -3237,17 +3387,6 @@
return new ArrayList<ItemInfo>(filtered);
}
- private ArrayList<ItemInfo> getItemInfoForPackageName(final String pn,
- final UserHandleCompat user) {
- ItemInfoFilter filter = new ItemInfoFilter() {
- @Override
- public boolean filterItem(ItemInfo parent, ItemInfo info, ComponentName cn) {
- return cn.getPackageName().equals(pn) && info.user.equals(user);
- }
- };
- return filterItemInfos(sBgItemsIdMap.values(), filter);
- }
-
private ArrayList<ItemInfo> getItemInfoForComponentName(final ComponentName cname,
final UserHandleCompat user) {
ItemInfoFilter filter = new ItemInfoFilter() {
@@ -3276,7 +3415,7 @@
return true;
}
// placeholder shortcuts get special treatment, let them through too.
- if (info.getRestoredIntent() != null) {
+ if (info.isPromise()) {
return true;
}
}
@@ -3390,44 +3529,6 @@
return null;
}
- /**
- * Returns a list of all the widgets that can handle configuration with a particular mimeType.
- */
- List<WidgetMimeTypeHandlerData> resolveWidgetsForMimeType(Context context, String mimeType) {
- final PackageManager packageManager = context.getPackageManager();
- final List<WidgetMimeTypeHandlerData> supportedConfigurationActivities =
- new ArrayList<WidgetMimeTypeHandlerData>();
-
- final Intent supportsIntent =
- new Intent(InstallWidgetReceiver.ACTION_SUPPORTS_CLIPDATA_MIMETYPE);
- supportsIntent.setType(mimeType);
-
- // Create a set of widget configuration components that we can test against
- final List<AppWidgetProviderInfo> widgets =
- AppWidgetManager.getInstance(context).getInstalledProviders();
- final HashMap<ComponentName, AppWidgetProviderInfo> configurationComponentToWidget =
- new HashMap<ComponentName, AppWidgetProviderInfo>();
- for (AppWidgetProviderInfo info : widgets) {
- configurationComponentToWidget.put(info.configure, info);
- }
-
- // Run through each of the intents that can handle this type of clip data, and cross
- // reference them with the components that are actual configuration components
- final List<ResolveInfo> activities = packageManager.queryIntentActivities(supportsIntent,
- PackageManager.MATCH_DEFAULT_ONLY);
- for (ResolveInfo info : activities) {
- final ActivityInfo activityInfo = info.activityInfo;
- final ComponentName infoComponent = new ComponentName(activityInfo.packageName,
- activityInfo.name);
- if (configurationComponentToWidget.containsKey(infoComponent)) {
- supportedConfigurationActivities.add(
- new InstallWidgetReceiver.WidgetMimeTypeHandlerData(info,
- configurationComponentToWidget.get(infoComponent)));
- }
- }
- return supportedConfigurationActivities;
- }
-
ShortcutInfo infoFromShortcutIntent(Context context, Intent data, Bitmap fallbackIcon) {
Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
@@ -3570,14 +3671,6 @@
return 0;
}
};
- public static final Comparator<AppWidgetProviderInfo> getWidgetNameComparator() {
- final Collator collator = Collator.getInstance();
- return new Comparator<AppWidgetProviderInfo>() {
- public final int compare(AppWidgetProviderInfo a, AppWidgetProviderInfo b) {
- return collator.compare(a.label.toString().trim(), b.label.toString().trim());
- }
- };
- }
static ComponentName getComponentNameFromResolveInfo(ResolveInfo info) {
if (info.activityInfo != null) {
return new ComponentName(info.activityInfo.packageName, info.activityInfo.name);
@@ -3618,11 +3711,14 @@
}
};
public static class WidgetAndShortcutNameComparator implements Comparator<Object> {
- private Collator mCollator;
- private PackageManager mPackageManager;
- private HashMap<Object, String> mLabelCache;
- WidgetAndShortcutNameComparator(PackageManager pm) {
- mPackageManager = pm;
+ private final AppWidgetManagerCompat mManager;
+ private final PackageManager mPackageManager;
+ private final HashMap<Object, String> mLabelCache;
+ private final Collator mCollator;
+
+ WidgetAndShortcutNameComparator(Context context) {
+ mManager = AppWidgetManagerCompat.getInstance(context);
+ mPackageManager = context.getPackageManager();
mLabelCache = new HashMap<Object, String>();
mCollator = Collator.getInstance();
}
@@ -3631,17 +3727,17 @@
if (mLabelCache.containsKey(a)) {
labelA = mLabelCache.get(a);
} else {
- labelA = (a instanceof AppWidgetProviderInfo) ?
- ((AppWidgetProviderInfo) a).label :
- ((ResolveInfo) a).loadLabel(mPackageManager).toString().trim();
+ labelA = (a instanceof AppWidgetProviderInfo)
+ ? mManager.loadLabel((AppWidgetProviderInfo) a)
+ : ((ResolveInfo) a).loadLabel(mPackageManager).toString().trim();
mLabelCache.put(a, labelA);
}
if (mLabelCache.containsKey(b)) {
labelB = mLabelCache.get(b);
} else {
- labelB = (b instanceof AppWidgetProviderInfo) ?
- ((AppWidgetProviderInfo) b).label :
- ((ResolveInfo) b).loadLabel(mPackageManager).toString().trim();
+ labelB = (b instanceof AppWidgetProviderInfo)
+ ? mManager.loadLabel((AppWidgetProviderInfo) b)
+ : ((ResolveInfo) b).loadLabel(mPackageManager).toString().trim();
mLabelCache.put(b, labelB);
}
return mCollator.compare(labelA, labelB);
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index af65536..6cc1688 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -308,6 +308,13 @@
}
/**
+ * Clears all the data for a fresh start.
+ */
+ synchronized public void createEmptyDB() {
+ mOpenHelper.createEmptyDB(mOpenHelper.getWritableDatabase());
+ }
+
+ /**
* Loads the default workspace based on the following priority scheme:
* 1) From a package provided by play store
* 2) From a partner configuration APK, already in the system image
@@ -327,7 +334,7 @@
final Partner partner = Partner.get(getContext().getPackageManager());
if (partner != null && partner.hasDefaultLayout()) {
final Resources partnerRes = partner.getResources();
- int workspaceResId = partnerRes.getIdentifier(Partner.RESOURCE_DEFAULT_LAYOUT,
+ int workspaceResId = partnerRes.getIdentifier(Partner.RES_DEFAULT_LAYOUT,
"xml", partner.getPackageName());
if (workspaceResId != 0) {
loader = new SimpleWorkspaceLoader(mOpenHelper, partnerRes, workspaceResId);
@@ -908,7 +915,14 @@
// This shouldn't happen -- throw our hands up in the air and start over.
Log.w(TAG, "Database version downgrade from: " + oldVersion + " to " + newVersion +
". Wiping databse.");
+ createEmptyDB(db);
+ }
+
+ /**
+ * Clears all the data for a fresh start.
+ */
+ public void createEmptyDB(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_WORKSPACE_SCREENS);
onCreate(db);
@@ -1276,14 +1290,16 @@
try {
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
- if (appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,cn)) {
- return true;
+ if (!appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,cn)) {
+ return false;
}
} catch (RuntimeException e) {
Log.e(TAG, "Failed to initialize external widget", e);
+ return false;
}
+ } else {
+ return false;
}
- return false;
}
// Add screen id if not present
@@ -1509,7 +1525,7 @@
final Partner partner = Partner.get(mPackageManager);
if (partner != null) {
final Resources partnerRes = partner.getResources();
- final int resId = partnerRes.getIdentifier(Partner.RESOURCE_FOLDER,
+ final int resId = partnerRes.getIdentifier(Partner.RES_FOLDER,
"xml", partner.getPackageName());
if (resId != 0) {
final XmlResourceParser partnerParser = partnerRes.getXml(resId);
@@ -1539,24 +1555,11 @@
}
/**
- * Parse folder starting at current {@link XmlPullParser} location.
+ * Parse folder items starting at {@link XmlPullParser} location. Allow recursive
+ * includes of items.
*/
- private boolean loadFolder(SQLiteDatabase db, ContentValues values, Resources res,
- XmlResourceParser parser) throws IOException, XmlPullParserException {
- final String title;
- final int titleResId = getAttributeResourceValue(parser, ATTR_TITLE, 0);
- if (titleResId != 0) {
- title = res.getString(titleResId);
- } else {
- title = mContext.getResources().getString(R.string.folder_name);
- }
-
- values.put(LauncherSettings.Favorites.TITLE, title);
- long folderId = addFolder(db, values);
- boolean added = folderId >= 0;
-
- ArrayList<Long> folderItems = new ArrayList<Long>();
-
+ private void addToFolder(SQLiteDatabase db, Resources res, XmlResourceParser parser,
+ ArrayList<Long> folderItems, long folderId) throws IOException, XmlPullParserException {
int type;
int folderDepth = parser.getDepth();
while ((type = parser.next()) != XmlPullParser.END_TAG ||
@@ -1586,10 +1589,33 @@
if (id >= 0) {
folderItems.add(id);
}
+ } else if (TAG_INCLUDE.equals(tag) && folderId >= 0) {
+ addToFolder(db, res, parser, folderItems, folderId);
} else {
throw new RuntimeException("Folders can contain only shortcuts");
}
}
+ }
+
+ /**
+ * Parse folder starting at current {@link XmlPullParser} location.
+ */
+ private boolean loadFolder(SQLiteDatabase db, ContentValues values, Resources res,
+ XmlResourceParser parser) throws IOException, XmlPullParserException {
+ final String title;
+ final int titleResId = getAttributeResourceValue(parser, ATTR_TITLE, 0);
+ if (titleResId != 0) {
+ title = res.getString(titleResId);
+ } else {
+ title = mContext.getResources().getString(R.string.folder_name);
+ }
+
+ values.put(LauncherSettings.Favorites.TITLE, title);
+ long folderId = addFolder(db, values);
+ boolean added = folderId >= 0;
+
+ ArrayList<Long> folderItems = new ArrayList<Long>();
+ addToFolder(db, res, parser, folderItems, folderId);
// We can only have folders with >= 2 items, so we need to remove the
// folder and clean up if less than 2 items were included, or some
@@ -1650,8 +1676,10 @@
resolved = systemApp;
}
final ActivityInfo info = resolved.activityInfo;
- final Intent intent = buildMainIntent();
- intent.setComponent(new ComponentName(info.packageName, info.name));
+ final Intent intent = mPackageManager.getLaunchIntentForPackage(info.packageName);
+ if (intent == null) {
+ return -1;
+ }
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 54aa24e..48fc0c9 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -594,8 +594,11 @@
private void updatePageIndicator() {
// Update the page indicator (when we aren't reordering)
- if (mPageIndicator != null && !isReordering(false)) {
- mPageIndicator.setActiveMarker(getNextPage());
+ if (mPageIndicator != null) {
+ mPageIndicator.setContentDescription(getPageIndicatorDescription());
+ if (!isReordering(false)) {
+ mPageIndicator.setActiveMarker(getNextPage());
+ }
}
}
protected void pageBeginMoving() {
@@ -996,9 +999,7 @@
}
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
- setHorizontalScrollBarEnabled(false);
updateCurrentPageScroll();
- setHorizontalScrollBarEnabled(true);
mFirstLayout = false;
}
diff --git a/src/com/android/launcher3/PagedViewIcon.java b/src/com/android/launcher3/PagedViewIcon.java
deleted file mode 100644
index e819d5e..0000000
--- a/src/com/android/launcher3/PagedViewIcon.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Region;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.util.TypedValue;
-import android.widget.TextView;
-
-/**
- * An icon on a PagedView, specifically for items in the launcher's paged view (with compound
- * drawables on the top).
- */
-public class PagedViewIcon extends TextView {
- /** A simple callback interface to allow a PagedViewIcon to notify when it has been pressed */
- public static interface PressedCallback {
- void iconPressed(PagedViewIcon icon);
- }
-
- @SuppressWarnings("unused")
- private static final String TAG = "PagedViewIcon";
- private static final float PRESS_ALPHA = 0.4f;
-
- private PagedViewIcon.PressedCallback mPressedCallback;
- private boolean mLockDrawableState = false;
-
- private Bitmap mIcon;
-
- public PagedViewIcon(Context context) {
- this(context, null);
- }
-
- public PagedViewIcon(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public PagedViewIcon(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public void onFinishInflate() {
- super.onFinishInflate();
-
- // Ensure we are using the right text size
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx);
- }
-
- public void applyFromApplicationInfo(AppInfo info, boolean scaleUp,
- PagedViewIcon.PressedCallback cb) {
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
-
- mIcon = info.iconBitmap;
- mPressedCallback = cb;
- Drawable icon = Utilities.createIconDrawable(mIcon);
- icon.setBounds(0, 0, grid.allAppsIconSizePx, grid.allAppsIconSizePx);
- setCompoundDrawables(null, icon, null, null);
- setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
- setText(info.title);
- if (info.contentDescription != null) {
- setContentDescription(info.contentDescription);
- }
- setTag(info);
- }
-
- public void lockDrawableState() {
- mLockDrawableState = true;
- }
-
- public void resetDrawableState() {
- mLockDrawableState = false;
- post(new Runnable() {
- @Override
- public void run() {
- refreshDrawableState();
- }
- });
- }
-
- protected void drawableStateChanged() {
- super.drawableStateChanged();
-
- // We keep in the pressed state until resetDrawableState() is called to reset the press
- // feedback
- if (isPressed()) {
- setAlpha(PRESS_ALPHA);
- if (mPressedCallback != null) {
- mPressedCallback.iconPressed(this);
- }
- } else if (!mLockDrawableState) {
- setAlpha(1f);
- }
- }
-}
diff --git a/src/com/android/launcher3/PagedViewWidget.java b/src/com/android/launcher3/PagedViewWidget.java
index db4aeb9..e6e11a3 100644
--- a/src/com/android/launcher3/PagedViewWidget.java
+++ b/src/com/android/launcher3/PagedViewWidget.java
@@ -30,6 +30,8 @@
import android.widget.LinearLayout;
import android.widget.TextView;
+import com.android.launcher3.compat.AppWidgetManagerCompat;
+
/**
* The linear layout used strictly for the widget/wallpaper tab of the customization tray
*/
@@ -127,7 +129,7 @@
image.setMaxWidth(maxWidth);
}
final TextView name = (TextView) findViewById(R.id.widget_name);
- name.setText(info.label);
+ name.setText(AppWidgetManagerCompat.getInstance(getContext()).loadLabel(info));
final TextView dims = (TextView) findViewById(R.id.widget_dims);
if (dims != null) {
int hSpan = Math.min(cellSpan[0], (int) grid.numColumns);
diff --git a/src/com/android/launcher3/Partner.java b/src/com/android/launcher3/Partner.java
new file mode 100644
index 0000000..e191319
--- /dev/null
+++ b/src/com/android/launcher3/Partner.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.Pair;
+
+import java.io.File;
+
+/**
+ * Utilities to discover and interact with partner customizations. There can
+ * only be one set of customizations on a device, and it must be bundled with
+ * the system.
+ */
+public class Partner {
+
+ static final String TAG = "Launcher.Partner";
+
+ /** Marker action used to discover partner */
+ private static final String
+ ACTION_PARTNER_CUSTOMIZATION = "com.android.launcher3.action.PARTNER_CUSTOMIZATION";
+
+ public static final String RES_FOLDER = "partner_folder";
+ public static final String RES_WALLPAPERS = "partner_wallpapers";
+ public static final String RES_DEFAULT_LAYOUT = "partner_default_layout";
+
+ public static final String RES_DEFAULT_WALLPAPER_HIDDEN = "default_wallpapper_hidden";
+ public static final String RES_SYSTEM_WALLPAPER_DIR = "system_wallpaper_directory";
+
+ public static final String RES_REQUIRE_FIRST_RUN_FLOW = "requires_first_run_flow";
+
+ /** These resources are used to override the device profile */
+ public static final String RES_GRID_AA_SHORT_EDGE_COUNT = "grid_aa_short_edge_count";
+ public static final String RES_GRID_AA_LONG_EDGE_COUNT = "grid_aa_long_edge_count";
+ public static final String RES_GRID_NUM_ROWS = "grid_num_rows";
+ public static final String RES_GRID_NUM_COLUMNS = "grid_num_columns";
+ public static final String RES_GRID_ICON_SIZE_DP = "grid_icon_size_dp";
+
+ private static boolean sSearched = false;
+ private static Partner sPartner;
+
+ /**
+ * Find and return partner details, or {@code null} if none exists.
+ */
+ public static synchronized Partner get(PackageManager pm) {
+ if (!sSearched) {
+ Pair<String, Resources> apkInfo = Utilities.findSystemApk(ACTION_PARTNER_CUSTOMIZATION, pm);
+ if (apkInfo != null) {
+ sPartner = new Partner(apkInfo.first, apkInfo.second);
+ }
+ sSearched = true;
+ }
+ return sPartner;
+ }
+
+ private final String mPackageName;
+ private final Resources mResources;
+
+ private Partner(String packageName, Resources res) {
+ mPackageName = packageName;
+ mResources = res;
+ }
+
+ public String getPackageName() {
+ return mPackageName;
+ }
+
+ public Resources getResources() {
+ return mResources;
+ }
+
+ public boolean hasDefaultLayout() {
+ int defaultLayout = getResources().getIdentifier(Partner.RES_DEFAULT_LAYOUT,
+ "xml", getPackageName());
+ return defaultLayout != 0;
+ }
+
+ public boolean hasFolder() {
+ int folder = getResources().getIdentifier(Partner.RES_FOLDER,
+ "xml", getPackageName());
+ return folder != 0;
+ }
+
+ public boolean hideDefaultWallpaper() {
+ int resId = getResources().getIdentifier(RES_DEFAULT_WALLPAPER_HIDDEN, "bool",
+ getPackageName());
+ return resId != 0 && getResources().getBoolean(resId);
+ }
+
+ public File getWallpaperDirectory() {
+ int resId = getResources().getIdentifier(RES_SYSTEM_WALLPAPER_DIR, "string",
+ getPackageName());
+ return (resId != 0) ? new File(getResources().getString(resId)) : null;
+ }
+
+ public boolean requiresFirstRunFlow() {
+ int resId = getResources().getIdentifier(RES_REQUIRE_FIRST_RUN_FLOW, "bool",
+ getPackageName());
+ return resId != 0 && getResources().getBoolean(resId);
+ }
+
+ public DeviceProfile getDeviceProfileOverride(DisplayMetrics dm) {
+ boolean containsProfileOverrides = false;
+
+ DeviceProfile dp = new DeviceProfile();
+
+ // We initialize customizable fields to be invalid
+ dp.numRows = -1;
+ dp.numColumns = -1;
+ dp.allAppsShortEdgeCount = -1;
+ dp.allAppsLongEdgeCount = -1;
+
+ try {
+ int resId = getResources().getIdentifier(RES_GRID_NUM_ROWS,
+ "integer", getPackageName());
+ if (resId > 0) {
+ containsProfileOverrides = true;
+ dp.numRows = getResources().getInteger(resId);
+ }
+
+ resId = getResources().getIdentifier(RES_GRID_NUM_COLUMNS,
+ "integer", getPackageName());
+ if (resId > 0) {
+ containsProfileOverrides = true;
+ dp.numColumns = getResources().getInteger(resId);
+ }
+
+ resId = getResources().getIdentifier(RES_GRID_AA_SHORT_EDGE_COUNT,
+ "integer", getPackageName());
+ if (resId > 0) {
+ containsProfileOverrides = true;
+ dp.allAppsShortEdgeCount = getResources().getInteger(resId);
+ }
+
+ resId = getResources().getIdentifier(RES_GRID_AA_LONG_EDGE_COUNT,
+ "integer", getPackageName());
+ if (resId > 0) {
+ containsProfileOverrides = true;
+ dp.allAppsLongEdgeCount = getResources().getInteger(resId);
+ }
+
+ resId = getResources().getIdentifier(RES_GRID_ICON_SIZE_DP,
+ "dimen", getPackageName());
+ if (resId > 0) {
+ containsProfileOverrides = true;
+ int px = getResources().getDimensionPixelSize(resId);
+ dp.iconSize = DynamicGrid.dpiFromPx(px, dm);
+ }
+ } catch (Resources.NotFoundException ex) {
+ Log.e(TAG, "Invalid Partner grid resource!", ex);
+ }
+ return containsProfileOverrides ? dp : null;
+ }
+}
diff --git a/src/com/android/launcher3/PendingAppWidgetHostView.java b/src/com/android/launcher3/PendingAppWidgetHostView.java
index 0401436..d23a330 100644
--- a/src/com/android/launcher3/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/PendingAppWidgetHostView.java
@@ -24,6 +24,10 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.text.Layout;
+import android.text.StaticLayout;
+import android.text.TextPaint;
+import android.util.TypedValue;
import android.view.View;
import android.view.View.OnClickListener;
@@ -46,12 +50,19 @@
private boolean mDrawableSizeChanged;
+ private final TextPaint mPaint;
+ private Layout mSetupTextLayout;
+
public PendingAppWidgetHostView(Context context, LauncherAppWidgetInfo info) {
super(context);
mInfo = info;
mStartState = info.restoreStatus;
mIconLookupIntent = new Intent().setComponent(info.providerName);
+ mPaint = new TextPaint();
+ mPaint.setColor(0xFFFFFFFF);
+ mPaint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
+ getDeviceProfile().iconTextSizePx, getResources().getDisplayMetrics()));
setBackgroundResource(R.drawable.quantum_panel_dark);
setWillNotDraw(false);
}
@@ -127,7 +138,7 @@
public void applyState() {
if (mDrawable != null) {
- mDrawable.setLevel(mInfo.installProgress);
+ mDrawable.setLevel(Math.max(mInfo.installProgress, 0));
}
}
@@ -165,27 +176,66 @@
mDrawable.draw(canvas);
} else if ((mCenterDrawable != null) && (mTopCornerDrawable != null)) {
if (mDrawableSizeChanged) {
- int iconSize = getResources().getDimensionPixelSize(R.dimen.app_icon_size);
+ DeviceProfile grid = getDeviceProfile();
+ int iconSize = grid.iconSizePx;
int paddingTop = getPaddingTop();
+ int paddingBottom = getPaddingBottom();
int paddingLeft = getPaddingLeft();
+ int paddingRight = getPaddingRight();
- int size = Math.min(iconSize, Math.min(
- getWidth() - paddingLeft - getPaddingRight(),
- getHeight() - paddingTop - getPaddingBottom()));
- mRect.set(0, 0, size, size);
- mRect.offsetTo((getWidth() - mRect.width()) / 2, (getHeight() - mRect.height()) / 2);
- mCenterDrawable.setBounds(mRect);
+ int availableWidth = getWidth() - paddingLeft - paddingRight;
+ int availableHeight = getHeight() - paddingTop - paddingBottom;
- size = Math.min(size / 2,
- Math.max(mRect.top - paddingTop, mRect.left - paddingLeft));
- mTopCornerDrawable.setBounds(paddingLeft, paddingTop,
- paddingLeft + size, paddingTop + size);
+ // Recreate the setup text.
+ mSetupTextLayout = new StaticLayout(
+ getResources().getText(R.string.gadget_setup_text), mPaint, availableWidth,
+ Layout.Alignment.ALIGN_CENTER, 1, 0, true);
+ if (mSetupTextLayout.getLineCount() == 1) {
+ // The text fits in a single line. No need to draw the setup icon.
+ int size = Math.min(iconSize, Math.min(availableWidth,
+ availableHeight - mSetupTextLayout.getHeight()));
+ mRect.set(0, 0, size, size);
+ mRect.offsetTo((getWidth() - mRect.width()) / 2,
+ (getHeight() - mRect.height() - mSetupTextLayout.getHeight()
+ - grid.iconDrawablePaddingPx) / 2);
+
+ mTopCornerDrawable.setBounds(mRect);
+
+ // Update left and top to indicate the position where the text will be drawn.
+ mRect.left = paddingLeft;
+ mRect.top = mRect.bottom + grid.iconDrawablePaddingPx;
+ } else {
+ // The text can't be drawn in a single line. Draw a setup icon instead.
+ mSetupTextLayout = null;
+ int size = Math.min(iconSize, Math.min(
+ getWidth() - paddingLeft - paddingRight,
+ getHeight() - paddingTop - paddingBottom));
+ mRect.set(0, 0, size, size);
+ mRect.offsetTo((getWidth() - mRect.width()) / 2, (getHeight() - mRect.height()) / 2);
+ mCenterDrawable.setBounds(mRect);
+
+ size = Math.min(size / 2,
+ Math.max(mRect.top - paddingTop, mRect.left - paddingLeft));
+ mTopCornerDrawable.setBounds(paddingLeft, paddingTop,
+ paddingLeft + size, paddingTop + size);
+ }
mDrawableSizeChanged = false;
}
- mCenterDrawable.draw(canvas);
- mTopCornerDrawable.draw(canvas);
+ if (mSetupTextLayout == null) {
+ mCenterDrawable.draw(canvas);
+ mTopCornerDrawable.draw(canvas);
+ } else {
+ canvas.save();
+ canvas.translate(mRect.left, mRect.top);
+ mSetupTextLayout.draw(canvas);
+ canvas.restore();
+ mTopCornerDrawable.draw(canvas);
+ }
}
}
+ private DeviceProfile getDeviceProfile() {
+ return LauncherAppState.getInstance().getDynamicGrid().getDeviceProfile();
+ }
}
diff --git a/src/com/android/launcher3/ScrimView.java b/src/com/android/launcher3/ScrimView.java
deleted file mode 100644
index 68200fe..0000000
--- a/src/com/android/launcher3/ScrimView.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.launcher3;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.widget.FrameLayout;
-
-public class ScrimView extends FrameLayout implements Insettable {
-
- public ScrimView(Context context) {
- this(context, null, 0);
- }
-
- public ScrimView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public ScrimView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- @Override
- public void setInsets(Rect insets) {
- // Do nothing
- }
-}
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java
index 612b0a5..daf3434 100644
--- a/src/com/android/launcher3/ShortcutInfo.java
+++ b/src/com/android/launcher3/ShortcutInfo.java
@@ -16,6 +16,7 @@
package com.android.launcher3;
+import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
@@ -32,17 +33,31 @@
*/
public class ShortcutInfo extends ItemInfo {
- /** {@link #mState} meaning this package is not installed, and there is no other information. */
- public static final int PACKAGE_STATE_UNKNOWN = -2;
+ public static final int DEFAULT = 0;
- /** {@link #mState} meaning this package is not installed, because installation failed. */
- public static final int PACKAGE_STATE_ERROR = -1;
+ /**
+ * The shortcut was restored from a backup and it not ready to be used. This is automatically
+ * set during backup/restore
+ */
+ public static final int FLAG_RESTORED_ICON = 1;
- /** {@link #mState} meaning this package is installed. This is the typical case. */
- public static final int PACKAGE_STATE_DEFAULT = 0;
+ /**
+ * The icon was added as an auto-install app, and is not ready to be used. This flag can't
+ * be present along with {@link #FLAG_RESTORED_ICON}, and is set during default layout
+ * parsing.
+ */
+ public static final int FLAG_AUTOINTALL_ICON = 2;
- /** {@link #mState} meaning some external entity has promised to install this package. */
- public static final int PACKAGE_STATE_INSTALLING = 1;
+ /**
+ * The icon is being installed. If {@link FLAG_RESTORED_ICON} or {@link FLAG_AUTOINTALL_ICON}
+ * is set, then the icon is either being installed or is in a broken state.
+ */
+ public static final int FLAG_INSTALL_SESSION_ACTIVE = 4;
+
+ /**
+ * Indicates that the widget restore has started.
+ */
+ public static final int FLAG_RESTORE_STARTED = 8;
/**
* The intent used to start the application.
@@ -78,29 +93,29 @@
*/
boolean isDisabled = false;
- /**
- * The installation state of the package that this shortcut represents.
- */
- protected int mState;
+ int status;
/**
* The installation progress [0-100] of the package that this shortcut represents.
*/
- protected int mProgress;
+ private int mInstallProgress;
+ /**
+ * Refer {@link AppInfo#firstInstallTime}.
+ */
long firstInstallTime;
+
+ /**
+ * TODO move this to {@link status}
+ */
int flags = 0;
/**
* If this shortcut is a placeholder, then intent will be a market intent for the package, and
* this will hold the original intent from the database. Otherwise, null.
+ * Refer {@link #FLAG_RESTORE_PENDING}, {@link #FLAG_INSTALL_PENDING}
*/
- Intent restoredIntent;
-
- /**
- * This is set once to indicate that it was a promise info at some point of its life.
- */
- boolean wasPromise = false;
+ Intent promisedIntent;
ShortcutInfo() {
itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT;
@@ -110,21 +125,6 @@
return intent;
}
- protected Intent getRestoredIntent() {
- return restoredIntent;
- }
-
- /**
- * Overwrite placeholder data with restored data, or do nothing if this is not a placeholder.
- */
- public void restore() {
- if (restoredIntent != null) {
- intent = restoredIntent;
- restoredIntent = null;
- mState = PACKAGE_STATE_DEFAULT;
- }
- }
-
ShortcutInfo(Intent intent, CharSequence title, CharSequence contentDescription,
Bitmap icon, UserHandleCompat user) {
this();
@@ -149,6 +149,7 @@
flags = info.flags;
firstInstallTime = info.firstInstallTime;
user = info.user;
+ status = info.status;
}
/** TODO: Remove this. It's only called by ApplicationInfo.makeShortcut. */
@@ -173,7 +174,7 @@
}
public void updateIcon(IconCache iconCache) {
- mIcon = iconCache.getIcon(intent, user);
+ mIcon = iconCache.getIcon(promisedIntent != null ? promisedIntent : intent, user);
usingFallbackIcon = iconCache.isDefaultIcon(mIcon, user);
}
@@ -184,7 +185,7 @@
String titleStr = title != null ? title.toString() : null;
values.put(LauncherSettings.BaseLauncherColumns.TITLE, titleStr);
- String uri = restoredIntent != null ? restoredIntent.toUri(0)
+ String uri = promisedIntent != null ? promisedIntent.toUri(0)
: (intent != null ? intent.toUri(0) : null);
values.put(LauncherSettings.BaseLauncherColumns.INTENT, uri);
@@ -224,36 +225,26 @@
}
}
- public boolean isPromise() {
- return restoredIntent != null;
+ public ComponentName getTargetComponent() {
+ return promisedIntent != null ? promisedIntent.getComponent() : intent.getComponent();
}
- public boolean isPromiseFor(String pkgName) {
- return restoredIntent != null
- && pkgName != null
- && pkgName.equals(restoredIntent.getComponent().getPackageName());
+ public boolean hasStatusFlag(int flag) {
+ return (status & flag) != 0;
}
- public boolean isAbandoned() {
- return isPromise()
- && (mState == PACKAGE_STATE_ERROR
- || mState == PACKAGE_STATE_UNKNOWN);
+
+ public final boolean isPromise() {
+ return hasStatusFlag(FLAG_RESTORED_ICON | FLAG_AUTOINTALL_ICON);
}
- public int getProgress() {
- return mProgress;
+ public int getInstallProgress() {
+ return mInstallProgress;
}
- public void setProgress(int progress) {
- mProgress = progress;
- }
-
- public void setState(int state) {
- mState = state;
- }
-
- public int getState() {
- return mState;
+ public void setInstallProgress(int progress) {
+ mInstallProgress = progress;
+ status |= FLAG_INSTALL_SESSION_ACTIVE;
}
}
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index f70fc4d..1a7c9fc 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -78,7 +78,7 @@
/**
* Returns a FastBitmapDrawable with the icon, accurately sized.
*/
- static FastBitmapDrawable createIconDrawable(Bitmap icon) {
+ public static FastBitmapDrawable createIconDrawable(Bitmap icon) {
FastBitmapDrawable d = new FastBitmapDrawable(icon);
d.setFilterBitmap(true);
resizeIconDrawable(d);
@@ -103,11 +103,10 @@
}
/**
- * Indicates if the device is running LMP or not.
- * TODO(sansid): Change the check to a VERSION_CODES code check once we have a version for L.
+ * Indicates if the device is running LMP or higher.
*/
- public static boolean isLmp() {
- return "L".equals(Build.VERSION.CODENAME);
+ public static boolean isLmpOrAbove() {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
/**
diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java
index 1b37700..5aa7190 100644
--- a/src/com/android/launcher3/WidgetPreviewLoader.java
+++ b/src/com/android/launcher3/WidgetPreviewLoader.java
@@ -5,7 +5,6 @@
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.database.Cursor;
@@ -29,6 +28,8 @@
import android.os.AsyncTask;
import android.util.Log;
+import com.android.launcher3.compat.AppWidgetManagerCompat;
+
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -42,124 +43,123 @@
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
-abstract class SoftReferenceThreadLocal<T> {
- private ThreadLocal<SoftReference<T>> mThreadLocal;
- public SoftReferenceThreadLocal() {
- mThreadLocal = new ThreadLocal<SoftReference<T>>();
- }
+public class WidgetPreviewLoader {
- abstract T initialValue();
+ private static abstract class SoftReferenceThreadLocal<T> {
+ private ThreadLocal<SoftReference<T>> mThreadLocal;
+ public SoftReferenceThreadLocal() {
+ mThreadLocal = new ThreadLocal<SoftReference<T>>();
+ }
- public void set(T t) {
- mThreadLocal.set(new SoftReference<T>(t));
- }
+ abstract T initialValue();
- public T get() {
- SoftReference<T> reference = mThreadLocal.get();
- T obj;
- if (reference == null) {
- obj = initialValue();
- mThreadLocal.set(new SoftReference<T>(obj));
- return obj;
- } else {
- obj = reference.get();
- if (obj == null) {
+ public void set(T t) {
+ mThreadLocal.set(new SoftReference<T>(t));
+ }
+
+ public T get() {
+ SoftReference<T> reference = mThreadLocal.get();
+ T obj;
+ if (reference == null) {
obj = initialValue();
mThreadLocal.set(new SoftReference<T>(obj));
+ return obj;
+ } else {
+ obj = reference.get();
+ if (obj == null) {
+ obj = initialValue();
+ mThreadLocal.set(new SoftReference<T>(obj));
+ }
+ return obj;
}
- return obj;
}
}
-}
-class CanvasCache extends SoftReferenceThreadLocal<Canvas> {
- @Override
- protected Canvas initialValue() {
- return new Canvas();
+ private static class CanvasCache extends SoftReferenceThreadLocal<Canvas> {
+ @Override
+ protected Canvas initialValue() {
+ return new Canvas();
+ }
}
-}
-class PaintCache extends SoftReferenceThreadLocal<Paint> {
- @Override
- protected Paint initialValue() {
- return null;
+ private static class PaintCache extends SoftReferenceThreadLocal<Paint> {
+ @Override
+ protected Paint initialValue() {
+ return null;
+ }
}
-}
-class BitmapCache extends SoftReferenceThreadLocal<Bitmap> {
- @Override
- protected Bitmap initialValue() {
- return null;
+ private static class BitmapCache extends SoftReferenceThreadLocal<Bitmap> {
+ @Override
+ protected Bitmap initialValue() {
+ return null;
+ }
}
-}
-class RectCache extends SoftReferenceThreadLocal<Rect> {
- @Override
- protected Rect initialValue() {
- return new Rect();
+ private static class RectCache extends SoftReferenceThreadLocal<Rect> {
+ @Override
+ protected Rect initialValue() {
+ return new Rect();
+ }
}
-}
-class BitmapFactoryOptionsCache extends SoftReferenceThreadLocal<BitmapFactory.Options> {
- @Override
- protected BitmapFactory.Options initialValue() {
- return new BitmapFactory.Options();
+ private static class BitmapFactoryOptionsCache extends
+ SoftReferenceThreadLocal<BitmapFactory.Options> {
+ @Override
+ protected BitmapFactory.Options initialValue() {
+ return new BitmapFactory.Options();
+ }
}
-}
-public class WidgetPreviewLoader {
- static final String TAG = "WidgetPreviewLoader";
- static final String ANDROID_INCREMENTAL_VERSION_NAME_KEY = "android.incremental.version";
+ private static final String TAG = "WidgetPreviewLoader";
+ private static final String ANDROID_INCREMENTAL_VERSION_NAME_KEY = "android.incremental.version";
+
+ private static final float WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE = 0.25f;
+ private static final HashSet<String> sInvalidPackages = new HashSet<String>();
+
+ // Used for drawing shortcut previews
+ private final BitmapCache mCachedShortcutPreviewBitmap = new BitmapCache();
+ private final PaintCache mCachedShortcutPreviewPaint = new PaintCache();
+ private final CanvasCache mCachedShortcutPreviewCanvas = new CanvasCache();
+
+ // Used for drawing widget previews
+ private final CanvasCache mCachedAppWidgetPreviewCanvas = new CanvasCache();
+ private final RectCache mCachedAppWidgetPreviewSrcRect = new RectCache();
+ private final RectCache mCachedAppWidgetPreviewDestRect = new RectCache();
+ private final PaintCache mCachedAppWidgetPreviewPaint = new PaintCache();
+ private final PaintCache mDefaultAppWidgetPreviewPaint = new PaintCache();
+ private final BitmapFactoryOptionsCache mCachedBitmapFactoryOptions = new BitmapFactoryOptionsCache();
+
+ private final HashMap<String, WeakReference<Bitmap>> mLoadedPreviews = new HashMap<>();
+ private final ArrayList<SoftReference<Bitmap>> mUnusedBitmaps = new ArrayList<>();
+
+ private final Context mContext;
+ private final int mAppIconSize;
+ private final IconCache mIconCache;
+ private final AppWidgetManagerCompat mManager;
private int mPreviewBitmapWidth;
private int mPreviewBitmapHeight;
private String mSize;
- private Context mContext;
- private PackageManager mPackageManager;
private PagedViewCellLayout mWidgetSpacingLayout;
- // Used for drawing shortcut previews
- private BitmapCache mCachedShortcutPreviewBitmap = new BitmapCache();
- private PaintCache mCachedShortcutPreviewPaint = new PaintCache();
- private CanvasCache mCachedShortcutPreviewCanvas = new CanvasCache();
-
- // Used for drawing widget previews
- private CanvasCache mCachedAppWidgetPreviewCanvas = new CanvasCache();
- private RectCache mCachedAppWidgetPreviewSrcRect = new RectCache();
- private RectCache mCachedAppWidgetPreviewDestRect = new RectCache();
- private PaintCache mCachedAppWidgetPreviewPaint = new PaintCache();
- private PaintCache mDefaultAppWidgetPreviewPaint = new PaintCache();
private String mCachedSelectQuery;
- private BitmapFactoryOptionsCache mCachedBitmapFactoryOptions = new BitmapFactoryOptionsCache();
- private int mAppIconSize;
- private IconCache mIconCache;
-
- private static final float sWidgetPreviewIconPaddingPercentage = 0.25f;
private CacheDb mDb;
- private final HashMap<String, WeakReference<Bitmap>> mLoadedPreviews;
- private final ArrayList<SoftReference<Bitmap>> mUnusedBitmaps;
- private final static HashSet<String> sInvalidPackages;
-
private final MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor();
- static {
- sInvalidPackages = new HashSet<String>();
- }
-
public WidgetPreviewLoader(Context context) {
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
mContext = context;
- mPackageManager = mContext.getPackageManager();
mAppIconSize = grid.iconSizePx;
mIconCache = app.getIconCache();
+ mManager = AppWidgetManagerCompat.getInstance(context);
+
mDb = app.getWidgetPreviewCacheDb();
- mLoadedPreviews = new HashMap<String, WeakReference<Bitmap>>();
- mUnusedBitmaps = new ArrayList<SoftReference<Bitmap>>();
SharedPreferences sp = context.getSharedPreferences(
LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE);
@@ -175,7 +175,7 @@
editor.commit();
}
}
-
+
public void recreateDb() {
LauncherAppState app = LauncherAppState.getInstance();
app.recreateWidgetPreviewDb();
@@ -328,7 +328,7 @@
String output;
if (o instanceof AppWidgetProviderInfo) {
sb.append(WIDGET_PREFIX);
- sb.append(((AppWidgetProviderInfo) o).provider.flattenToString());
+ sb.append(((AppWidgetProviderInfo) o).toString());
output = sb.toString();
sb.setLength(0);
} else {
@@ -413,7 +413,7 @@
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
- public static void removeItemFromDb(final CacheDb cacheDb, final String objectName) {
+ private static void removeItemFromDb(final CacheDb cacheDb, final String objectName) {
new AsyncTask<Void, Void, Void>() {
public Void doInBackground(Void ... args) {
SQLiteDatabase db = cacheDb.getWritableDatabase();
@@ -473,7 +473,7 @@
}
}
- public Bitmap generatePreview(Object info, Bitmap preview) {
+ private Bitmap generatePreview(Object info, Bitmap preview) {
if (preview != null &&
(preview.getWidth() != mPreviewBitmapWidth ||
preview.getHeight() != mPreviewBitmapHeight)) {
@@ -491,8 +491,8 @@
int[] cellSpans = Launcher.getSpanForWidget(mContext, info);
int maxWidth = maxWidthForWidgetPreview(cellSpans[0]);
int maxHeight = maxHeightForWidgetPreview(cellSpans[1]);
- return generateWidgetPreview(info.provider, info.previewImage, info.icon,
- cellSpans[0], cellSpans[1], maxWidth, maxHeight, preview, null);
+ return generateWidgetPreview(info, cellSpans[0], cellSpans[1],
+ maxWidth, maxHeight, preview, null);
}
public int maxWidthForWidgetPreview(int spanX) {
@@ -505,22 +505,20 @@
mWidgetSpacingLayout.estimateCellHeight(spanY));
}
- public Bitmap generateWidgetPreview(ComponentName provider, int previewImage,
- int iconId, int cellHSpan, int cellVSpan, int maxPreviewWidth, int maxPreviewHeight,
- Bitmap preview, int[] preScaledWidthOut) {
+ public Bitmap generateWidgetPreview(AppWidgetProviderInfo info, int cellHSpan, int cellVSpan,
+ int maxPreviewWidth, int maxPreviewHeight, Bitmap preview, int[] preScaledWidthOut) {
// Load the preview image if possible
- String packageName = provider.getPackageName();
if (maxPreviewWidth < 0) maxPreviewWidth = Integer.MAX_VALUE;
if (maxPreviewHeight < 0) maxPreviewHeight = Integer.MAX_VALUE;
Drawable drawable = null;
- if (previewImage != 0) {
- drawable = mPackageManager.getDrawable(packageName, previewImage, null);
+ if (info.previewImage != 0) {
+ drawable = mManager.loadPreview(info);
if (drawable != null) {
drawable = mutateOnMainThread(drawable);
} else {
Log.w(TAG, "Can't load widget preview drawable 0x" +
- Integer.toHexString(previewImage) + " for provider: " + provider);
+ Integer.toHexString(info.previewImage) + " for provider: " + info.provider);
}
}
@@ -562,21 +560,16 @@
c.setBitmap(null);
// Draw the icon in the top left corner
- int minOffset = (int) (mAppIconSize * sWidgetPreviewIconPaddingPercentage);
+ int minOffset = (int) (mAppIconSize * WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE);
int smallestSide = Math.min(previewWidth, previewHeight);
float iconScale = Math.min((float) smallestSide
/ (mAppIconSize + 2 * minOffset), 1f);
try {
- Drawable icon = null;
- int hoffset =
- (int) ((previewDrawableWidth - mAppIconSize * iconScale) / 2);
- int yoffset =
- (int) ((previewDrawableHeight - mAppIconSize * iconScale) / 2);
- if (iconId > 0) {
- icon = mIconCache.getFullResIcon(packageName, iconId);
- }
+ Drawable icon = mManager.loadIcon(info, mIconCache);
if (icon != null) {
+ int hoffset = (int) ((previewDrawableWidth - mAppIconSize * iconScale) / 2);
+ int yoffset = (int) ((previewDrawableHeight - mAppIconSize * iconScale) / 2);
icon = mutateOnMainThread(icon);
renderDrawableToBitmap(icon, defaultPreview, hoffset,
yoffset, (int) (mAppIconSize * iconScale),
@@ -627,7 +620,7 @@
c.drawBitmap(defaultPreview, src, dest, p);
c.setBitmap(null);
}
- return preview;
+ return mManager.getBadgeBitmap(info, preview);
}
private Bitmap generateShortcutPreview(
@@ -685,18 +678,10 @@
return preview;
}
-
- public static void renderDrawableToBitmap(
- Drawable d, Bitmap bitmap, int x, int y, int w, int h) {
- renderDrawableToBitmap(d, bitmap, x, y, w, h, 1f);
- }
-
private static void renderDrawableToBitmap(
- Drawable d, Bitmap bitmap, int x, int y, int w, int h,
- float scale) {
+ Drawable d, Bitmap bitmap, int x, int y, int w, int h) {
if (bitmap != null) {
Canvas c = new Canvas(bitmap);
- c.scale(scale, scale);
Rect oldBounds = d.copyBounds();
d.setBounds(x, y, x + w, y + h);
d.draw(c);
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 53a3f94..774996e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -27,12 +27,14 @@
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.WallpaperManager;
-import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
+import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
@@ -47,9 +49,7 @@
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
-import android.os.Handler.Callback;
import android.os.IBinder;
-import android.os.Message;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
@@ -68,6 +68,7 @@
import com.android.launcher3.FolderIcon.FolderRingAnimator;
import com.android.launcher3.Launcher.CustomContentCallbacks;
import com.android.launcher3.LauncherSettings.Favorites;
+import com.android.launcher3.compat.PackageInstallerCompat;
import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo;
import com.android.launcher3.compat.UserHandleCompat;
@@ -75,10 +76,9 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
/**
* The workspace is a wide area with a wallpaper and a finite number of pages.
@@ -212,7 +212,7 @@
private HolographicOutlineHelper mOutlineHelper;
private Bitmap mDragOutline = null;
- private final Rect mTempRect = new Rect();
+ private static final Rect sTempRect = new Rect();
private final int[] mTempXY = new int[2];
private int[] mTempVisiblePagesRange = new int[2];
private boolean mOverscrollEffectSet;
@@ -241,6 +241,8 @@
private DropTarget.DragEnforcer mDragEnforcer;
private float mMaxDistanceForFolderCreation;
+ private final Canvas mCanvas = new Canvas();
+
// Variables relating to touch disambiguation (scrolling workspace vs. scrolling a widget)
private float mXDown;
private float mYDown;
@@ -585,6 +587,7 @@
CellLayout customScreen = (CellLayout)
mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, null);
customScreen.disableBackground();
+ customScreen.disableDragTarget();
mWorkspaceScreens.put(CUSTOM_CONTENT_SCREEN_ID, customScreen);
mScreenOrder.add(0, CUSTOM_CONTENT_SCREEN_ID);
@@ -598,7 +601,6 @@
mDefaultPage = mOriginalDefaultPage + 1;
// Update the custom content hint
- mLauncher.getLauncherClings().updateCustomContentHintVisibility();
if (mRestorePage != INVALID_RESTORE_PAGE) {
mRestorePage = mRestorePage + 1;
} else {
@@ -627,7 +629,6 @@
mDefaultPage = mOriginalDefaultPage - 1;
// Update the custom content hint
- mLauncher.getLauncherClings().updateCustomContentHintVisibility();
if (mRestorePage != INVALID_RESTORE_PAGE) {
mRestorePage = mRestorePage - 1;
} else {
@@ -1001,7 +1002,7 @@
final CellLayout layout;
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
layout = mLauncher.getHotseat().getLayout();
- child.setOnKeyListener(null);
+ child.setOnKeyListener(new HotseatIconKeyEventListener());
// Hide folder title in the hotseat
if (child instanceof FolderIcon) {
@@ -1106,7 +1107,7 @@
case MotionEvent.ACTION_UP:
if (mTouchState == TOUCH_STATE_REST) {
final CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage);
- if (!currentPage.lastDownOnOccupiedCell()) {
+ if (currentPage != null && !currentPage.lastDownOnOccupiedCell()) {
onWallpaperTap(ev);
}
}
@@ -1114,6 +1115,17 @@
return super.onInterceptTouchEvent(ev);
}
+ @Override
+ public boolean onGenericMotionEvent(MotionEvent event) {
+ // Ignore pointer scroll events if the custom content doesn't allow scrolling.
+ if ((getScreenIdForPageIndex(getCurrentPage()) == CUSTOM_CONTENT_SCREEN_ID)
+ && (mCustomContentCallbacks != null)
+ && !mCustomContentCallbacks.isScrollingAllowed()) {
+ return false;
+ }
+ return super.onGenericMotionEvent(event);
+ }
+
protected void reinflateWidgetsIfNecessary() {
final int clCount = getChildCount();
for (int i = 0; i < clCount; i++) {
@@ -1205,14 +1217,6 @@
enableChildrenCache(mCurrentPage - 1, mCurrentPage + 1);
}
}
-
- // If we are not fading in adjacent screens, we still need to restore the alpha in case the
- // user scrolls while we are transitioning (should not affect dispatchDraw optimizations)
- if (!mWorkspaceFadeInAdjacentScreens) {
- for (int i = 0; i < getChildCount(); ++i) {
- ((CellLayout) getPageAt(i)).setShortcutAndWidgetAlpha(1f);
- }
- }
}
protected void onPageEndMoving() {
@@ -1267,9 +1271,6 @@
mLauncher.updateVoiceButtonProxyVisible(false);
}
}
- if (getPageIndicator() != null) {
- getPageIndicator().setContentDescription(getPageIndicatorDescription());
- }
}
protected CustomContentCallbacks getCustomContentCallbacks() {
@@ -1583,7 +1584,7 @@
private void updatePageAlphaValues(int screenCenter) {
boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
if (mWorkspaceFadeInAdjacentScreens &&
- mState == State.NORMAL &&
+ !workspaceInModalState() &&
!mIsSwitchingState &&
!isInOverscroll) {
for (int i = numCustomPages(); i < getChildCount(); i++) {
@@ -1592,6 +1593,7 @@
float scrollProgress = getScrollProgress(screenCenter, child, i);
float alpha = 1 - Math.abs(scrollProgress);
child.getShortcutsAndWidgets().setAlpha(alpha);
+ //child.setBackgroundAlphaMultiplier(1 - alpha);
}
}
}
@@ -1685,8 +1687,7 @@
updateStateForCustomContent(screenCenter);
enableHwLayersOnVisiblePages();
- boolean shouldOverScroll = (mOverScrollEffect < 0 && (!hasCustomContent() || isLayoutRtl())) ||
- (mOverScrollEffect > 0 && (!hasCustomContent() || !isLayoutRtl()));
+ boolean shouldOverScroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
if (shouldOverScroll) {
int index = 0;
@@ -1710,14 +1711,16 @@
}
}
- private void computeOverScrollEffect(float amount) {
- mOverScrollEffect = acceleratedOverFactor(amount);
- }
-
@Override
protected void overScroll(float amount) {
- computeOverScrollEffect(amount);
- dampedOverScroll(amount);
+ boolean shouldOverScroll = (amount < 0 && (!hasCustomContent() || isLayoutRtl())) ||
+ (amount > 0 && (!hasCustomContent() || !isLayoutRtl()));
+ if (shouldOverScroll) {
+ dampedOverScroll(amount);
+ mOverScrollEffect = acceleratedOverFactor(amount);
+ } else {
+ mOverScrollEffect = 0;
+ }
}
protected void onAttachedToWindow() {
@@ -1980,14 +1983,7 @@
* appearance).
*
*/
- public void onDragStartedWithItem(View v) {
- final Canvas canvas = new Canvas();
-
- // The outline is used to visualize where the item will land if dropped
- mDragOutline = createDragOutline(v, canvas, DRAG_BITMAP_PADDING);
- }
-
- private Rect getDrawableBounds(Drawable d) {
+ private static Rect getDrawableBounds(Drawable d) {
Rect bounds = new Rect();
d.copyBounds(bounds);
if (bounds.width() == 0 || bounds.height() == 0) {
@@ -2003,8 +1999,6 @@
}
public void onExternalDragStartedWithItem(View v) {
- final Canvas canvas = new Canvas();
-
// Compose a drag bitmap with the view scaled to the icon size
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
@@ -2024,22 +2018,19 @@
// Compose the bitmap to create the icon from
Bitmap b = Bitmap.createBitmap(bmpWidth, bmpHeight,
Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
- drawDragView(v, c, 0);
- c.setBitmap(null);
+ mCanvas.setBitmap(b);
+ drawDragView(v, mCanvas, 0);
+ mCanvas.setBitmap(null);
// The outline is used to visualize where the item will land if dropped
- mDragOutline = createDragOutline(b, canvas, DRAG_BITMAP_PADDING, iconSize, iconSize, true);
+ mDragOutline = createDragOutline(b, DRAG_BITMAP_PADDING, iconSize, iconSize, true);
}
public void onDragStartedWithItem(PendingAddItemInfo info, Bitmap b, boolean clipAlpha) {
- final Canvas canvas = new Canvas();
-
int[] size = estimateItemSize(info.spanX, info.spanY, info, false);
// The outline is used to visualize where the item will land if dropped
- mDragOutline = createDragOutline(b, canvas, DRAG_BITMAP_PADDING, size[0],
- size[1], clipAlpha);
+ mDragOutline = createDragOutline(b, DRAG_BITMAP_PADDING, size[0], size[1], clipAlpha);
}
public void exitWidgetResizeMode() {
@@ -2057,8 +2048,9 @@
mNewAlphas = new float[childCount];
}
- Animator getChangeStateAnimation(final State state, boolean animated) {
- return getChangeStateAnimation(state, animated, 0, -1);
+ Animator getChangeStateAnimation(final State state, boolean animated,
+ ArrayList<View> layerViews) {
+ return getChangeStateAnimation(state, animated, 0, -1, layerViews);
}
@Override
@@ -2194,6 +2186,11 @@
private static final int HIDE_WORKSPACE_DURATION = 100;
Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage) {
+ return getChangeStateAnimation(state, animated, delay, snapPage, null);
+ }
+
+ Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage,
+ ArrayList<View> layerViews) {
if (mState == state) {
return null;
}
@@ -2315,6 +2312,9 @@
cl.setBackgroundAlpha(mNewBackgroundAlphas[i]);
cl.setShortcutAndWidgetAlpha(mNewAlphas[i]);
} else {
+ if (layerViews != null) {
+ layerViews.add(cl);
+ }
if (mOldAlphas[i] != mNewAlphas[i] || currentAlpha != mNewAlphas[i]) {
LauncherViewPropertyAnimator alphaAnim =
new LauncherViewPropertyAnimator(cl.getShortcutsAndWidgets());
@@ -2362,6 +2362,17 @@
.alpha(finalOverviewPanelAlpha).withLayer();
overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel));
+ // For animation optimations, we may need to provide the Launcher transition
+ // with a set of views on which to force build layers in certain scenarios.
+ hotseat.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ searchBar.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ overviewPanel.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ if (layerViews != null) {
+ layerViews.add(hotseat);
+ layerViews.add(searchBar);
+ layerViews.add(overviewPanel);
+ }
+
if (workspaceToOverview) {
pageIndicatorAlpha.setInterpolator(new DecelerateInterpolator(2));
hotseatAlpha.setInterpolator(new DecelerateInterpolator(2));
@@ -2507,21 +2518,6 @@
private void onTransitionEnd() {
mIsSwitchingState = false;
updateChildrenLayersEnabled(false);
- // The code in getChangeStateAnimation to determine initialAlpha and finalAlpha will ensure
- // ensure that only the current page is visible during (and subsequently, after) the
- // transition animation. If fade adjacent pages is disabled, then re-enable the page
- // visibility after the transition animation.
- if (!mWorkspaceFadeInAdjacentScreens) {
- for (int i = 0; i < getChildCount(); i++) {
- final CellLayout cl = (CellLayout) getChildAt(i);
- cl.setShortcutAndWidgetAlpha(1f);
- }
- } else {
- for (int i = 0; i < numCustomPages(); i++) {
- final CellLayout cl = (CellLayout) getChildAt(i);
- cl.setShortcutAndWidgetAlpha(1f);
- }
- }
showCustomContentIfNecessary();
}
@@ -2537,8 +2533,8 @@
* @param destCanvas the canvas to draw on
* @param padding the horizontal and vertical padding to use when drawing
*/
- private void drawDragView(View v, Canvas destCanvas, int padding) {
- final Rect clipRect = mTempRect;
+ private static void drawDragView(View v, Canvas destCanvas, int padding) {
+ final Rect clipRect = sTempRect;
v.getDrawingRect(clipRect);
boolean textVisible = false;
@@ -2577,7 +2573,7 @@
* @param expectedPadding padding to add to the drag view. If a different padding was used
* its value will be changed
*/
- public Bitmap createDragBitmap(View v, Canvas canvas, AtomicInteger expectedPadding) {
+ public Bitmap createDragBitmap(View v, AtomicInteger expectedPadding) {
Bitmap b;
int padding = expectedPadding.get();
@@ -2592,9 +2588,9 @@
v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888);
}
- canvas.setBitmap(b);
- drawDragView(v, canvas, padding);
- canvas.setBitmap(null);
+ mCanvas.setBitmap(b);
+ drawDragView(v, mCanvas, padding);
+ mCanvas.setBitmap(null);
return b;
}
@@ -2603,15 +2599,15 @@
* Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location.
* Responsibility for the bitmap is transferred to the caller.
*/
- private Bitmap createDragOutline(View v, Canvas canvas, int padding) {
+ private Bitmap createDragOutline(View v, int padding) {
final int outlineColor = getResources().getColor(R.color.outline_color);
final Bitmap b = Bitmap.createBitmap(
v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888);
- canvas.setBitmap(b);
- drawDragView(v, canvas, padding);
- mOutlineHelper.applyMediumExpensiveOutlineWithBlur(b, canvas, outlineColor, outlineColor);
- canvas.setBitmap(null);
+ mCanvas.setBitmap(b);
+ drawDragView(v, mCanvas, padding);
+ mOutlineHelper.applyExpensiveOutlineWithBlur(b, mCanvas, outlineColor, outlineColor);
+ mCanvas.setBitmap(null);
return b;
}
@@ -2619,11 +2615,11 @@
* Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location.
* Responsibility for the bitmap is transferred to the caller.
*/
- private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h,
+ private Bitmap createDragOutline(Bitmap orig, int padding, int w, int h,
boolean clipAlpha) {
final int outlineColor = getResources().getColor(R.color.outline_color);
final Bitmap b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
- canvas.setBitmap(b);
+ mCanvas.setBitmap(b);
Rect src = new Rect(0, 0, orig.getWidth(), orig.getHeight());
float scaleFactor = Math.min((w - padding) / (float) orig.getWidth(),
@@ -2635,10 +2631,10 @@
// center the image
dst.offset((w - scaledWidth) / 2, (h - scaledHeight) / 2);
- canvas.drawBitmap(orig, src, dst, null);
- mOutlineHelper.applyMediumExpensiveOutlineWithBlur(b, canvas, outlineColor, outlineColor,
+ mCanvas.drawBitmap(orig, src, dst, null);
+ mOutlineHelper.applyExpensiveOutlineWithBlur(b, mCanvas, outlineColor, outlineColor,
clipAlpha);
- canvas.setBitmap(null);
+ mCanvas.setBitmap(null);
return b;
}
@@ -2656,21 +2652,20 @@
CellLayout layout = (CellLayout) child.getParent().getParent();
layout.prepareChildForDrag(child);
- child.clearFocus();
- child.setPressed(false);
-
- final Canvas canvas = new Canvas();
-
- // The outline is used to visualize where the item will land if dropped
- mDragOutline = createDragOutline(child, canvas, DRAG_BITMAP_PADDING);
beginDragShared(child, this);
}
public void beginDragShared(View child, DragSource source) {
+ child.clearFocus();
+ child.setPressed(false);
+
+ // The outline is used to visualize where the item will land if dropped
+ mDragOutline = createDragOutline(child, DRAG_BITMAP_PADDING);
+
mLauncher.onDragStarted(child);
// The drag bitmap follows the touch point around on the screen
AtomicInteger padding = new AtomicInteger(DRAG_BITMAP_PADDING);
- final Bitmap b = createDragBitmap(child, new Canvas(), padding);
+ final Bitmap b = createDragBitmap(child, padding);
final int bmpWidth = b.getWidth();
final int bmpHeight = b.getHeight();
@@ -2684,7 +2679,7 @@
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
Point dragVisualizeOffset = null;
Rect dragRect = null;
- if (child instanceof BubbleTextView || child instanceof PagedViewIcon) {
+ if (child instanceof BubbleTextView) {
int iconSize = grid.iconSizePx;
int top = child.getPaddingTop();
int left = (bmpWidth - iconSize) / 2;
@@ -2703,11 +2698,7 @@
// Clear the pressed state if necessary
if (child instanceof BubbleTextView) {
BubbleTextView icon = (BubbleTextView) child;
- icon.clearPressedOrFocusedBackground();
- } else if (child instanceof FolderIcon) {
- // The folder cling isn't flexible enough to be shown in non-default workspace positions
- // Also if they are dragging it a folder, we assume they don't need to see the cling.
- mLauncher.markFolderClingDismissedIfNecessary();
+ icon.clearPressedBackground();
}
if (child.getTag() == null || !(child.getTag() instanceof ItemInfo)) {
@@ -2738,14 +2729,14 @@
// Compose a new drag bitmap that is of the icon size
AtomicInteger padding = new AtomicInteger(DRAG_BITMAP_PADDING);
- final Bitmap tmpB = createDragBitmap(child, new Canvas(), padding);
+ final Bitmap tmpB = createDragBitmap(child, padding);
Bitmap b = Bitmap.createBitmap(iconSize, iconSize, Bitmap.Config.ARGB_8888);
Paint p = new Paint();
p.setFilterBitmap(true);
- Canvas c = new Canvas(b);
- c.drawBitmap(tmpB, new Rect(0, 0, tmpB.getWidth(), tmpB.getHeight()),
+ mCanvas.setBitmap(b);
+ mCanvas.drawBitmap(tmpB, new Rect(0, 0, tmpB.getWidth(), tmpB.getHeight()),
new Rect(0, 0, iconSize, iconSize), p);
- c.setBitmap(null);
+ mCanvas.setBitmap(null);
// Find the child's location on the screen
int bmpWidth = tmpB.getWidth();
@@ -3055,10 +3046,6 @@
// cell also contains a shortcut, then create a folder with the two shortcuts.
if (!mInScrollArea && createUserFolderIfNecessary(cell, container,
dropTargetLayout, mTargetCell, distance, false, d.dragView, null)) {
- // The folder cling isn't flexible enough to be shown in non-default workspace
- // positions. Also if they are creating a folder, we assume they don't need to
- // see the cling.
- mLauncher.markFolderClingDismissedIfNecessary();
return;
}
@@ -3242,10 +3229,8 @@
setCurrentDropLayout(layout);
setCurrentDragOverlappingLayout(layout);
- // Because we don't have space in the Phone UI (the CellLayouts run to the edge) we
- // don't need to show the outlines
- if (LauncherAppState.getInstance().isScreenLarge()) {
- showOutlines();
+ if (!workspaceInModalState()) {
+ mLauncher.getDragLayer().showPageHints();
}
}
@@ -3320,6 +3305,7 @@
if (!mIsPageMoving) {
hideOutlines();
}
+ mLauncher.getDragLayer().hidePageHints();
}
void setCurrentDropLayout(CellLayout layout) {
@@ -3968,10 +3954,6 @@
d.postAnimationRunnable = exitSpringLoadedRunnable;
if (createUserFolderIfNecessary(view, container, cellLayout, mTargetCell, distance,
true, d.dragView, d.postAnimationRunnable)) {
- // The folder cling isn't flexible enough to be shown in non-default workspace
- // positions. Also if they are creating a folder, we assume they don't need to
- // see the cling.
- mLauncher.markFolderClingDismissedIfNecessary();
return;
}
if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, distance, d,
@@ -4020,12 +4002,12 @@
int height = MeasureSpec.makeMeasureSpec(unScaledSize[1], MeasureSpec.EXACTLY);
Bitmap b = Bitmap.createBitmap(unScaledSize[0], unScaledSize[1],
Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
+ mCanvas.setBitmap(b);
layout.measure(width, height);
layout.layout(0, 0, unScaledSize[0], unScaledSize[1]);
- layout.draw(c);
- c.setBitmap(null);
+ layout.draw(mCanvas);
+ mCanvas.setBitmap(null);
layout.setVisibility(visibility);
return b;
}
@@ -4769,26 +4751,6 @@
stripEmptyScreens();
}
- private void updateShortcut(HashMap<ComponentName, AppInfo> appsMap, ItemInfo info,
- View child) {
- ComponentName cn = info.getIntent().getComponent();
- if (info.getRestoredIntent() != null) {
- cn = info.getRestoredIntent().getComponent();
- }
- if (cn != null) {
- AppInfo appInfo = appsMap.get(cn);
- if ((appInfo != null) && LauncherModel.isShortcutInfoUpdateable(info)) {
- ShortcutInfo shortcutInfo = (ShortcutInfo) info;
- BubbleTextView shortcut = (BubbleTextView) child;
- shortcutInfo.restore();
- shortcutInfo.updateIcon(mIconCache);
- shortcutInfo.title = appInfo.title.toString();
- shortcutInfo.contentDescription = appInfo.contentDescription;
- shortcut.applyFromShortcutInfo(shortcutInfo, mIconCache, true);
- }
- }
- }
-
interface ItemOperator {
/**
* Process the next itemInfo, possibly with side-effect on {@link ItemOperator#value}.
@@ -4839,6 +4801,25 @@
}
void updateShortcutsAndWidgets(ArrayList<AppInfo> apps) {
+ // Break the appinfo list per user
+ final HashMap<UserHandleCompat, ArrayList<AppInfo>> appsPerUser =
+ new HashMap<UserHandleCompat, ArrayList<AppInfo>>();
+ for (AppInfo info : apps) {
+ ArrayList<AppInfo> filtered = appsPerUser.get(info.user);
+ if (filtered == null) {
+ filtered = new ArrayList<AppInfo>();
+ appsPerUser.put(info.user, filtered);
+ }
+ filtered.add(info);
+ }
+
+ for (Map.Entry<UserHandleCompat, ArrayList<AppInfo>> entry : appsPerUser.entrySet()) {
+ updateShortcutsAndWidgetsPerUser(entry.getValue(), entry.getKey());
+ }
+ }
+
+ private void updateShortcutsAndWidgetsPerUser(ArrayList<AppInfo> apps,
+ final UserHandleCompat user) {
// Create a map of the apps to test against
final HashMap<ComponentName, AppInfo> appsMap = new HashMap<ComponentName, AppInfo>();
final HashSet<String> pkgNames = new HashSet<String>();
@@ -4846,14 +4827,78 @@
appsMap.put(ai.componentName, ai);
pkgNames.add(ai.componentName.getPackageName());
}
+ final HashSet<ComponentName> iconsToRemove = new HashSet<ComponentName>();
mapOverItems(MAP_RECURSE, new ItemOperator() {
@Override
public boolean evaluate(ItemInfo info, View v, View parent) {
- if (info instanceof ShortcutInfo) {
- updateShortcut(appsMap, info, v);
- if (parent != null) {
- parent.invalidate();
+ if (info instanceof ShortcutInfo && v instanceof BubbleTextView) {
+ ShortcutInfo shortcutInfo = (ShortcutInfo) info;
+ ComponentName cn = shortcutInfo.getTargetComponent();
+ AppInfo appInfo = appsMap.get(cn);
+ if (user.equals(shortcutInfo.user) && cn != null
+ && LauncherModel.isShortcutInfoUpdateable(info)
+ && pkgNames.contains(cn.getPackageName())) {
+ boolean promiseStateChanged = false;
+ boolean infoUpdated = false;
+ if (shortcutInfo.isPromise()) {
+ if (shortcutInfo.hasStatusFlag(ShortcutInfo.FLAG_AUTOINTALL_ICON)) {
+ // Auto install icon
+ PackageManager pm = getContext().getPackageManager();
+ ResolveInfo matched = pm.resolveActivity(
+ new Intent(Intent.ACTION_MAIN)
+ .setComponent(cn).addCategory(Intent.CATEGORY_LAUNCHER),
+ PackageManager.MATCH_DEFAULT_ONLY);
+ if (matched == null) {
+ // Try to find the best match activity.
+ Intent intent = pm.getLaunchIntentForPackage(
+ cn.getPackageName());
+ if (intent != null) {
+ cn = intent.getComponent();
+ appInfo = appsMap.get(cn);
+ }
+
+ if ((intent == null) || (appsMap == null)) {
+ // Could not find a default activity. Remove this item.
+ iconsToRemove.add(shortcutInfo.getTargetComponent());
+
+ // process next shortcut.
+ return false;
+ }
+ shortcutInfo.promisedIntent = intent;
+ }
+ }
+
+ // Restore the shortcut.
+ shortcutInfo.intent = shortcutInfo.promisedIntent;
+ shortcutInfo.promisedIntent = null;
+ shortcutInfo.status &= ~ShortcutInfo.FLAG_RESTORED_ICON
+ & ~ShortcutInfo.FLAG_AUTOINTALL_ICON
+ & ~ShortcutInfo.FLAG_INSTALL_SESSION_ACTIVE;
+
+ promiseStateChanged = true;
+ infoUpdated = true;
+ shortcutInfo.updateIcon(mIconCache);
+ LauncherModel.updateItemInDatabase(getContext(), shortcutInfo);
+ }
+
+
+ if (appInfo != null) {
+ shortcutInfo.updateIcon(mIconCache);
+ shortcutInfo.title = appInfo.title.toString();
+ shortcutInfo.contentDescription = appInfo.contentDescription;
+ infoUpdated = true;
+ }
+
+ if (infoUpdated) {
+ BubbleTextView shortcut = (BubbleTextView) v;
+ shortcut.applyFromShortcutInfo(shortcutInfo,
+ mIconCache, true, promiseStateChanged);
+
+ if (parent != null) {
+ parent.invalidate();
+ }
+ }
}
}
// process all the shortcuts
@@ -4861,19 +4906,51 @@
}
});
- restorePendingWidgets(pkgNames);
+ if (!iconsToRemove.isEmpty()) {
+ removeItemsByComponentName(iconsToRemove, user);
+ }
+ if (user.equals(UserHandleCompat.myUserHandle())) {
+ restorePendingWidgets(pkgNames);
+ }
}
- public void removeAbandonedPromise(BubbleTextView abandonedIcon, UserHandleCompat user) {
- if (abandonedIcon.getTag() != null && abandonedIcon.getTag() instanceof ShortcutInfo) {
- final ShortcutInfo shortcut = (ShortcutInfo) abandonedIcon.getTag();
- if (shortcut.isAbandoned()) {
- HashSet<ComponentName> cns = new HashSet<ComponentName>(1);
- cns.add(shortcut.getRestoredIntent().getComponent());
- LauncherModel.deleteItemFromDatabase(mLauncher, shortcut);
- removeItemsByComponentName(cns, user);
+ public void removeAbandonedPromise(String packageName, UserHandleCompat user) {
+ ArrayList<String> packages = new ArrayList<String>(1);
+ packages.add(packageName);
+ LauncherModel.deletePackageFromDatabase(mLauncher, packageName, user);
+ removeItemsByPackageName(packages, user);
+ }
+
+ public void updatePackageBadge(final String packageName, final UserHandleCompat user) {
+ mapOverItems(MAP_RECURSE, new ItemOperator() {
+ @Override
+ public boolean evaluate(ItemInfo info, View v, View parent) {
+ if (info instanceof ShortcutInfo && v instanceof BubbleTextView) {
+ ShortcutInfo shortcutInfo = (ShortcutInfo) info;
+ ComponentName cn = shortcutInfo.getTargetComponent();
+ if (user.equals(shortcutInfo.user) && cn != null
+ && shortcutInfo.isPromise()
+ && packageName.equals(cn.getPackageName())) {
+ if (shortcutInfo.hasStatusFlag(ShortcutInfo.FLAG_AUTOINTALL_ICON)) {
+ // For auto install apps update the icon as well as label.
+ mIconCache.getTitleAndIcon(shortcutInfo,
+ shortcutInfo.promisedIntent, user, true);
+ } else {
+ // Only update the icon for restored apps.
+ shortcutInfo.updateIcon(mIconCache);
+ }
+ BubbleTextView shortcut = (BubbleTextView) v;
+ shortcut.applyFromShortcutInfo(shortcutInfo, mIconCache, true, false);
+
+ if (parent != null) {
+ parent.invalidate();
+ }
+ }
+ }
+ // process all the shortcuts
+ return false;
}
- }
+ });
}
public void updatePackageState(ArrayList<PackageInstallInfo> installInfos) {
@@ -4883,12 +4960,18 @@
mapOverItems(MAP_RECURSE, new ItemOperator() {
@Override
public boolean evaluate(ItemInfo info, View v, View parent) {
- if (info instanceof ShortcutInfo
- && ((ShortcutInfo) info).isPromiseFor(installInfo.packageName)
- && v instanceof BubbleTextView) {
- ((ShortcutInfo) info).setProgress(installInfo.progress);
- ((ShortcutInfo) info).setState(installInfo.state);
- ((BubbleTextView)v).applyState();
+ if (info instanceof ShortcutInfo && v instanceof BubbleTextView) {
+ ShortcutInfo si = (ShortcutInfo) info;
+ ComponentName cn = si.getTargetComponent();
+ if (si.isPromise() && (cn != null)
+ && installInfo.packageName.equals(cn.getPackageName())) {
+ si.setInstallProgress(installInfo.progress);
+ if (installInfo.state == PackageInstallerCompat.STATUS_FAILED) {
+ // Mark this info as broken.
+ si.status &= ~ShortcutInfo.FLAG_INSTALL_SESSION_ACTIVE;
+ }
+ ((BubbleTextView)v).applyState(false);
+ }
} else if (v instanceof PendingAppWidgetHostView
&& info instanceof LauncherAppWidgetInfo
&& ((LauncherAppWidgetInfo) info).providerName.getPackageName()
@@ -4902,11 +4985,12 @@
}
});
- if (installInfo.state == ShortcutInfo.PACKAGE_STATE_DEFAULT) {
+ if (installInfo.state == PackageInstallerCompat.STATUS_INSTALLED) {
completedPackages.add(installInfo.packageName);
}
}
+ // Note that package states are sent only for myUser
if (!completedPackages.isEmpty()) {
restorePendingWidgets(completedPackages);
}
diff --git a/src/com/android/launcher3/compat/AppWidgetManagerCompat.java b/src/com/android/launcher3/compat/AppWidgetManagerCompat.java
new file mode 100644
index 0000000..6512d42
--- /dev/null
+++ b/src/com/android/launcher3/compat/AppWidgetManagerCompat.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compat;
+
+import android.app.Activity;
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+
+import com.android.launcher3.IconCache;
+import com.android.launcher3.Utilities;
+
+import java.util.List;
+
+public abstract class AppWidgetManagerCompat {
+
+ private static final Object sInstanceLock = new Object();
+ private static AppWidgetManagerCompat sInstance;
+
+
+ public static AppWidgetManagerCompat getInstance(Context context) {
+ synchronized (sInstanceLock) {
+ if (sInstance == null) {
+ if (Utilities.isLmpOrAbove()) {
+ sInstance = new AppWidgetManagerCompatVL(context.getApplicationContext());
+ } else {
+ sInstance = new AppWidgetManagerCompatV16(context.getApplicationContext());
+ }
+ }
+ return sInstance;
+ }
+ }
+
+ final AppWidgetManager mAppWidgetManager;
+ final Context mContext;
+
+ AppWidgetManagerCompat(Context context) {
+ mContext = context;
+ mAppWidgetManager = AppWidgetManager.getInstance(context);
+ }
+
+ public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) {
+ return mAppWidgetManager.getAppWidgetInfo(appWidgetId);
+ }
+
+ public abstract List<AppWidgetProviderInfo> getAllProviders();
+
+ public abstract String loadLabel(AppWidgetProviderInfo info);
+
+ public abstract boolean bindAppWidgetIdIfAllowed(
+ int appWidgetId, AppWidgetProviderInfo info, Bundle options);
+
+ public abstract UserHandleCompat getUser(AppWidgetProviderInfo info);
+
+ public abstract void startConfigActivity(AppWidgetProviderInfo info, int widgetId,
+ Activity activity, AppWidgetHost host, int requestCode);
+
+ public abstract Drawable loadPreview(AppWidgetProviderInfo info);
+
+ public abstract Drawable loadIcon(AppWidgetProviderInfo info, IconCache cache);
+
+ public abstract Bitmap getBadgeBitmap(AppWidgetProviderInfo info, Bitmap bitmap);
+
+}
diff --git a/src/com/android/launcher3/compat/AppWidgetManagerCompatV16.java b/src/com/android/launcher3/compat/AppWidgetManagerCompatV16.java
new file mode 100644
index 0000000..f599f43
--- /dev/null
+++ b/src/com/android/launcher3/compat/AppWidgetManagerCompatV16.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compat;
+
+import android.app.Activity;
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.Bundle;
+
+import com.android.launcher3.IconCache;
+import com.android.launcher3.Utilities;
+
+import java.util.List;
+
+class AppWidgetManagerCompatV16 extends AppWidgetManagerCompat {
+
+ AppWidgetManagerCompatV16(Context context) {
+ super(context);
+ }
+
+ @Override
+ public List<AppWidgetProviderInfo> getAllProviders() {
+ return mAppWidgetManager.getInstalledProviders();
+ }
+
+ @Override
+ public String loadLabel(AppWidgetProviderInfo info) {
+ return info.label.trim();
+ }
+
+ @Override
+ public boolean bindAppWidgetIdIfAllowed(int appWidgetId, AppWidgetProviderInfo info,
+ Bundle options) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ return mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, info.provider);
+ } else {
+ return mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, info.provider, options);
+ }
+ }
+
+ @Override
+ public UserHandleCompat getUser(AppWidgetProviderInfo info) {
+ return UserHandleCompat.myUserHandle();
+ }
+
+ @Override
+ public void startConfigActivity(AppWidgetProviderInfo info, int widgetId, Activity activity,
+ AppWidgetHost host, int requestCode) {
+ Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
+ intent.setComponent(info.configure);
+ intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId);
+ Utilities.startActivityForResultSafely(activity, intent, requestCode);
+ }
+
+ @Override
+ public Drawable loadPreview(AppWidgetProviderInfo info) {
+ return mContext.getPackageManager().getDrawable(
+ info.provider.getPackageName(), info.previewImage, null);
+ }
+
+ @Override
+ public Drawable loadIcon(AppWidgetProviderInfo info, IconCache cache) {
+ return cache.getFullResIcon(info.provider.getPackageName(), info.icon);
+ }
+
+ @Override
+ public Bitmap getBadgeBitmap(AppWidgetProviderInfo info, Bitmap bitmap) {
+ return bitmap;
+ }
+}
diff --git a/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java b/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
new file mode 100644
index 0000000..03d43a6
--- /dev/null
+++ b/src/com/android/launcher3/compat/AppWidgetManagerCompatVL.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.compat;
+
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Rect;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.view.View;
+import android.widget.Toast;
+
+import com.android.launcher3.IconCache;
+import com.android.launcher3.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@TargetApi(Build.VERSION_CODES.LOLLIPOP)
+class AppWidgetManagerCompatVL extends AppWidgetManagerCompat {
+
+ private final UserManager mUserManager;
+ private final PackageManager mPm;
+
+ AppWidgetManagerCompatVL(Context context) {
+ super(context);
+ mPm = context.getPackageManager();
+ mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
+ }
+
+ @Override
+ public List<AppWidgetProviderInfo> getAllProviders() {
+ ArrayList<AppWidgetProviderInfo> providers = new ArrayList<AppWidgetProviderInfo>();
+ for (UserHandle user : mUserManager.getUserProfiles()) {
+ providers.addAll(mAppWidgetManager.getInstalledProvidersForProfile(user));
+ }
+ return providers;
+ }
+
+ @Override
+ public String loadLabel(AppWidgetProviderInfo info) {
+ return info.loadLabel(mPm);
+ }
+
+ @Override
+ public boolean bindAppWidgetIdIfAllowed(int appWidgetId, AppWidgetProviderInfo info,
+ Bundle options) {
+ return mAppWidgetManager.bindAppWidgetIdIfAllowed(
+ appWidgetId, info.getProfile(), info.provider, options);
+ }
+
+ @Override
+ public UserHandleCompat getUser(AppWidgetProviderInfo info) {
+ return UserHandleCompat.fromUser(info.getProfile());
+ }
+
+ @Override
+ public void startConfigActivity(AppWidgetProviderInfo info, int widgetId, Activity activity,
+ AppWidgetHost host, int requestCode) {
+ try {
+ host.startAppWidgetConfigureActivityForResult(activity, widgetId, 0, requestCode, null);
+ } catch (ActivityNotFoundException e) {
+ Toast.makeText(activity, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
+ } catch (SecurityException e) {
+ Toast.makeText(activity, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public Drawable loadPreview(AppWidgetProviderInfo info) {
+ return info.loadPreviewImage(mContext, 0);
+ }
+
+ @Override
+ public Drawable loadIcon(AppWidgetProviderInfo info, IconCache cache) {
+ return info.loadIcon(mContext, cache.getFullResIconDpi());
+ }
+
+ @Override
+ public Bitmap getBadgeBitmap(AppWidgetProviderInfo info, Bitmap bitmap) {
+ if (info.getProfile().equals(android.os.Process.myUserHandle())) {
+ return bitmap;
+ }
+
+ // Add a user badge in the bottom right of the image.
+ final Resources res = mContext.getResources();
+ final int badgeSize = res.getDimensionPixelSize(R.dimen.profile_badge_size);
+ final int badgeMargin = res.getDimensionPixelSize(R.dimen.profile_badge_margin);
+ final Rect badgeLocation = new Rect(0, 0, badgeSize, badgeSize);
+
+ final int top = bitmap.getHeight() - badgeSize - badgeMargin;
+ if (res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
+ badgeLocation.offset(badgeMargin, top);
+ } else {
+ badgeLocation.offset(bitmap.getWidth() - badgeSize - badgeMargin, top);
+ }
+
+ Drawable drawable = mPm.getUserBadgedDrawableForDensity(
+ new BitmapDrawable(res, bitmap), info.getProfile(), badgeLocation, 0);
+
+ if (drawable instanceof BitmapDrawable) {
+ return ((BitmapDrawable) drawable).getBitmap();
+ }
+
+ bitmap.eraseColor(Color.TRANSPARENT);
+ Canvas c = new Canvas(bitmap);
+ drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
+ drawable.draw(c);
+ c.setBitmap(null);
+ return bitmap;
+ }
+}
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompat.java b/src/com/android/launcher3/compat/LauncherAppsCompat.java
index 0f8444b..6efcc00 100644
--- a/src/com/android/launcher3/compat/LauncherAppsCompat.java
+++ b/src/com/android/launcher3/compat/LauncherAppsCompat.java
@@ -23,6 +23,8 @@
import android.os.Build;
import android.os.Bundle;
+import com.android.launcher3.Utilities;
+
import java.util.List;
public abstract class LauncherAppsCompat {
@@ -48,12 +50,11 @@
public static LauncherAppsCompat getInstance(Context context) {
synchronized (sInstanceLock) {
- // TODO change this to use api version once L gets an API number.
if (sInstance == null) {
- if ("L".equals(Build.VERSION.CODENAME)) {
- sInstance = new LauncherAppsCompatVL(context);
+ if (Utilities.isLmpOrAbove()) {
+ sInstance = new LauncherAppsCompatVL(context.getApplicationContext());
} else {
- sInstance = new LauncherAppsCompatV16(context);
+ sInstance = new LauncherAppsCompatV16(context.getApplicationContext());
}
}
return sInstance;
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatV16.java b/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
index c47f223..7e5e6bf 100644
--- a/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
+++ b/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
@@ -22,19 +22,17 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
+import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.PackageInfo;
import android.content.pm.ResolveInfo;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
-import android.os.UserHandle;
import android.provider.Settings;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
/**
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
index e7de99c..e0d28b5 100644
--- a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
+++ b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
@@ -70,11 +70,11 @@
public void startActivityForProfile(ComponentName component, UserHandleCompat user,
Rect sourceBounds, Bundle opts) {
- mLauncherApps.startActivityForProfile(component, user.getUser(), sourceBounds, opts);
+ mLauncherApps.startMainActivity(component, user.getUser(), sourceBounds, opts);
}
public void showAppDetailsForProfile(ComponentName component, UserHandleCompat user) {
- mLauncherApps.showAppDetailsForProfile(component, user.getUser(), null, null);
+ mLauncherApps.startAppDetailsActivity(component, user.getUser(), null, null);
}
public void addOnAppsChangedCallback(LauncherAppsCompat.OnAppsChangedCallbackCompat callback) {
@@ -82,7 +82,7 @@
synchronized (mCallbacks) {
mCallbacks.put(callback, wrappedCallback);
}
- mLauncherApps.addOnAppsChangedCallback(wrappedCallback);
+ mLauncherApps.registerCallback(wrappedCallback);
}
public void removeOnAppsChangedCallback(
@@ -92,19 +92,19 @@
wrappedCallback = mCallbacks.remove(callback);
}
if (wrappedCallback != null) {
- mLauncherApps.removeOnAppsChangedCallback(wrappedCallback);
+ mLauncherApps.unregisterCallback(wrappedCallback);
}
}
public boolean isPackageEnabledForProfile(String packageName, UserHandleCompat user) {
- return mLauncherApps.isPackageEnabledForProfile(packageName, user.getUser());
+ return mLauncherApps.isPackageEnabled(packageName, user.getUser());
}
public boolean isActivityEnabledForProfile(ComponentName component, UserHandleCompat user) {
- return mLauncherApps.isActivityEnabledForProfile(component, user.getUser());
+ return mLauncherApps.isActivityEnabled(component, user.getUser());
}
- private static class WrappedCallback extends LauncherApps.OnAppsChangedCallback {
+ private static class WrappedCallback extends LauncherApps.Callback {
private LauncherAppsCompat.OnAppsChangedCallbackCompat mCallback;
public WrappedCallback(LauncherAppsCompat.OnAppsChangedCallbackCompat callback) {
diff --git a/src/com/android/launcher3/compat/PackageInstallerCompat.java b/src/com/android/launcher3/compat/PackageInstallerCompat.java
index 89a2157..0eb8754 100644
--- a/src/com/android/launcher3/compat/PackageInstallerCompat.java
+++ b/src/com/android/launcher3/compat/PackageInstallerCompat.java
@@ -20,15 +20,21 @@
import com.android.launcher3.Utilities;
+import java.util.HashSet;
+
public abstract class PackageInstallerCompat {
+ public static final int STATUS_INSTALLED = 0;
+ public static final int STATUS_INSTALLING = 1;
+ public static final int STATUS_FAILED = 2;
+
private static final Object sInstanceLock = new Object();
private static PackageInstallerCompat sInstance;
public static PackageInstallerCompat getInstance(Context context) {
synchronized (sInstanceLock) {
if (sInstance == null) {
- if (Utilities.isLmp()) {
+ if (Utilities.isLmpOrAbove()) {
sInstance = new PackageInstallerCompatVL(context);
} else {
sInstance = new PackageInstallerCompatV16(context) { };
@@ -38,6 +44,8 @@
}
}
+ public abstract HashSet<String> updateAndGetActiveSessionCache();
+
public abstract void onPause();
public abstract void onResume();
diff --git a/src/com/android/launcher3/compat/PackageInstallerCompatV16.java b/src/com/android/launcher3/compat/PackageInstallerCompatV16.java
index 6a2a02e..1910d22 100644
--- a/src/com/android/launcher3/compat/PackageInstallerCompatV16.java
+++ b/src/com/android/launcher3/compat/PackageInstallerCompatV16.java
@@ -22,7 +22,6 @@
import android.util.Log;
import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.ShortcutInfo;
import org.json.JSONException;
import org.json.JSONObject;
@@ -30,6 +29,7 @@
import org.json.JSONTokener;
import java.util.ArrayList;
+import java.util.HashSet;
public class PackageInstallerCompatV16 extends PackageInstallerCompat {
@@ -107,7 +107,7 @@
PackageInstallInfo installInfo = new PackageInstallInfo(packageName);
installInfo.progress = progress;
installInfo.state = state;
- if (state == ShortcutInfo.PACKAGE_STATE_DEFAULT) {
+ if (state == STATUS_INSTALLED) {
// no longer necessary to track this package
editor.remove(packageName);
if (DEBUG) Log.d(TAG, "no longer tracking " + packageName);
@@ -123,7 +123,7 @@
if (!mUseQueue) {
if (mReplayPending) {
replayUpdates();
- } else {
+ } else if (state != STATUS_INSTALLED) {
LauncherAppState app = LauncherAppState.getInstanceNoCreate();
ArrayList<PackageInstallInfo> update = new ArrayList<PackageInstallInfo>();
update.add(installInfo);
@@ -167,4 +167,9 @@
}
return value;
}
+
+ @Override
+ public HashSet<String> updateAndGetActiveSessionCache() {
+ return new HashSet<String>();
+ }
}
diff --git a/src/com/android/launcher3/compat/PackageInstallerCompatVL.java b/src/com/android/launcher3/compat/PackageInstallerCompatVL.java
index c78ab99..16ad379 100644
--- a/src/com/android/launcher3/compat/PackageInstallerCompatVL.java
+++ b/src/com/android/launcher3/compat/PackageInstallerCompatVL.java
@@ -23,10 +23,11 @@
import android.util.Log;
import android.util.SparseArray;
+import com.android.launcher3.IconCache;
import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.ShortcutInfo;
import java.util.ArrayList;
+import java.util.HashSet;
public class PackageInstallerCompatVL extends PackageInstallerCompat {
@@ -34,18 +35,23 @@
private static final boolean DEBUG = false;
private final SparseArray<SessionInfo> mPendingReplays = new SparseArray<SessionInfo>();
+ private final HashSet<String> mPendingBadgeUpdates = new HashSet<String>();
private final PackageInstaller mInstaller;
+ private final IconCache mCache;
private boolean mResumed;
private boolean mBound;
PackageInstallerCompatVL(Context context) {
mInstaller = context.getPackageManager().getPackageInstaller();
+ LauncherAppState.setApplicationContext(context.getApplicationContext());
+ mCache = LauncherAppState.getInstance().getIconCache();
mResumed = false;
mBound = false;
- mInstaller.addSessionCallback(mCallback);
+ mInstaller.registerSessionCallback(mCallback);
+
// On start, send updates for all active sessions
for (SessionInfo info : mInstaller.getAllSessions()) {
mPendingReplays.append(info.getSessionId(), info);
@@ -53,8 +59,28 @@
}
@Override
+ public HashSet<String> updateAndGetActiveSessionCache() {
+ HashSet<String> activePackages = new HashSet<String>();
+ UserHandleCompat user = UserHandleCompat.myUserHandle();
+ for (SessionInfo info : mInstaller.getAllSessions()) {
+ addSessionInfoToCahce(info, user);
+ if (info.getAppPackageName() != null) {
+ activePackages.add(info.getAppPackageName());
+ }
+ }
+ return activePackages;
+ }
+
+ private void addSessionInfoToCahce(SessionInfo info, UserHandleCompat user) {
+ String packageName = info.getAppPackageName();
+ if (packageName != null) {
+ mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(),
+ info.getAppLabel());
+ }
+ }
+
+ @Override
public void onStop() {
- mInstaller.removeSessionCallback(mCallback);
}
@Override
@@ -85,7 +111,7 @@
// Not yet ready
return;
}
- if ((mPendingReplays.size() == 0) && (newInfo == null)) {
+ if ((mPendingReplays.size() == 0) && (newInfo == null) && mPendingBadgeUpdates.isEmpty()) {
// Nothing to update
return;
}
@@ -98,14 +124,14 @@
}
ArrayList<PackageInstallInfo> updates = new ArrayList<PackageInstallInfo>();
- if (newInfo != null) {
+ if ((newInfo != null) && (newInfo.state != STATUS_INSTALLED)) {
updates.add(newInfo);
}
- for (int i = mPendingReplays.size() - 1; i > 0; i--) {
+ for (int i = mPendingReplays.size() - 1; i >= 0; i--) {
SessionInfo session = mPendingReplays.valueAt(i);
if (session.getAppPackageName() != null) {
updates.add(new PackageInstallInfo(session.getAppPackageName(),
- ShortcutInfo.PACKAGE_STATE_INSTALLING,
+ STATUS_INSTALLING,
(int) (session.getProgress() * 100)));
}
}
@@ -113,17 +139,20 @@
if (!updates.isEmpty()) {
app.setPackageState(updates);
}
+
+ if (!mPendingBadgeUpdates.isEmpty()) {
+ for (String pkg : mPendingBadgeUpdates) {
+ app.updatePackageBadge(pkg);
+ }
+ mPendingBadgeUpdates.clear();
+ }
}
private final SessionCallback mCallback = new SessionCallback() {
@Override
public void onCreated(int sessionId) {
- SessionInfo session = mInstaller.getSessionInfo(sessionId);
- if (session != null) {
- mPendingReplays.put(sessionId, session);
- replayUpdates(null);
- }
+ pushSessionBadgeToLauncher(sessionId);
}
@Override
@@ -131,12 +160,12 @@
mPendingReplays.remove(sessionId);
SessionInfo session = mInstaller.getSessionInfo(sessionId);
if ((session != null) && (session.getAppPackageName() != null)) {
+ mPendingBadgeUpdates.remove(session.getAppPackageName());
// Replay all updates with a one time update for this installed package. No
// need to store this record for future updates, as the app list will get
// refreshed on resume.
replayUpdates(new PackageInstallInfo(session.getAppPackageName(),
- success ? ShortcutInfo.PACKAGE_STATE_DEFAULT
- : ShortcutInfo.PACKAGE_STATE_ERROR, 0));
+ success ? STATUS_INSTALLED : STATUS_FAILED, 0));
}
}
@@ -150,10 +179,23 @@
}
@Override
- public void onOpened(int sessionId) { }
+ public void onActiveChanged(int sessionId, boolean active) { }
@Override
- public void onClosed(int sessionId) { }
+ public void onBadgingChanged(int sessionId) {
+ pushSessionBadgeToLauncher(sessionId);
+ }
+ private void pushSessionBadgeToLauncher(int sessionId) {
+ SessionInfo session = mInstaller.getSessionInfo(sessionId);
+ if (session != null) {
+ addSessionInfoToCahce(session, UserHandleCompat.myUserHandle());
+ if (session.getAppPackageName() != null) {
+ mPendingBadgeUpdates.add(session.getAppPackageName());
+ }
+ mPendingReplays.put(sessionId, session);
+ replayUpdates(null);
+ }
+ }
};
}
diff --git a/src/com/android/launcher3/compat/UserHandleCompat.java b/src/com/android/launcher3/compat/UserHandleCompat.java
index 4baf052..2ae6731 100644
--- a/src/com/android/launcher3/compat/UserHandleCompat.java
+++ b/src/com/android/launcher3/compat/UserHandleCompat.java
@@ -20,6 +20,8 @@
import android.os.Build;
import android.os.UserHandle;
+import com.android.launcher3.Utilities;
+
public class UserHandleCompat {
private UserHandle mUser;
@@ -86,9 +88,8 @@
* profiles so this is a no-op.
*/
public void addToIntent(Intent intent, String name) {
- // TODO change this to use api version once L gets an API number.
- if ("L".equals(Build.VERSION.CODENAME) && mUser != null) {
+ if (Utilities.isLmpOrAbove() && mUser != null) {
intent.putExtra(name, mUser);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/com/android/launcher3/compat/UserManagerCompat.java b/src/com/android/launcher3/compat/UserManagerCompat.java
index 8effb81..1374b4e 100644
--- a/src/com/android/launcher3/compat/UserManagerCompat.java
+++ b/src/com/android/launcher3/compat/UserManagerCompat.java
@@ -20,6 +20,8 @@
import android.graphics.drawable.Drawable;
import android.os.Build;
+import com.android.launcher3.Utilities;
+
import java.util.List;
public abstract class UserManagerCompat {
@@ -27,8 +29,7 @@
}
public static UserManagerCompat getInstance(Context context) {
- // TODO change this to use api version once L gets an API number.
- if ("L".equals(Build.VERSION.CODENAME)) {
+ if (Utilities.isLmpOrAbove()) {
return new UserManagerCompatVL(context);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
return new UserManagerCompatV17(context);
diff --git a/src/com/android/launcher3/compat/UserManagerCompatVL.java b/src/com/android/launcher3/compat/UserManagerCompatVL.java
index 0ad824b..19eeabd 100644
--- a/src/com/android/launcher3/compat/UserManagerCompatVL.java
+++ b/src/com/android/launcher3/compat/UserManagerCompatVL.java
@@ -18,6 +18,7 @@
package com.android.launcher3.compat;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.os.UserManager;
@@ -27,9 +28,11 @@
import java.util.List;
public class UserManagerCompatVL extends UserManagerCompatV17 {
+ private final PackageManager mPm;
UserManagerCompatVL(Context context) {
super(context);
+ mPm = context.getPackageManager();
}
@Override
@@ -48,12 +51,7 @@
@Override
public Drawable getBadgedDrawableForUser(Drawable unbadged, UserHandleCompat user) {
- try {
- // STOPSHIP(mokani): Clean this up.
- return mUserManager.getBadgedIconForUser(unbadged, user.getUser());
- } catch (Throwable t) {
- return unbadged;
- }
+ return mPm.getUserBadgedIcon(unbadged, user.getUser());
}
@Override
@@ -61,7 +59,7 @@
if (user == null) {
return label;
}
- return mUserManager.getBadgedLabelForUser(label, user.getUser());
+ return mPm.getUserBadgedLabel(label, user.getUser());
}
}