FileDocCategorySizeDatePackage
RoundedBitmapDrawableFactory.javaAPI DocAndroid 5.1 API3439Thu Mar 12 22:22:56 GMT 2015android.support.v4.graphics.drawable

RoundedBitmapDrawableFactory

public 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
Constructors Summary
Methods Summary
public static RoundedBitmapDrawablecreate(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 RoundedBitmapDrawablecreate(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 RoundedBitmapDrawablecreate(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;