am 6f613d29: Fix bugs 2218563 and 2176751 - Not properly loading icons, and sometimes marking them as cached when they\'re not.

Merge commit '6f613d2999d53bc9e6183ad9d51b077a5d0f9552' into eclair-mr2

* commit '6f613d2999d53bc9e6183ad9d51b077a5d0f9552':
  Fix bugs 2218563 and 2176751 - Not properly loading icons, and sometimes marking them as cached when
This commit is contained in:
Joe Onorato
2009-10-31 16:58:31 -07:00
committed by Android Git Automerger
2 changed files with 6 additions and 1 deletions
@@ -169,7 +169,6 @@ public class AppInfoCache {
application.iconBitmap = Utilities.createAllAppsBitmap(
info.activityInfo.loadIcon(packageManager), context);
application.filtered = true;
application.titleBitmap = bubble.createTextBitmap(application.title.toString());
}
@@ -17,6 +17,7 @@
package com.android.launcher2;
import android.content.Context;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -30,9 +31,11 @@ import java.util.ArrayList;
*/
public class ApplicationsAdapter extends ArrayAdapter<ApplicationInfo> {
private final LayoutInflater mInflater;
private final PackageManager mPackageManager;
public ApplicationsAdapter(Context context, ArrayList<ApplicationInfo> apps) {
super(context, 0, apps);
mPackageManager = context.getPackageManager();
mInflater = LayoutInflater.from(context);
}
@@ -44,6 +47,9 @@ public class ApplicationsAdapter extends ArrayAdapter<ApplicationInfo> {
convertView = mInflater.inflate(R.layout.application_boxed, parent, false);
}
if (info.icon == null) {
info.icon = AppInfoCache.getIconDrawable(mPackageManager, info);
}
if (!info.filtered) {
info.icon = Utilities.createIconThumbnail(info.icon, getContext());
info.filtered = true;