summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsList.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-02-08 13:44:00 -0800
committerJoe Onorato <joeo@android.com>2010-02-12 12:18:40 -0500
commit0589f0f66ce498512c6ee47482c649d88294c9d0 (patch)
tree42d42799a5578bde35a79b18ab8b28d301c663fe /src/com/android/launcher2/AllAppsList.java
parent3e244cf9d2da4fb04ef095f8b752a2a2c6e2f287 (diff)
downloadandroid_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.tar.gz
android_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.tar.bz2
android_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.zip
Split ApplicationInfo into ApplicationInfo which is used for AllAppsView and ShortcutInfo which is
used for the workspace. Consolidate the three icon resampling functions into one. Ensure that the icons stored in LauncherProvider are the right size, so we don't have to resample them each time we load them.
Diffstat (limited to 'src/com/android/launcher2/AllAppsList.java')
-rw-r--r--src/com/android/launcher2/AllAppsList.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/android/launcher2/AllAppsList.java
index 00e9ea881..9d4c5b02a 100644
--- a/src/com/android/launcher2/AllAppsList.java
+++ b/src/com/android/launcher2/AllAppsList.java
@@ -44,10 +44,13 @@ class AllAppsList {
/** The list of apps that have been modified since the last notify() call. */
public ArrayList<ApplicationInfo> modified = new ArrayList<ApplicationInfo>();
+ private IconCache mIconCache;
+
/**
* Boring constructor.
*/
- public AllAppsList() {
+ public AllAppsList(IconCache iconCache) {
+ mIconCache = iconCache;
}
/**
@@ -82,9 +85,8 @@ class AllAppsList {
final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName);
if (matches.size() > 0) {
- Utilities.BubbleText bubble = new Utilities.BubbleText(context);
for (ResolveInfo info : matches) {
- ApplicationInfo item = AppInfoCache.cache(info, context, bubble);
+ ApplicationInfo item = new ApplicationInfo(info, mIconCache);
data.add(item);
added.add(item);
}
@@ -105,9 +107,9 @@ class AllAppsList {
}
}
// This is more aggressive than it needs to be.
- AppInfoCache.flush();
+ mIconCache.flush();
}
-
+
/**
* Add and remove icons for this package which has been updated.
*/
@@ -122,7 +124,7 @@ class AllAppsList {
if (packageName.equals(component.getPackageName())) {
if (!findActivity(matches, component)) {
removed.add(applicationInfo);
- AppInfoCache.remove(component);
+ mIconCache.remove(component);
data.remove(i);
}
}
@@ -130,7 +132,6 @@ class AllAppsList {
// Find enabled activities and add them to the adapter
// Also updates existing activities with new labels/icons
- Utilities.BubbleText bubble = new Utilities.BubbleText(context);
int count = matches.size();
for (int i = 0; i < count; i++) {
final ResolveInfo info = matches.get(i);
@@ -138,11 +139,12 @@ class AllAppsList {
info.activityInfo.applicationInfo.packageName,
info.activityInfo.name);
if (applicationInfo == null) {
- applicationInfo = AppInfoCache.cache(info, context, bubble);
+ applicationInfo = new ApplicationInfo(info, mIconCache);
data.add(applicationInfo);
added.add(applicationInfo);
} else {
- AppInfoCache.update(info, applicationInfo, context, bubble);
+ mIconCache.remove(applicationInfo.componentName);
+ mIconCache.getTitleAndIcon(applicationInfo, info);
modified.add(applicationInfo);
}
}