java.lang.Object | |||
↳ | android.graphics.drawable.Drawable | ||
↳ | com.facebook.drawee.drawable.ForwardingDrawable | ||
↳ | com.facebook.drawee.drawable.RoundedCornersDrawable |
Drawable that draws underlying drawable with rounded corners.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | RoundedCornersDrawable.Type |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.facebook.drawee.drawable.ForwardingDrawable
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RoundedCornersDrawable(Drawable drawable)
Creates a new RoundedCornersDrawable with given underlying drawable.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | draw(Canvas canvas) | ||||||||||
int |
getBorderColor()
Gets the border color.
| ||||||||||
float |
getBorderWidth()
Gets the border width.
| ||||||||||
int |
getOverlayColor()
Gets the overlay color.
| ||||||||||
float |
getPadding()
Gets the padding.
| ||||||||||
boolean |
getPaintFilterBitmap()
Gets whether to set FILTER_BITMAP_FLAG flag to Paint.
| ||||||||||
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 |
setBorder(int color, float width)
Sets the border
| ||||||||||
void |
setCircle(boolean isCircle)
Sets whether to round as circle.
| ||||||||||
void |
setOverlayColor(int overlayColor)
Sets the overlay color for corner type
OVERLAY_COLOR | ||||||||||
void | setPadding(float padding) | ||||||||||
void |
setPaintFilterBitmap(boolean paintFilterBitmap)
Sets FILTER_BITMAP_FLAG flag to Paint.
| ||||||||||
void |
setRadii(float[] radii)
Sets radii values to be used for rounding.
| ||||||||||
void |
setRadius(float radius)
Sets radius to be used for rounding
| ||||||||||
void |
setScaleDownInsideBorders(boolean scaleDownInsideBorders)
Sets whether image should be scaled down inside borders.
| ||||||||||
void |
setType(RoundedCornersDrawable.Type type)
Sets the type of rounding process
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | onBoundsChange(Rect bounds) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.facebook.drawee.drawable.ForwardingDrawable
| |||||||||||
From class
android.graphics.drawable.Drawable
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.graphics.drawable.Drawable.Callback
| |||||||||||
From interface
com.facebook.drawee.drawable.DrawableParent
| |||||||||||
From interface
com.facebook.drawee.drawable.Rounded
| |||||||||||
From interface
com.facebook.drawee.drawable.TransformAwareDrawable
| |||||||||||
From interface
com.facebook.drawee.drawable.TransformCallback
|
Creates a new RoundedCornersDrawable with given underlying drawable.
drawable | underlying drawable |
---|
Gets the border color.
Gets the border width.
Gets the overlay color.
Gets the padding.
Gets whether to set FILTER_BITMAP_FLAG flag to Paint.
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 overlay color for corner type OVERLAY_COLOR
overlayColor | the color to filled outside the rounded corners |
---|
Sets FILTER_BITMAP_FLAG flag to Paint. FILTER_BITMAP_FLAG
This should generally be on when drawing bitmaps, unless performance-bound (rendering to software canvas) or preferring pixelation artifacts to blurriness when scaling significantly.
paintFilterBitmap | whether to set FILTER_BITMAP_FLAG flag to Paint. |
---|
Sets radii values to be used for rounding. Each corner receive two radius values [X, Y]. The corners are ordered top-left, top-right, bottom-right, bottom-left
radii | Array of 8 values, 4 pairs of [X,Y] radii |
---|
Sets radius to be used for rounding
radius | corner radius in pixels |
---|
Sets whether image should be scaled down inside borders.
Sets the type of rounding process
type | type of rounding process |
---|