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

Builder()
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

Public constructors

Builder

public Builder ()

Builder

public Builder (ShapeAppearanceModel other)

Parameters
other ShapeAppearanceModel

Public methods

build

public ShapeAppearanceModel build ()

Builds an instance of a ShapeAppearanceModel

Returns
ShapeAppearanceModel

setAllCornerSizes

public 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

public ShapeAppearanceModel.Builder setAllCornerSizes (float cornerSize)

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

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setAllCorners

public 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

public 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 CornerFamily.ROUNDED or CornerFamily.CUT.

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

Returns
ShapeAppearanceModel.Builder

setAllEdges

public 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

public ShapeAppearanceModel.Builder setBottomEdge (EdgeTreatment bottomEdge)

Sets the edge treatment for the bottom edge.

Parameters
bottomEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomLeftCorner

public 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

public 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

public ShapeAppearanceModel.Builder setBottomLeftCorner (CornerTreatment bottomLeftCorner)

Sets the corner treatment for the bottom left corner.

Parameters
bottomLeftCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomLeftCornerSize

public ShapeAppearanceModel.Builder setBottomLeftCornerSize (CornerSize cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setBottomLeftCornerSize

public ShapeAppearanceModel.Builder setBottomLeftCornerSize (float cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setBottomRightCorner

public ShapeAppearanceModel.Builder setBottomRightCorner (CornerTreatment bottomRightCorner)

Sets the corner treatment for the bottom right corner.

Parameters
bottomRightCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setBottomRightCorner

public 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

public 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

public ShapeAppearanceModel.Builder setBottomRightCornerSize (float cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setBottomRightCornerSize

public ShapeAppearanceModel.Builder setBottomRightCornerSize (CornerSize cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setLeftEdge

public ShapeAppearanceModel.Builder setLeftEdge (EdgeTreatment leftEdge)

Sets the edge treatment for the left edge.

Parameters
leftEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setRightEdge

public ShapeAppearanceModel.Builder setRightEdge (EdgeTreatment rightEdge)

Sets the edge treatment for the right edge.

Parameters
rightEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopEdge

public ShapeAppearanceModel.Builder setTopEdge (EdgeTreatment topEdge)

Sets the edge treatment for the top edge.

Parameters
topEdge EdgeTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopLeftCorner

public ShapeAppearanceModel.Builder setTopLeftCorner (CornerTreatment topLeftCorner)

Sets the corner treatment for the top left corner.

Parameters
topLeftCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopLeftCorner

public 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

public 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

public ShapeAppearanceModel.Builder setTopLeftCornerSize (CornerSize cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setTopLeftCornerSize

public ShapeAppearanceModel.Builder setTopLeftCornerSize (float cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder

setTopRightCorner

public ShapeAppearanceModel.Builder setTopRightCorner (CornerTreatment topRightCorner)

Sets the corner treatment for the top right corner.

Parameters
topRightCorner CornerTreatment: the desired treatment.

Returns
ShapeAppearanceModel.Builder

setTopRightCorner

public 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

public 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

public ShapeAppearanceModel.Builder setTopRightCornerSize (CornerSize cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize CornerSize

Returns
ShapeAppearanceModel.Builder

setTopRightCornerSize

public ShapeAppearanceModel.Builder setTopRightCornerSize (float cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize float

Returns
ShapeAppearanceModel.Builder