mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Workaround for small icons. Draw icon drawables at the expected icon size. (Bug 11203738)
Change-Id: If976ae8b3603e8bf42e8e857ce0b178d977b0a43
This commit is contained in:
@@ -65,6 +65,22 @@ final class Utilities {
|
||||
static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
|
||||
static int sColorIndex = 0;
|
||||
|
||||
/**
|
||||
* Returns a FastBitmapDrawable with the icon, accurately sized.
|
||||
*/
|
||||
static Drawable createIconDrawable(Bitmap icon) {
|
||||
FastBitmapDrawable d = new FastBitmapDrawable(icon);
|
||||
resizeIconDrawable(d);
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes an icon drawable to the correct icon size.
|
||||
*/
|
||||
static void resizeIconDrawable(Drawable icon) {
|
||||
icon.setBounds(0, 0, sIconTextureWidth, sIconTextureHeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bitmap suitable for the all apps view. Used to convert pre-ICS
|
||||
* icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size)
|
||||
|
||||
Reference in New Issue
Block a user