public class

RoundingParams

extends Object
java.lang.Object
   ↳ com.facebook.drawee.generic.RoundingParams

Class Overview

Class that encapsulates rounding parameters.

Summary

Nested Classes
enum RoundingParams.RoundingMethod  
Public Constructors
RoundingParams()
Public Methods
static RoundingParams asCircle()
Factory method that creates new RoundingParams with RoundAsCircle specified.
static RoundingParams fromCornersRadii(float[] radii)
Factory method that creates new RoundingParams with the specified corners radii.
static RoundingParams fromCornersRadii(float topLeft, float topRight, float bottomRight, float bottomLeft)
Factory method that creates new RoundingParams with the specified corners radii.
static RoundingParams fromCornersRadius(float radius)
Factory method that creates new RoundingParams with the specified corners radius.
int getBorderColor()
Gets the border color
float getBorderWidth()
Gets the border width
float[] getCornersRadii()
Gets the rounded corners radii.
int getOverlayColor()
Gets the overlay color.
boolean getRoundAsCircle()
Gets whether to round as circle
RoundingParams.RoundingMethod getRoundingMethod()
Gets the rounding method.
RoundingParams setBorder(int color, float width)
Sets the border around the rounded drawable
RoundingParams setCornersRadii(float[] radii)
Sets the rounded corners radii.
RoundingParams setCornersRadii(float topLeft, float topRight, float bottomRight, float bottomLeft)
Sets the rounded corners radii.
RoundingParams setCornersRadius(float radius)
Sets the rounded corners radius.
RoundingParams setOverlayColor(int overlayColor)
Sets the overlay color and changes the method to RoundingMethod.COLOR_OVERLAY.
RoundingParams setRoundAsCircle(boolean roundAsCircle)
Sets whether to round as circle.
RoundingParams setRoundingMethod(RoundingParams.RoundingMethod roundingMethod)
Sets the rounding method.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RoundingParams ()

Public Methods

public static RoundingParams asCircle ()

Factory method that creates new RoundingParams with RoundAsCircle specified.

public static RoundingParams fromCornersRadii (float[] radii)

Factory method that creates new RoundingParams with the specified corners radii.

public static RoundingParams fromCornersRadii (float topLeft, float topRight, float bottomRight, float bottomLeft)

Factory method that creates new RoundingParams with the specified corners radii.

public static RoundingParams fromCornersRadius (float radius)

Factory method that creates new RoundingParams with the specified corners radius.

public int getBorderColor ()

Gets the border color

public float getBorderWidth ()

Gets the border width

public float[] getCornersRadii ()

Gets the rounded corners radii.

For performance reasons the internal array is returned directly. Do not modify it directly, but use one of the exposed corner radii setters instead.

public int getOverlayColor ()

Gets the overlay color.

public boolean getRoundAsCircle ()

Gets whether to round as circle

public RoundingParams.RoundingMethod getRoundingMethod ()

Gets the rounding method.

public RoundingParams setBorder (int color, float width)

Sets the border around the rounded drawable

Parameters
color of the border
width of the width

public RoundingParams setCornersRadii (float[] radii)

Sets the rounded corners radii.

Parameters
radii float array of 8 radii in pixels. Each corner receives two radius values [X, Y]. The corners are ordered top-left, top-right, bottom-right, bottom-left.
Returns
  • modified instance

public RoundingParams setCornersRadii (float topLeft, float topRight, float bottomRight, float bottomLeft)

Sets the rounded corners radii.

Parameters
topLeft top-left corner radius in pixels
topRight top-right corner radius in pixels
bottomRight bottom-right corner radius in pixels
bottomLeft bottom-left corner radius in pixels
Returns
  • modified instance

public RoundingParams setCornersRadius (float radius)

Sets the rounded corners radius.

Parameters
radius corner radius in pixels
Returns
  • modified instance

public RoundingParams setOverlayColor (int overlayColor)

Sets the overlay color and changes the method to RoundingMethod.COLOR_OVERLAY.

Parameters
overlayColor overlay color

public RoundingParams setRoundAsCircle (boolean roundAsCircle)

Sets whether to round as circle.

Parameters
roundAsCircle whether or not to round as circle
Returns
  • modified instance

public RoundingParams setRoundingMethod (RoundingParams.RoundingMethod roundingMethod)

Sets the rounding method.

Parameters
roundingMethod method of rounding
Returns
  • modified instance