Make BitmapDrawable#setBitmap public
Bug: 154628299 Test: I20d4f94a145474394bc660368d9ddd1897001f4a This allows displaying a new Bitmap without paying the cost of creation and GC of the BitmapDrawable. Non-SDK-API usage is low, but this is useful. Previously it was @hide and used by the system. Once BitmapDrawable is in a mainline module, the system can no longer access @hide methods. Change-Id: I6a24b3c5870b0ee7d171aab86257896261b4b8c7
This commit is contained in:
committed by
Leon Scroggins
parent
c8d49effd5
commit
bea80a7725
@@ -15784,6 +15784,7 @@ package android.graphics.drawable {
|
||||
method public final boolean isAutoMirrored();
|
||||
method public void setAlpha(int);
|
||||
method public void setAntiAlias(boolean);
|
||||
method public void setBitmap(@Nullable android.graphics.Bitmap);
|
||||
method public void setColorFilter(android.graphics.ColorFilter);
|
||||
method public void setDither(boolean);
|
||||
method public void setGravity(int);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.content.res.ColorStateList;
|
||||
@@ -239,9 +240,10 @@ public class BitmapDrawable extends Drawable {
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
public void setBitmap(Bitmap bitmap) {
|
||||
/**
|
||||
* Switch to a new Bitmap object.
|
||||
*/
|
||||
public void setBitmap(@Nullable Bitmap bitmap) {
|
||||
if (mBitmapState.mBitmap != bitmap) {
|
||||
mBitmapState.mBitmap = bitmap;
|
||||
computeBitmapSize();
|
||||
|
||||
Reference in New Issue
Block a user