Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -12404,7 +12404,7 @@ package android.graphics.drawable { method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri); method public static android.graphics.drawable.Icon createWithData(byte[], int, int); method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String); method public static android.graphics.drawable.Icon createWithResource(android.content.res.Resources, int); method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int); method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int); method public int describeContents(); method public android.graphics.drawable.Drawable loadDrawable(android.content.Context); api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -12713,7 +12713,7 @@ package android.graphics.drawable { method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri); method public static android.graphics.drawable.Icon createWithData(byte[], int, int); method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String); method public static android.graphics.drawable.Icon createWithResource(android.content.res.Resources, int); method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int); method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int); method public int describeContents(); method public android.graphics.drawable.Drawable loadDrawable(android.content.Context); graphics/java/android/graphics/drawable/Icon.java +13 −2 Original line number Diff line number Diff line Loading @@ -353,15 +353,26 @@ public final class Icon implements Parcelable { /** * Create an Icon pointing to a drawable resource. * @param res Resources for a package containing the resource in question * @param context The context for the application whose resources should be used to resolve the * given resource ID. * @param resId ID of the drawable resource */ public static Icon createWithResource(Context context, @DrawableRes int resId) { final Icon rep = new Icon(TYPE_RESOURCE); rep.mInt1 = resId; rep.mString1 = context.getPackageName(); return rep; } /** * Version of createWithResource that takes Resources. Do not use. * @hide */ public static Icon createWithResource(Resources res, @DrawableRes int resId) { if (res == null) { throw new IllegalArgumentException("Resource must not be null."); } final Icon rep = new Icon(TYPE_RESOURCE); rep.mObj1 = res; rep.mInt1 = resId; rep.mString1 = res.getResourcePackageName(resId); return rep; Loading graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -112,8 +112,7 @@ public class IconTest extends AndroidTestCase { final Bitmap res1 = ((BitmapDrawable) getContext().getDrawable(R.drawable.landscape)) .getBitmap(); final Icon im1 = Icon.createWithResource(getContext().getResources(), R.drawable.landscape); final Icon im1 = Icon.createWithResource(getContext(), R.drawable.landscape); final Drawable draw1 = im1.loadDrawable(mContext); final Bitmap test1 = Bitmap.createBitmap(draw1.getIntrinsicWidth(), draw1.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Loading Loading @@ -223,7 +222,7 @@ public class IconTest extends AndroidTestCase { imgs.add(bit1); final Icon data1 = Icon.createWithData(pngdata, 0, pngdata.length); imgs.add(data1); final Icon res1 = Icon.createWithResource(getContext().getResources(), R.drawable.landscape); final Icon res1 = Icon.createWithResource(getContext(), R.drawable.landscape); imgs.add(res1); ArrayList<Icon> test = new ArrayList<>(); Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -12404,7 +12404,7 @@ package android.graphics.drawable { method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri); method public static android.graphics.drawable.Icon createWithData(byte[], int, int); method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String); method public static android.graphics.drawable.Icon createWithResource(android.content.res.Resources, int); method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int); method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int); method public int describeContents(); method public android.graphics.drawable.Drawable loadDrawable(android.content.Context);
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -12713,7 +12713,7 @@ package android.graphics.drawable { method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri); method public static android.graphics.drawable.Icon createWithData(byte[], int, int); method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String); method public static android.graphics.drawable.Icon createWithResource(android.content.res.Resources, int); method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int); method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int); method public int describeContents(); method public android.graphics.drawable.Drawable loadDrawable(android.content.Context);
graphics/java/android/graphics/drawable/Icon.java +13 −2 Original line number Diff line number Diff line Loading @@ -353,15 +353,26 @@ public final class Icon implements Parcelable { /** * Create an Icon pointing to a drawable resource. * @param res Resources for a package containing the resource in question * @param context The context for the application whose resources should be used to resolve the * given resource ID. * @param resId ID of the drawable resource */ public static Icon createWithResource(Context context, @DrawableRes int resId) { final Icon rep = new Icon(TYPE_RESOURCE); rep.mInt1 = resId; rep.mString1 = context.getPackageName(); return rep; } /** * Version of createWithResource that takes Resources. Do not use. * @hide */ public static Icon createWithResource(Resources res, @DrawableRes int resId) { if (res == null) { throw new IllegalArgumentException("Resource must not be null."); } final Icon rep = new Icon(TYPE_RESOURCE); rep.mObj1 = res; rep.mInt1 = resId; rep.mString1 = res.getResourcePackageName(resId); return rep; Loading
graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -112,8 +112,7 @@ public class IconTest extends AndroidTestCase { final Bitmap res1 = ((BitmapDrawable) getContext().getDrawable(R.drawable.landscape)) .getBitmap(); final Icon im1 = Icon.createWithResource(getContext().getResources(), R.drawable.landscape); final Icon im1 = Icon.createWithResource(getContext(), R.drawable.landscape); final Drawable draw1 = im1.loadDrawable(mContext); final Bitmap test1 = Bitmap.createBitmap(draw1.getIntrinsicWidth(), draw1.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Loading Loading @@ -223,7 +222,7 @@ public class IconTest extends AndroidTestCase { imgs.add(bit1); final Icon data1 = Icon.createWithData(pngdata, 0, pngdata.length); imgs.add(data1); final Icon res1 = Icon.createWithResource(getContext().getResources(), R.drawable.landscape); final Icon res1 = Icon.createWithResource(getContext(), R.drawable.landscape); imgs.add(res1); ArrayList<Icon> test = new ArrayList<>(); Loading