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

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

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

setAllCornerSizes

public ShapeAppearanceModel.Builder setAllCornerSizes (CornerSize cornerSize)

Sets all corner sizes.

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

setAllCornerSizes

public ShapeAppearanceModel.Builder setAllCornerSizes (float cornerSize)

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

Parameters
cornerSize float

setAllCorners

public ShapeAppearanceModel.Builder setAllCorners (CornerTreatment cornerTreatment)

Sets all corner treatments.

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

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.

setAllEdges

public ShapeAppearanceModel.Builder setAllEdges (EdgeTreatment edgeTreatment)

Sets all edge treatments.

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

setBottomEdge

public ShapeAppearanceModel.Builder setBottomEdge (EdgeTreatment bottomEdge)

Sets the edge treatment for the bottom edge.

Parameters
bottomEdge EdgeTreatment: the desired treatment.

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

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

setBottomLeftCorner

public ShapeAppearanceModel.Builder setBottomLeftCorner (CornerTreatment bottomLeftCorner)

Sets the corner treatment for the bottom left corner.

Parameters
bottomLeftCorner CornerTreatment: the desired treatment.

setBottomLeftCornerSize

public ShapeAppearanceModel.Builder setBottomLeftCornerSize (CornerSize cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize CornerSize

setBottomLeftCornerSize

public ShapeAppearanceModel.Builder setBottomLeftCornerSize (float cornerSize)

Sets the bottom left corner size for the current corner.

Parameters
cornerSize float

setBottomRightCorner

public ShapeAppearanceModel.Builder setBottomRightCorner (CornerTreatment bottomRightCorner)

Sets the corner treatment for the bottom right corner.

Parameters
bottomRightCorner CornerTreatment: the desired treatment.

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

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

setBottomRightCornerSize

public ShapeAppearanceModel.Builder setBottomRightCornerSize (float cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize float

setBottomRightCornerSize

public ShapeAppearanceModel.Builder setBottomRightCornerSize (CornerSize cornerSize)

Sets the bottom right corner size for the current corner.

Parameters
cornerSize CornerSize

setLeftEdge

public ShapeAppearanceModel.Builder setLeftEdge (EdgeTreatment leftEdge)

Sets the edge treatment for the left edge.

Parameters
leftEdge EdgeTreatment: the desired treatment.

setRightEdge

public ShapeAppearanceModel.Builder setRightEdge (EdgeTreatment rightEdge)

Sets the edge treatment for the right edge.

Parameters
rightEdge EdgeTreatment: the desired treatment.

setTopEdge

public ShapeAppearanceModel.Builder setTopEdge (EdgeTreatment topEdge)

Sets the edge treatment for the top edge.

Parameters
topEdge EdgeTreatment: the desired treatment.

setTopLeftCorner

public ShapeAppearanceModel.Builder setTopLeftCorner (CornerTreatment topLeftCorner)

Sets the corner treatment for the top left corner.

Parameters
topLeftCorner CornerTreatment: the desired treatment.

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

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

setTopLeftCornerSize

public ShapeAppearanceModel.Builder setTopLeftCornerSize (CornerSize cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize CornerSize

setTopLeftCornerSize

public ShapeAppearanceModel.Builder setTopLeftCornerSize (float cornerSize)

Sets the top left corner size for the current corner.

Parameters
cornerSize float

setTopRightCorner

public ShapeAppearanceModel.Builder setTopRightCorner (CornerTreatment topRightCorner)

Sets the corner treatment for the top right corner.

Parameters
topRightCorner CornerTreatment: the desired treatment.

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

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

setTopRightCornerSize

public ShapeAppearanceModel.Builder setTopRightCornerSize (CornerSize cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize CornerSize

setTopRightCornerSize

public ShapeAppearanceModel.Builder setTopRightCornerSize (float cornerSize)

Sets the top right corner size for the current corner.

Parameters
cornerSize float