Lines Matching refs:icon
68 public Drawable icon;
83 icon = resizer.createIconThumbnail(resolveInfo.loadIcon(pm));
166 if (item.icon == null) {
167 item.icon = mIconResizer.createIconThumbnail(item.resolveInfo.loadIcon(getPackageManager()));
169 text.setCompoundDrawablesWithIntrinsicBounds(item.icon, null, null, null);
246 * Utility class to resize icons to match default icon size.
272 * @param icon The icon to get a thumbnail of.
274 * @return A thumbnail for the specified icon or the icon itself if the
277 public Drawable createIconThumbnail(Drawable icon) {
281 final int iconWidth = icon.getIntrinsicWidth();
282 final int iconHeight = icon.getIntrinsicHeight();
284 if (icon instanceof PaintDrawable) {
285 PaintDrawable painter = (PaintDrawable) icon;
300 final Bitmap.Config c = icon.getOpacity() != PixelFormat.OPAQUE ?
306 // If we were to do oldBounds = icon.getBounds(),
310 mOldBounds.set(icon.getBounds());
313 icon.setBounds(x, y, x + width, y + height);
314 icon.draw(canvas);
315 icon.setBounds(mOldBounds);
316 icon = new BitmapDrawable(getResources(), thumb);
323 mOldBounds.set(icon.getBounds());
326 icon.setBounds(x, y, x + iconWidth, y + iconHeight);
327 icon.draw(canvas);
328 icon.setBounds(mOldBounds);
329 icon = new BitmapDrawable(getResources(), thumb);
334 return icon;