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
Родитель 8f6f3e7a0a
Коммит 0f0fd043d8
3 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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.

Просмотреть файл

@ -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);