java.lang.Object | |||
↳ | android.graphics.drawable.Drawable | ||
↳ | android.graphics.drawable.BitmapDrawable | ||
↳ | com.facebook.drawee.drawable.RoundedBitmapDrawable |
A drawable that can have rounded corners.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RoundedBitmapDrawable(Resources res, Bitmap bitmap) | |||||||||||
RoundedBitmapDrawable(Resources res, Bitmap bitmap, Paint paint) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | draw(Canvas canvas) | ||||||||||
static RoundedBitmapDrawable |
fromBitmapDrawable(Resources res, BitmapDrawable bitmapDrawable)
Creates a new RoundedBitmapDrawable from the given BitmapDrawable.
| ||||||||||
int |
getBorderColor()
Gets the border color.
| ||||||||||
float |
getBorderWidth()
Gets the border width.
| ||||||||||
float |
getPadding()
Gets the padding.
| ||||||||||
float[] |
getRadii()
Gets the radii.
| ||||||||||
boolean |
getScaleDownInsideBorders()
Gets whether image should be scaled down inside borders.
| ||||||||||
boolean |
isCircle()
Returns whether or not this drawable rounds as circle.
| ||||||||||
void | setAlpha(int alpha) | ||||||||||
void |
setBorder(int color, float width)
Sets the border
| ||||||||||
void |
setCircle(boolean isCircle)
Sets whether to round as circle.
| ||||||||||
void | setColorFilter(ColorFilter colorFilter) | ||||||||||
void |
setPadding(float padding)
Sets the padding for the bitmap.
| ||||||||||
void |
setRadii(float[] radii)
Specify radii for each of the 4 corners.
| ||||||||||
void |
setRadius(float radius)
Specify radius for the corners of the rectangle.
| ||||||||||
void |
setScaleDownInsideBorders(boolean scaleDownInsideBorders)
Sets whether image should be scaled down inside borders.
| ||||||||||
void |
setTransformCallback(TransformCallback transformCallback)
TransformAwareDrawable method
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new RoundedBitmapDrawable from the given BitmapDrawable.
res | resources to use for this drawable |
---|---|
bitmapDrawable | bitmap drawable containing the bitmap to be used for this drawable |
Gets the border color.
Gets the border width.
Gets the padding.
Gets the radii.
Gets whether image should be scaled down inside borders.
Returns whether or not this drawable rounds as circle.
Sets the border
color | of the border |
---|---|
width | of the border |
Sets whether to round as circle.
isCircle | whether or not to round as circle |
---|
Sets the padding for the bitmap.
Specify radii for each of the 4 corners. For each corner, the array contains 2 values, [X_radius, Y_radius]. The corners are ordered top-left, top-right, bottom-right, bottom-left
radii | the x and y radii of the corners |
---|
Specify radius for the corners of the rectangle. If this is > 0, then the drawable is drawn in a round-rectangle, rather than a rectangle.
radius | the radius for the corners of the rectangle |
---|
Sets whether image should be scaled down inside borders.
TransformAwareDrawable method
transformCallback | the transform callback to be set |
---|