Bug 921557 - (Part 2) Update other deprecated BitmapDrawable constructor usage. r=wesj

This commit is contained in:
Margaret Leibovic 2014-01-07 14:12:04 -08:00
parent cfc70b6eeb
commit 44fc6c5d5d
3 changed files with 3 additions and 3 deletions

View File

@ -207,7 +207,7 @@ public class Tab {
public void run() {
if (b != null) {
try {
mThumbnail = new BitmapDrawable(b);
mThumbnail = new BitmapDrawable(mAppContext.getResources(), b);
if (mState == Tab.STATE_SUCCESS)
saveThumbnailToDB();
} catch (OutOfMemoryError oom) {

View File

@ -193,7 +193,7 @@ public class SearchEnginePreference extends Preference implements View.OnLongCli
// Copy the icon from this object to the prompt we produce. We lazily create the drawable,
// as the user may not ever actually tap this object.
if (mPromptIcon == null && mIconBitmap != null) {
mPromptIcon = new BitmapDrawable(mFaviconView.getBitmap());
mPromptIcon = new BitmapDrawable(getContext().getResources(), mFaviconView.getBitmap());
}
// Icons are hidden until Bug 926711 is fixed.

View File

@ -586,7 +586,7 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
// We want the icon to be of a specific size. Some do not
// follow this rule so we have to resize them.
Bitmap bitmap = ((BitmapDrawable) item.icon).getBitmap();
d = new BitmapDrawable(Bitmap.createScaledBitmap(bitmap, mIconSize, mIconSize, true));
d = new BitmapDrawable(res, Bitmap.createScaledBitmap(bitmap, mIconSize, mIconSize, true));
} else if (item.inGroup) {
// We don't currently support "indenting" items with icons
d = getBlankDrawable(res);