Merge "Workaround for small icons. Draw icon drawables at the expected icon size. (Bug 11203738)" into jb-ub-now-indigo-rose
This commit is contained in:
commit
140e79bb48
5 files changed
+21
-5
No files matched your search
@@ -110,8 +110,7 @@ public class BubbleTextView extends TextView {
|
|||||||
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
|
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
|
||||||
|
|
||||||
setCompoundDrawablesWithIntrinsicBounds(null,
|
setCompoundDrawablesWithIntrinsicBounds(null,
|
||||||
new FastBitmapDrawable(b),
|
Utilities.createIconDrawable(b), null, null);
|
||||||
null, null);
|
|
||||||
setCompoundDrawablePadding((int) ((grid.folderIconSizePx - grid.iconSizePx) / 2f));
|
setCompoundDrawablePadding((int) ((grid.folderIconSizePx - grid.iconSizePx) / 2f));
|
||||||
setText(info.title);
|
setText(info.title);
|
||||||
setTag(info);
|
setTag(info);
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
|
|||||||
final BubbleTextView textView =
|
final BubbleTextView textView =
|
||||||
(BubbleTextView) mInflater.inflate(R.layout.application, this, false);
|
(BubbleTextView) mInflater.inflate(R.layout.application, this, false);
|
||||||
textView.setCompoundDrawablesWithIntrinsicBounds(null,
|
textView.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||||
new FastBitmapDrawable(item.getIcon(mIconCache)), null, null);
|
Utilities.createIconDrawable(item.getIcon(mIconCache)), null, null);
|
||||||
textView.setText(item.title);
|
textView.setText(item.title);
|
||||||
textView.setTag(item);
|
textView.setTag(item);
|
||||||
textView.setTextColor(getResources().getColor(R.color.folder_items_text_color));
|
textView.setTextColor(getResources().getColor(R.color.folder_items_text_color));
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class Hotseat extends FrameLayout {
|
|||||||
TextView allAppsButton = (TextView)
|
TextView allAppsButton = (TextView)
|
||||||
inflater.inflate(R.layout.all_apps_button, mContent, false);
|
inflater.inflate(R.layout.all_apps_button, mContent, false);
|
||||||
Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon);
|
Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon);
|
||||||
d.setBounds(0, 0, Utilities.sIconTextureWidth, Utilities.sIconTextureHeight);
|
Utilities.resizeIconDrawable(d);
|
||||||
allAppsButton.setCompoundDrawables(null, d, null, null);
|
allAppsButton.setCompoundDrawables(null, d, null, null);
|
||||||
|
|
||||||
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public class PagedViewIcon extends TextView {
|
|||||||
PagedViewIcon.PressedCallback cb) {
|
PagedViewIcon.PressedCallback cb) {
|
||||||
mIcon = info.iconBitmap;
|
mIcon = info.iconBitmap;
|
||||||
mPressedCallback = cb;
|
mPressedCallback = cb;
|
||||||
setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
|
setCompoundDrawablesWithIntrinsicBounds(null, Utilities.createIconDrawable(mIcon),
|
||||||
|
null, null);
|
||||||
setText(info.title);
|
setText(info.title);
|
||||||
setTag(info);
|
setTag(info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,22 @@ final class Utilities {
|
|||||||
static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
|
static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
|
||||||
static int sColorIndex = 0;
|
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
|
* 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)
|
* icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size)
|
||||||
|
|||||||
Reference in new issue
Block a user