From 4fbc3828c5ae1e8c5789ede974447fa365f3c5a1 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 18 Feb 2015 16:46:50 -0800 Subject: Updating IconCache to maintain a persistent of icons > IconDB maintains a DB of icons keyed on ComponentName + User > During loader, icons & labels are loaded first from the DB, and if the entry doesn't exist, loaded using packageManager > After the loader completes, IconDB updates any entry which might have changed, while the launcher was dead. Change-Id: I7a6021cb6d1ca1e66fa5a0bdd21e1543e0cf66fc --- src/com/android/launcher3/AppInfo.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index a66bac08a..455c6d16d 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -19,19 +19,15 @@ package com.android.launcher3; import android.content.ComponentName; import android.content.Context; import android.content.Intent; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.content.pm.ResolveInfo; import android.graphics.Bitmap; import android.util.Log; import com.android.launcher3.compat.LauncherActivityInfoCompat; -import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.compat.UserHandleCompat; +import com.android.launcher3.compat.UserManagerCompat; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; /** * Represents an app in AllAppsView. @@ -77,13 +73,13 @@ public class AppInfo extends ItemInfo { * Must not hold the Context. */ public AppInfo(Context context, LauncherActivityInfoCompat info, UserHandleCompat user, - IconCache iconCache, HashMap labelCache) { + IconCache iconCache) { this.componentName = info.getComponentName(); this.container = ItemInfo.NO_ID; flags = initFlags(info); firstInstallTime = info.getFirstInstallTime(); - iconCache.getTitleAndIcon(this, info, labelCache); + iconCache.getTitleAndIcon(this, info); intent = makeLaunchIntent(context, info, user); this.user = user; } -- cgit v1.2.3 From 34b6527cefd36fbd5da78464ce9771e379158552 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 11 Mar 2015 16:56:52 -0700 Subject: Lazy loading high res icons > Loading low-res icons for icons which are not visible on the homescreen. Change-Id: I8ac7bf09f6030ed554cb60a4cd402f3f36ffe12b --- src/com/android/launcher3/AppInfo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 455c6d16d..a1391b232 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -45,6 +45,11 @@ public class AppInfo extends ItemInfo { */ Bitmap iconBitmap; + /** + * Indicates whether we're using a low res icon + */ + boolean usingLowResIcon; + /** * The time at which the app was first installed. */ @@ -79,7 +84,7 @@ public class AppInfo extends ItemInfo { flags = initFlags(info); firstInstallTime = info.getFirstInstallTime(); - iconCache.getTitleAndIcon(this, info); + iconCache.getTitleAndIcon(this, info, true /* useLowResIcon */); intent = makeLaunchIntent(context, info, user); this.user = user; } -- cgit v1.2.3 From 3f471440a8b6b71d4c15501a96befd3b715c9e8f Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 8 Apr 2015 19:01:34 -0700 Subject: WidgetTray revamp work - RecyclerView is rendering - Animation is connected - Drag and drop is now handled - UI tweaking: background, margins, more to come. - Flicker and preview not loading issue: fixed height for the horizontal scroll view. - Shortcuts are added - Widget Preview loading should support shortPress for drop - UI tweaks left: overlay of arrow when there are more items to scroll - icons are added in the section header - Sorting of widget sections and widget horizontal list - Adding all the padding constants to dimen.xml file - RecyclerView should only support one view type For items to be addressed in follow up patches OR CLs, TODO is added to the comment. b/19897708 Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc --- src/com/android/launcher3/AppInfo.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index a1391b232..7c6b0664c 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -43,7 +43,7 @@ public class AppInfo extends ItemInfo { /** * A bitmap version of the application icon. */ - Bitmap iconBitmap; + public Bitmap iconBitmap; /** * Indicates whether we're using a low res icon @@ -55,7 +55,7 @@ public class AppInfo extends ItemInfo { */ long firstInstallTime; - ComponentName componentName; + public ComponentName componentName; static final int DOWNLOADED_FLAG = 1; static final int UPDATED_SYSTEM_APP_FLAG = 2; @@ -121,12 +121,15 @@ public class AppInfo extends ItemInfo { + " user=" + user + ")"; } + /** + * Helper method used for debugging. + */ public static void dumpApplicationInfoList(String tag, String label, ArrayList list) { Log.d(tag, label + " size=" + list.size()); for (AppInfo info: list) { - Log.d(tag, " title=\"" + info.title + "\" iconBitmap=" - + info.iconBitmap + " firstInstallTime=" - + info.firstInstallTime); + Log.d(tag, " title=\"" + info.title + "\" iconBitmap=" + info.iconBitmap + + " firstInstallTime=" + info.firstInstallTime + + " componentName=" + info.componentName.getPackageName()); } } -- cgit v1.2.3 From 82b016cb56540fe26213e817dd0dd668099c8e20 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 8 May 2015 17:00:10 -0700 Subject: Trim all whitespace from titles and labels. Bug: 20953160 Change-Id: I1610df5e445a4139522226f68fa6439926bc70c6 --- src/com/android/launcher3/AppInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 7c6b0664c..58a57a1fe 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -105,7 +105,7 @@ public class AppInfo extends ItemInfo { public AppInfo(AppInfo info) { super(info); componentName = info.componentName; - title = info.title.toString(); + title = Utilities.trim(info.title); intent = new Intent(info.intent); flags = info.flags; firstInstallTime = info.firstInstallTime; @@ -114,7 +114,7 @@ public class AppInfo extends ItemInfo { @Override public String toString() { - return "ApplicationInfo(title=" + title.toString() + " id=" + this.id + return "ApplicationInfo(title=" + title + " id=" + this.id + " type=" + this.itemType + " container=" + this.container + " screen=" + screenId + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX + " spanY=" + spanY + " dropPos=" + Arrays.toString(dropPos) -- cgit v1.2.3 From 5f4e0fdd2e4edeb9211e2dcd1c99497f175731f8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 22 May 2015 11:12:27 -0700 Subject: Moving all apps code into sub package. - Renaming resources, dimens, etc to be more consistent - Removing old AppsCustomize resources and other unused code Change-Id: I15ce35e7cb7a9b9344fc7103963e4e4c9e45d89a --- src/com/android/launcher3/AppInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 58a57a1fe..9c87ced54 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -38,7 +38,7 @@ public class AppInfo extends ItemInfo { /** * The intent used to start the application. */ - Intent intent; + public Intent intent; /** * A bitmap version of the application icon. -- cgit v1.2.3 From 5183285847816cee9d0db6a8a7ab1a5929163e4e Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 16 Jun 2015 11:36:19 -0700 Subject: Using component key for app search results Change-Id: Idc610cde340331892a5fabfa8bf952d136675f81 --- src/com/android/launcher3/AppInfo.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/android/launcher3/AppInfo.java') diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 9c87ced54..c95d5585a 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -25,6 +25,7 @@ import android.util.Log; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; +import com.android.launcher3.util.ComponentKey; import java.util.ArrayList; import java.util.Arrays; @@ -137,6 +138,10 @@ public class AppInfo extends ItemInfo { return new ShortcutInfo(this); } + public ComponentKey toComponentKey() { + return new ComponentKey(componentName, user); + } + public static Intent makeLaunchIntent(Context context, LauncherActivityInfoCompat info, UserHandleCompat user) { long serialNumber = UserManagerCompat.getInstance(context).getSerialNumberForUser(user); -- cgit v1.2.3