diff options
author | Dan Sandler <dsandler@android.com> | 2015-03-04 13:08:49 -0500 |
---|---|---|
committer | Dan Sandler <dsandler@android.com> | 2015-05-01 13:44:42 -0400 |
commit | b9f7aac3488873677377b36c57338d758098f78e (patch) | |
tree | 505fc8e2f81d70f0f9949ed490acb5854bf87c99 /api | |
parent | 7dc7d09ba5abdc99eb5f106cf3ce545355d4c9be (diff) | |
download | frameworks_base-b9f7aac3488873677377b36c57338d758098f78e.zip frameworks_base-b9f7aac3488873677377b36c57338d758098f78e.tar.gz frameworks_base-b9f7aac3488873677377b36c57338d758098f78e.tar.bz2 |
Icon: a clean, parcelable place for images.
Binder APIs which wish to consume Bitmaps *and* drawable
resources can now do so by using Icon, a kind of union type
that accommodates each of these. Icon also accepts byte
arrays holding compressed Bitmaps (PNG, JPEG, etc), which
saves clients the additional memory cost of decoding and
sending full uncompressed bitmaps through Binder interfaces.
Receiving clients can call loadDrawable{,Async} and then
getDrawable to start immediately using the image in an
ImageView or other Drawable-hosting container.
Bug: 19609468
Change-Id: Ic1343711c2ac0b15876b46f0b6008b0108a49470
Diffstat (limited to 'api')
-rw-r--r-- | api/current.txt | 19 | ||||
-rw-r--r-- | api/system-current.txt | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index be01112..f8d3ef3 100644 --- a/api/current.txt +++ b/api/current.txt @@ -12486,6 +12486,25 @@ package android.graphics.drawable { enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation TR_BL; } + public final class Icon implements android.os.Parcelable { + method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap); + method public static android.graphics.drawable.Icon createWithContentUri(java.lang.String); + 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 int describeContents(); + method public android.graphics.drawable.Drawable loadDrawable(android.content.Context); + method public void loadDrawableAsync(android.content.Context, android.os.Message); + method public void loadDrawableAsync(android.content.Context, android.os.Handler, android.graphics.drawable.Icon.OnDrawableLoadedListener); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator<android.graphics.drawable.Icon> CREATOR; + } + + public static abstract interface Icon.OnDrawableLoadedListener { + method public abstract void onDrawableLoaded(android.graphics.drawable.Drawable); + } + public class InsetDrawable extends android.graphics.drawable.DrawableWrapper { ctor public InsetDrawable(android.graphics.drawable.Drawable, int); ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int); diff --git a/api/system-current.txt b/api/system-current.txt index c4f96af..87f53dc 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -12780,6 +12780,25 @@ package android.graphics.drawable { enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation TR_BL; } + public final class Icon implements android.os.Parcelable { + method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap); + method public static android.graphics.drawable.Icon createWithContentUri(java.lang.String); + 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 int describeContents(); + method public android.graphics.drawable.Drawable loadDrawable(android.content.Context); + method public void loadDrawableAsync(android.content.Context, android.os.Message); + method public void loadDrawableAsync(android.content.Context, android.os.Handler, android.graphics.drawable.Icon.OnDrawableLoadedListener); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator<android.graphics.drawable.Icon> CREATOR; + } + + public static abstract interface Icon.OnDrawableLoadedListener { + method public abstract void onDrawableLoaded(android.graphics.drawable.Drawable); + } + public class InsetDrawable extends android.graphics.drawable.DrawableWrapper { ctor public InsetDrawable(android.graphics.drawable.Drawable, int); ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int); |