Loading graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac final int res = a.getResourceId(R.styleable.AnimatedRotateDrawable_drawable, 0); Drawable drawable = null; if (res > 0) { drawable = r.getDrawable(res); drawable = r.getDrawable(res, theme); } a.recycle(); Loading graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java +2 −2 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { final Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { int type; while ((type = parser.next()) == XmlPullParser.TEXT) { Loading Loading @@ -473,7 +473,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { final Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { int type; while ((type = parser.next()) == XmlPullParser.TEXT) { Loading graphics/java/android/graphics/drawable/AnimationDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { while ((type=parser.next()) == XmlPullParser.TEXT) { // Empty Loading graphics/java/android/graphics/drawable/RotateDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -436,7 +436,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { com.android.internal.R.styleable.RotateDrawable_drawable, 0); Drawable drawable = null; if (res > 0) { drawable = r.getDrawable(res); drawable = r.getDrawable(res, theme); } a.recycle(); Loading packages/DocumentsUI/src/com/android/documentsui/IconUtils.java +12 −16 Original line number Diff line number Diff line Loading @@ -210,7 +210,7 @@ public class IconUtils { return pm.getDrawable(info.packageName, icon, info.applicationInfo); } } else { return context.getResources().getDrawable(icon); return context.getDrawable(icon); } } return null; Loading @@ -218,19 +218,17 @@ public class IconUtils { public static Drawable loadMimeIcon( Context context, String mimeType, String authority, String docId, int mode) { final Resources res = context.getResources(); if (Document.MIME_TYPE_DIR.equals(mimeType)) { // TODO: eventually move these hacky assets into that package if ("com.android.providers.media.documents".equals(authority) && docId.startsWith("album")) { return res.getDrawable(R.drawable.ic_doc_album); return context.getDrawable(R.drawable.ic_doc_album); } if (mode == DocumentsActivity.State.MODE_GRID) { return res.getDrawable(R.drawable.ic_grid_folder); return context.getDrawable(R.drawable.ic_grid_folder); } else { return res.getDrawable(R.drawable.ic_doc_folder); return context.getDrawable(R.drawable.ic_doc_folder); } } Loading @@ -238,16 +236,14 @@ public class IconUtils { } public static Drawable loadMimeIcon(Context context, String mimeType) { final Resources res = context.getResources(); if (Document.MIME_TYPE_DIR.equals(mimeType)) { return res.getDrawable(R.drawable.ic_doc_folder); return context.getDrawable(R.drawable.ic_doc_folder); } // Look for exact match first Integer resId = sMimeIcons.get(mimeType); if (resId != null) { return res.getDrawable(resId); return context.getDrawable(resId); } if (mimeType == null) { Loading @@ -258,15 +254,15 @@ public class IconUtils { // Otherwise look for partial match final String typeOnly = mimeType.split("/")[0]; if ("audio".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_audio); return context.getDrawable(R.drawable.ic_doc_audio); } else if ("image".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_image); return context.getDrawable(R.drawable.ic_doc_image); } else if ("text".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_text); return context.getDrawable(R.drawable.ic_doc_text); } else if ("video".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_video); return context.getDrawable(R.drawable.ic_doc_video); } else { return res.getDrawable(R.drawable.ic_doc_generic); return context.getDrawable(R.drawable.ic_doc_generic); } } Loading @@ -276,7 +272,7 @@ public class IconUtils { final TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(tintAttrId, outValue, true); final Drawable icon = res.getDrawable(drawableId); final Drawable icon = context.getDrawable(drawableId); icon.mutate(); icon.setTintList(res.getColorStateList(outValue.resourceId)); return icon; Loading Loading
graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac final int res = a.getResourceId(R.styleable.AnimatedRotateDrawable_drawable, 0); Drawable drawable = null; if (res > 0) { drawable = r.getDrawable(res); drawable = r.getDrawable(res, theme); } a.recycle(); Loading
graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java +2 −2 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { final Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { int type; while ((type = parser.next()) == XmlPullParser.TEXT) { Loading Loading @@ -473,7 +473,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { final Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { int type; while ((type = parser.next()) == XmlPullParser.TEXT) { Loading
graphics/java/android/graphics/drawable/AnimationDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An Drawable dr; if (drawableRes != 0) { dr = r.getDrawable(drawableRes); dr = r.getDrawable(drawableRes, theme); } else { while ((type=parser.next()) == XmlPullParser.TEXT) { // Empty Loading
graphics/java/android/graphics/drawable/RotateDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -436,7 +436,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { com.android.internal.R.styleable.RotateDrawable_drawable, 0); Drawable drawable = null; if (res > 0) { drawable = r.getDrawable(res); drawable = r.getDrawable(res, theme); } a.recycle(); Loading
packages/DocumentsUI/src/com/android/documentsui/IconUtils.java +12 −16 Original line number Diff line number Diff line Loading @@ -210,7 +210,7 @@ public class IconUtils { return pm.getDrawable(info.packageName, icon, info.applicationInfo); } } else { return context.getResources().getDrawable(icon); return context.getDrawable(icon); } } return null; Loading @@ -218,19 +218,17 @@ public class IconUtils { public static Drawable loadMimeIcon( Context context, String mimeType, String authority, String docId, int mode) { final Resources res = context.getResources(); if (Document.MIME_TYPE_DIR.equals(mimeType)) { // TODO: eventually move these hacky assets into that package if ("com.android.providers.media.documents".equals(authority) && docId.startsWith("album")) { return res.getDrawable(R.drawable.ic_doc_album); return context.getDrawable(R.drawable.ic_doc_album); } if (mode == DocumentsActivity.State.MODE_GRID) { return res.getDrawable(R.drawable.ic_grid_folder); return context.getDrawable(R.drawable.ic_grid_folder); } else { return res.getDrawable(R.drawable.ic_doc_folder); return context.getDrawable(R.drawable.ic_doc_folder); } } Loading @@ -238,16 +236,14 @@ public class IconUtils { } public static Drawable loadMimeIcon(Context context, String mimeType) { final Resources res = context.getResources(); if (Document.MIME_TYPE_DIR.equals(mimeType)) { return res.getDrawable(R.drawable.ic_doc_folder); return context.getDrawable(R.drawable.ic_doc_folder); } // Look for exact match first Integer resId = sMimeIcons.get(mimeType); if (resId != null) { return res.getDrawable(resId); return context.getDrawable(resId); } if (mimeType == null) { Loading @@ -258,15 +254,15 @@ public class IconUtils { // Otherwise look for partial match final String typeOnly = mimeType.split("/")[0]; if ("audio".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_audio); return context.getDrawable(R.drawable.ic_doc_audio); } else if ("image".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_image); return context.getDrawable(R.drawable.ic_doc_image); } else if ("text".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_text); return context.getDrawable(R.drawable.ic_doc_text); } else if ("video".equals(typeOnly)) { return res.getDrawable(R.drawable.ic_doc_video); return context.getDrawable(R.drawable.ic_doc_video); } else { return res.getDrawable(R.drawable.ic_doc_generic); return context.getDrawable(R.drawable.ic_doc_generic); } } Loading @@ -276,7 +272,7 @@ public class IconUtils { final TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(tintAttrId, outValue, true); final Drawable icon = res.getDrawable(drawableId); final Drawable icon = context.getDrawable(drawableId); icon.mutate(); icon.setTintList(res.getColorStateList(outValue.resourceId)); return icon; Loading