ShapeAppearanceModel.Builder

public static final class ShapeAppearanceModel.Builder
extends Object

java.lang.Object
   ↳ com.google.android.material.shape.ShapeAppearanceModel.Builder


Builder to create instances of ShapeAppearanceModels.

Summary

Public constructors

ShapeAppearanceModel.Builder()
ShapeAppearanceModel.Builder(ShapeAppearanceModel other)

Public methods

ShapeAppearanceModel build()

Builds an instance of a ShapeAppearanceModel

ShapeAppearanceModel.Builder setAllCornerSizes(CornerSize cornerSize)

Sets all corner sizes.

ShapeAppearanceModel.Builder setAllCornerSizes(float cornerSize)

Sets the corner size of all four corner treatments to cornerSize.

ShapeAppearanceModel.Builder setAllCorners(CornerTreatment cornerTreatment)

Sets all corner treatments.

ShapeAppearanceModel.Builder setAllCorners(int cornerFamily, float cornerSize)

Sets all corner treatments to CornerTreatments generated from a cornerFamily and cornerSize.

ShapeAppearanceModel.Builder setAllEdges(EdgeTreatment edgeTreatment)

Sets all edge treatments.

ShapeAppearanceModel.Builder setBottomEdge(EdgeTreatment bottomEdge)

Sets the edge treatment for the bottom edge.

ShapeAppearanceModel.Builder setBottomLeftCorner(int cornerFamily, float cornerSize)

Sets the corner treatment for the bottom left corner.

ShapeAppearanceModel.Builder setBottomLeftCorner(int cornerFamily, CornerSize cornerSize)

Sets the corner treatment for the bottom left corner.

ShapeAppearanceModel.Builder setBottomLeftCorner(CornerTreatment bottomLeftCorner)

Sets the corner treatment for the bottom left corner.

ShapeAppearanceModel.Builder setBottomLeftCornerSize(CornerSize cornerSize)

Sets the bottom left corner size for the current corner.

ShapeAppearanceModel.Builder setBottomLeftCornerSize(float cornerSize)

Sets the bottom left corner size for the current corner.

ShapeAppearanceModel.Builder setBottomRightCorner(CornerTreatment bottomRightCorner)

Sets the corner treatment for the bottom right corner.

ShapeAppearanceModel.Builder setBottomRightCorner(int cornerFamily, CornerSize cornerSize)

Sets the corner treatment for the bottom right corner.

ShapeAppearanceModel.Builder setBottomRightCorner(int cornerFamily, float cornerSize)

Sets the corner treatment for the bottom right corner.

ShapeAppearanceModel.Builder setBottomRightCornerSize(float cornerSize)

Sets the bottom right corner size for the current corner.

ShapeAppearanceModel.Builder setBottomRightCornerSize(CornerSize cornerSize)

Sets the bottom right corner size for the current corner.

ShapeAppearanceModel.Builder setLeftEdge(EdgeTreatment leftEdge)

Sets the edge treatment for the left edge.

ShapeAppearanceModel.Builder setRightEdge(EdgeTreatment rightEdge)

Sets the edge treatment for the right edge.

ShapeAppearanceModel.Builder setTopEdge(EdgeTreatment topEdge)

Sets the edge treatment for the top edge.

ShapeAppearanceModel.Builder setTopLeftCorner(CornerTreatment topLeftCorner)

Sets the corner treatment for the top left corner.

ShapeAppearanceModel.Builder setTopLeftCorner(int cornerFamily, float cornerSize)

Sets the corner treatment for the top left corner.

ShapeAppearanceModel.Builder setTopLeftCorner(int cornerFamily, CornerSize cornerSize)

Sets the corner treatment for the top left corner.

ShapeAppearanceModel.Builder setTopLeftCornerSize(CornerSize cornerSize)

Sets the top left corner size for the current corner.

ShapeAppearanceModel.Builder setTopLeftCornerSize(float cornerSize)

Sets the top left corner size for the current corner.

ShapeAppearanceModel.Builder setTopRightCorner(CornerTreatment topRightCorner)

Sets the corner treatment for the top right corner.

ShapeAppearanceModel.Builder setTopRightCorner(int cornerFamily, CornerSize cornerSize)

Sets the corner treatment for the top right corner.

ShapeAppearanceModel.Builder setTopRightCorner(int cornerFamily, float cornerSize)

Sets the corner treatment for the top right corner.

ShapeAppearanceModel.Builder setTopRightCornerSize(CornerSize cornerSize)

Sets the top right corner size for the current corner.

ShapeAppearanceModel.Builder setTopRightCornerSize(float cornerSize)

Sets the top right corner size for the current corner.

Inherited methods

From class java.lang.Object

Public constructors

ShapeAppearanceModel.Builder

ShapeAppearanceModel.Builder ()

ShapeAppearanceModel.Builder

ShapeAppearanceModel.Builder (ShapeAppearanceModel other)

Parameters
other ShapeAppearanceModel

Public methods

build

ShapeAppearanceModel build ()

Builds an instance of a ShapeAppearanceModel

Returns
ShapeAppearanceModel

setAllCornerSizes

ShapeAppearanceModel.Builder setAllCornerSizes (CornerSize cornerSize)

Sets all corner sizes.

Parameters
cornerSize CornerSize: the corner size to use for all four corners.

Returns
ShapeAppearanceModel.Builder

setAllCornerSizes

ShapeAppearanceModel.Builder setAllCornerSizes (float cornerSize)

Sets the corner size of all four corner treatments to cornerSize.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setAllCorners

ShapeAppearanceModel.Builder setAllCorners (CornerTreatment cornerTreatment)

Sets all corner treatments.

Parameters
cornerTreatment CornerTreatment: the corner treatment to use for all four corners.

Returns
ShapeAppearanceModel.Builder

setAllCorners

ShapeAppearanceModel.Builder setAllCorners (int cornerFamily, 
                float cornerSize)

Sets all corner treatments to CornerTreatments generated from a cornerFamily and cornerSize.

Parameters
cornerFamily int: The family to be used to create the CornerTreatments for all four corners. May be one of ROUNDED or CUT.

cornerSize float: The size to be used to create the CornerTreatments for all four corners.

Returns
ShapeAppearanceModel.Builder

setAllEdges

ShapeAppearanceModel.Builder setAllEdges (EdgeTreatment edgeTreatment)

Sets all edge treatments.

Parameters
edgeTreatment EdgeTreatment: the edge treatment to use for all four edges.

Returns
ShapeAppearanceModel.Builder

setBottomEdge

ShapeAppearanceModel.Builder setBottomEdge (EdgeTreatment bottomEdge)

Sets the edge treatment for the bottom edge.

Parameters
bottomEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomLeftCorner

ShapeAppearanceModel.Builder setBottomLeftCorner (int cornerFamily, 
                float cornerSize)

Sets the corner treatment for the bottom left corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize float: the size to use for the corner

Returns
ShapeAppearanceModel.Builder

setBottomLeftCorner

ShapeAppearanceModel.Builder setBottomLeftCorner (int cornerFamily, 
                CornerSize cornerSize)

Sets the corner treatment for the bottom left corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize CornerSize: the CornerSize to use for the corner

Returns
ShapeAppearanceModel.Builder

setBottomLeftCorner

ShapeAppearanceModel.Builder setBottomLeftCorner (CornerTreatment bottomLeftCorner)

Sets the corner treatment for the bottom left corner.

Parameters
bottomLeftCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomLeftCornerSize

ShapeAppearanceModel.Builder setBottomLeftCornerSize (CornerSize cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setBottomLeftCornerSize

ShapeAppearanceModel.Builder setBottomLeftCornerSize (float cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setBottomRightCorner

ShapeAppearanceModel.Builder setBottomRightCorner (CornerTreatment bottomRightCorner)

Sets the corner treatment for the bottom right corner.

Parameters
bottomRightCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomRightCorner

ShapeAppearanceModel.Builder setBottomRightCorner (int cornerFamily, 
                CornerSize cornerSize)

Sets the corner treatment for the bottom right corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize CornerSize: the CornerSize to use for the corner

Returns
ShapeAppearanceModel.Builder

setBottomRightCorner

ShapeAppearanceModel.Builder setBottomRightCorner (int cornerFamily, 
                float cornerSize)

Sets the corner treatment for the bottom right corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize float: the size to use for the corner

Returns
ShapeAppearanceModel.Builder

setBottomRightCornerSize

ShapeAppearanceModel.Builder setBottomRightCornerSize (float cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setBottomRightCornerSize

ShapeAppearanceModel.Builder setBottomRightCornerSize (CornerSize cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setLeftEdge

ShapeAppearanceModel.Builder setLeftEdge (EdgeTreatment leftEdge)

Sets the edge treatment for the left edge.

Parameters
leftEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setRightEdge

ShapeAppearanceModel.Builder setRightEdge (EdgeTreatment rightEdge)

Sets the edge treatment for the right edge.

Parameters
rightEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopEdge

ShapeAppearanceModel.Builder setTopEdge (EdgeTreatment topEdge)

Sets the edge treatment for the top edge.

Parameters
topEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopLeftCorner

ShapeAppearanceModel.Builder setTopLeftCorner (CornerTreatment topLeftCorner)

Sets the corner treatment for the top left corner.

Parameters
topLeftCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopLeftCorner

ShapeAppearanceModel.Builder setTopLeftCorner (int cornerFamily, 
                float cornerSize)

Sets the corner treatment for the top left corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize float: the size to use for the corner

Returns
ShapeAppearanceModel.Builder

setTopLeftCorner

ShapeAppearanceModel.Builder setTopLeftCorner (int cornerFamily, 
                CornerSize cornerSize)

Sets the corner treatment for the top left corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize CornerSize: the CornerSize to use for the corner

Returns
ShapeAppearanceModel.Builder

setTopLeftCornerSize

ShapeAppearanceModel.Builder setTopLeftCornerSize (CornerSize cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setTopLeftCornerSize

ShapeAppearanceModel.Builder setTopLeftCornerSize (float cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setTopRightCorner

ShapeAppearanceModel.Builder setTopRightCorner (CornerTreatment topRightCorner)

Sets the corner treatment for the top right corner.

Parameters
topRightCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopRightCorner

ShapeAppearanceModel.Builder setTopRightCorner (int cornerFamily, 
                CornerSize cornerSize)

Sets the corner treatment for the top right corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize CornerSize: the CornerSize to use for the corner

Returns
ShapeAppearanceModel.Builder

setTopRightCorner

ShapeAppearanceModel.Builder setTopRightCorner (int cornerFamily, 
                float cornerSize)

Sets the corner treatment for the top right corner.

Parameters
cornerFamily int: the family to use to create the corner treatment

cornerSize float: the size to use for the corner

Returns
ShapeAppearanceModel.Builder

setTopRightCornerSize

ShapeAppearanceModel.Builder setTopRightCornerSize (CornerSize cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setTopRightCornerSize

ShapeAppearanceModel.Builder setTopRightCornerSize (float cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder