RoundedBitmapDrawableFactorypublic class RoundedBitmapDrawableFactory extends Object Constructs {@link RoundedBitmapDrawable RoundedBitmapDrawable} objects,
either from Bitmaps directly, or from streams and files. |
Fields Summary |
---|
private static final String | TAG |
Methods Summary |
---|
public static RoundedBitmapDrawable | create(android.content.res.Resources res, android.graphics.Bitmap bitmap)Returns a new drawable by creating it from a bitmap, setting initial target density based on
the display metrics of the resources.
if (Build.VERSION.SDK_INT >= 21) {
return new RoundedBitmapDrawable21(res, bitmap);
}
return new DefaultRoundedBitmapDrawable(res, bitmap);
| public static RoundedBitmapDrawable | create(android.content.res.Resources res, java.lang.String filepath)Returns a new drawable, creating it by opening a given file path and decoding the bitmap.
final RoundedBitmapDrawable drawable = create(res, BitmapFactory.decodeFile(filepath));
if (drawable.getBitmap() == null) {
Log.w(TAG, "BitmapDrawable cannot decode " + filepath);
}
return drawable;
| public static RoundedBitmapDrawable | create(android.content.res.Resources res, java.io.InputStream is)Returns a new drawable, creating it by decoding a bitmap from the given input stream.
final RoundedBitmapDrawable drawable = create(res, BitmapFactory.decodeStream(is));
if (drawable.getBitmap() == null) {
Log.w(TAG, "BitmapDrawable cannot decode " + is);
}
return drawable;
|
|