Back to Fresco

RoundedDrawable

docs/javadoc/reference/com/facebook/drawee/drawable/RoundedDrawable.html

3.6.026.5 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Packages | Classes

Summary: Fields | Methods | Protected Methods | Inherited Methods | [Expand All]

public abstract class

RoundedDrawable

extends Drawable
implements RoundedTransformAwareDrawable

| java.lang.Object | | ↳ | android.graphics.drawable.Drawable | | | ↳ | com.facebook.drawee.drawable.RoundedDrawable |

| Known Direct Subclasses

RoundedBitmapDrawable, RoundedNinePatchDrawable

| RoundedBitmapDrawable | | | RoundedNinePatchDrawable | |

|

Summary

Fields
protected int
protected final Path
protected float
protected boolean
protected boolean
protected final Path
protected boolean
Public Methods
void
void
int
int
Gets the border color.
float
Gets the border width.
ColorFilter
int
int
int
float
Gets the padding.
boolean
Gets whether to set FILTER_BITMAP_FLAG flag to Paint.
float[]
Gets the radii.
boolean
Gets whether image should be scaled down inside borders.
boolean
Returns whether or not this drawable rounds as circle.
void
void
Sets the border
void
Sets whether to round as circle.
void
void
void
Sets the padding for the bitmap.
void
Sets FILTER_BITMAP_FLAG flag to Paint.
void
Specify radii for each of the 4 corners.
void
Specify radius for the corners of the rectangle.
void
Sets whether image should be scaled down inside borders.
void
TransformAwareDrawable method
Protected Methods
void
void
void

| [Expand] Inherited Methods | | --- | | From class android.graphics.drawable.Drawable

| void | applyTheme(Resources.Theme arg0) | | boolean | canApplyTheme() | | void | clearColorFilter() | | final Rect | copyBounds() | | final void | copyBounds(Rect arg0) | | static Drawable | createFromPath(String arg0) | | static Drawable | createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3, BitmapFactory.Options arg4) | | static Drawable | createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3) | | static Drawable | createFromStream(InputStream arg0, String arg1) | | static Drawable | createFromXml(Resources arg0, XmlPullParser arg1) | | static Drawable | createFromXml(Resources arg0, XmlPullParser arg1, Resources.Theme arg2) | | static Drawable | createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3) | | static Drawable | createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2) | | abstract void | draw(Canvas arg0) | | int | getAlpha() | | final Rect | getBounds() | | Drawable.Callback | getCallback() | | int | getChangingConfigurations() | | ColorFilter | getColorFilter() | | Drawable.ConstantState | getConstantState() | | Drawable | getCurrent() | | Rect | getDirtyBounds() | | void | getHotspotBounds(Rect arg0) | | int | getIntrinsicHeight() | | int | getIntrinsicWidth() | | int | getLayoutDirection() | | final int | getLevel() | | int | getMinimumHeight() | | int | getMinimumWidth() | | abstract int | getOpacity() | | void | getOutline(Outline arg0) | | boolean | getPadding(Rect arg0) | | int[] | getState() | | Region | getTransparentRegion() | | void | inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3) | | void | inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2) | | void | invalidateSelf() | | boolean | isAutoMirrored() | | boolean | isFilterBitmap() | | boolean | isStateful() | | final boolean | isVisible() | | void | jumpToCurrentState() | | Drawable | mutate() | | void | onBoundsChange(Rect arg0) | | boolean | onLayoutDirectionChanged(int arg0) | | boolean | onLevelChange(int arg0) | | boolean | onStateChange(int[] arg0) | | static int | resolveOpacity(int arg0, int arg1) | | void | scheduleSelf(Runnable arg0, long arg1) | | abstract void | setAlpha(int arg0) | | void | setAutoMirrored(boolean arg0) | | void | setBounds(int arg0, int arg1, int arg2, int arg3) | | void | setBounds(Rect arg0) | | final void | setCallback(Drawable.Callback arg0) | | void | setChangingConfigurations(int arg0) | | void | setColorFilter(int arg0, PorterDuff.Mode arg1) | | abstract void | setColorFilter(ColorFilter arg0) | | void | setDither(boolean arg0) | | void | setFilterBitmap(boolean arg0) | | void | setHotspot(float arg0, float arg1) | | void | setHotspotBounds(int arg0, int arg1, int arg2, int arg3) | | final boolean | setLayoutDirection(int arg0) | | final boolean | setLevel(int arg0) | | boolean | setState(int[] arg0) | | void | setTint(int arg0) | | void | setTintList(ColorStateList arg0) | | void | setTintMode(PorterDuff.Mode arg0) | | boolean | setVisible(boolean arg0, boolean arg1) | | void | unscheduleSelf(Runnable arg0) |

| | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.drawee.drawable.Rounded

| abstract int | getBorderColor() | | abstract float | getBorderWidth() | | abstract float | getPadding() | | abstract boolean | getPaintFilterBitmap() | | abstract float[] | getRadii() | | abstract boolean | getScaleDownInsideBorders() | | abstract boolean | isCircle() | | abstract void | setBorder(int color, float width) | | abstract void | setCircle(boolean isCircle) | | abstract void | setPadding(float padding) | | abstract void | setPaintFilterBitmap(boolean paintFilterBitmap) | | abstract void | setRadii(float[] radii) | | abstract void | setRadius(float radius) | | abstract void | setScaleDownInsideBorders(boolean scaleDownInsideBorders) |

| | From interface com.facebook.drawee.drawable.TransformAwareDrawable

| abstract void | setTransformCallback(TransformCallback transformCallback) Sets a transform callback. |

|

Fields

protected int mBorderColor

protected final Path mBorderPath

protected float mBorderWidth

protected boolean mIsCircle

protected boolean mIsShaderTransformDirty

protected final Path mPath

protected boolean mRadiiNonZero

Public Methods

public void clearColorFilter()

public void draw(Canvas canvas)

public int getAlpha()

public int getBorderColor()

Gets the border color.

public float getBorderWidth()

Gets the border width.

public ColorFilter getColorFilter()

public int getIntrinsicHeight()

public int getIntrinsicWidth()

public int getOpacity()

public float getPadding()

Gets the padding.

public boolean getPaintFilterBitmap()

Gets whether to set FILTER_BITMAP_FLAG flag to Paint.

public float[] getRadii()

Gets the radii.

public boolean getScaleDownInsideBorders()

Gets whether image should be scaled down inside borders.

public boolean isCircle()

Returns whether or not this drawable rounds as circle.

public void setAlpha(int alpha)

public void setBorder(int color, float width)

Sets the border

Parameters

| color | of the border | | width | of the border |

public void setCircle(boolean isCircle)

Sets whether to round as circle.

Parameters

| isCircle | whether or not to round as circle |

public void setColorFilter(ColorFilter colorFilter)

public void setColorFilter(int color, PorterDuff.Mode mode)

public void setPadding(float padding)

Sets the padding for the bitmap.

public void setPaintFilterBitmap(boolean paintFilterBitmap)

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.

Parameters

| paintFilterBitmap | whether to set FILTER_BITMAP_FLAG flag to Paint. |

public void setRadii(float[] radii)

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

Parameters

| radii | the x and y radii of the corners |

public void setRadius(float radius)

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.

Parameters

| radius | the radius for the corners of the rectangle |

public void setScaleDownInsideBorders(boolean scaleDownInsideBorders)

Sets whether image should be scaled down inside borders.

public void setTransformCallback(TransformCallback transformCallback)

TransformAwareDrawable method

Parameters

| transformCallback | the transform callback to be set |

Protected Methods

protected void onBoundsChange(Rect bounds)

protected void updatePath()

protected void updateTransform()

+Generated by Doclava. +