ShapePathModel


Kotlin |Java

public class ShapePathModel extends ShapeAppearanceModel 


This class models the edges and corners of a shape, which are used by MaterialShapeDrawable to generate and render the shape for a view's background.

Summary

Public constructors

(削除) ShapePathModel (削除ここまで)()

Public methods

void
(削除) setAllCorners (削除ここまで)(CornerTreatment cornerTreatment)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setAllEdges (削除ここまで)(EdgeTreatment edgeTreatment)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setBottomEdge (削除ここまで)(EdgeTreatment bottomEdge)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setBottomLeftCorner (削除ここまで)(CornerTreatment bottomLeftCorner)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setBottomRightCorner (削除ここまで)(CornerTreatment bottomRightCorner)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setCornerTreatments (削除ここまで)(
CornerTreatment topLeftCorner,
CornerTreatment topRightCorner,
CornerTreatment bottomRightCorner,
CornerTreatment bottomLeftCorner
)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setEdgeTreatments (削除ここまで)(
EdgeTreatment leftEdge,
EdgeTreatment topEdge,
EdgeTreatment rightEdge,
EdgeTreatment bottomEdge
)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setLeftEdge (削除ここまで)(EdgeTreatment leftEdge)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setRightEdge (削除ここまで)(EdgeTreatment rightEdge)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setTopEdge (削除ここまで)(EdgeTreatment topEdge)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setTopLeftCorner (削除ここまで)(CornerTreatment topLeftCorner)

This method is deprecated.

Use ShapeAppearanceModel instead.

void
(削除) setTopRightCorner (削除ここまで)(CornerTreatment topRightCorner)

This method is deprecated.

Use ShapeAppearanceModel instead.

static final int

Flag representing bottom left corner of the shape.

static final int

Flag representing bottom right corner of the shape.

static final int

Flag representing top left corner of the shape.

static final int

Flag representing top right corner of the shape.

static final int
static final CornerSize

Inherited Constants

From com.google.android.material.shape.ShapeAppearanceModel
static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)()
static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)(Theme theme, int shapeAppearanceResId)

This builder only takes in a single shape appearance, no shape appearance overlay.

static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)(
Context context,
int shapeAppearanceResId,
int shapeAppearanceOverlayResId
)
static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)(
Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes
)
static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)(
Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes,
CornerSize defaultCornerSize
)
static ShapeAppearanceModel.Builder
(削除) builder (削除ここまで)(
Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes,
int defaultCornerSize
)
EdgeTreatment
(削除) getBottomEdge (削除ここまで)()

Gets the edge treatment for the bottom edge.

CornerTreatment
(削除) getBottomLeftCorner (削除ここまで)()

Gets the corner treatment for the bottom left corner.

CornerSize
(削除) getBottomLeftCornerSize (削除ここまで)()

Gets the corner size for the bottom left corner.

CornerTreatment
(削除) getBottomRightCorner (削除ここまで)()

Gets the corner treatment for the bottom right corner.

CornerSize
(削除) getBottomRightCornerSize (削除ここまで)()

Gets the corner size for the bottom right corner.

static CornerSize
(削除) getCornerSize (削除ここまで)(TypedArray a, int index, CornerSize defaultValue)
ShapeAppearanceModel
(削除) getDefaultShape (削除ここまで)()

Returns the shape as a ShapeAppearanceModel of the ShapeAppearance, or the default shape if there are multiple shapes for different states.

EdgeTreatment
(削除) getLeftEdge (削除ここまで)()

Gets the edge treatment for the left edge.

EdgeTreatment
(削除) getRightEdge (削除ここまで)()

Gets the edge treatment for the right edge.

ShapeAppearanceModel[]
(削除) getShapeAppearanceModels (削除ここまで)()

Returns a list of the ShapeAppearanceModel of all states.

ShapeAppearanceModel
(削除) getShapeForState (削除ここまで)(int[] stateSet)

Returns a ShapeAppearanceModel for the given state set.

EdgeTreatment
(削除) getTopEdge (削除ここまで)()

Gets the edge treatment for the top edge.

CornerTreatment
(削除) getTopLeftCorner (削除ここまで)()

Gets the corner treatment for the top left corner.

CornerSize
(削除) getTopLeftCornerSize (削除ここまで)()

Gets the corner size for the top left corner.

CornerTreatment
(削除) getTopRightCorner (削除ここまで)()

Gets the corner treatment for the top right corner.

CornerSize
(削除) getTopRightCornerSize (削除ここまで)()

Gets the corner size for the top right corner.

boolean
(削除) isStateful (削除ここまで)()

Whether or not the ShapeAppearance provides different shapes for states.

ShapeAppearanceModel.Builder
(削除) toBuilder (削除ここまで)()

Returns a builder with the edges and corners from this ShapeAppearanceModel

String
(削除) toString (削除ここまで)()
ShapeAppearanceModel
(削除) withCornerSize (削除ここまで)(CornerSize cornerSize)

Returns a new ShapeAppearanceModel with the same edges and corners as the default shape, but with the corner size for all corners updated.

ShapeAppearanceModel
(削除) withCornerSize (削除ここまで)(float cornerSize)

Returns a copy of this ShapeAppearanceModel with the same edges and corners, but with the corner size for all corners updated.

Inherited methods

From com.google.android.material.shape.ShapeAppearanceModel

Public constructors

ShapePathModel

public (削除) ShapePathModel (削除ここまで)()

Public methods

setAllCorners

public void (削除) setAllCorners (削除ここまで)(CornerTreatment cornerTreatment)

Set all corner treatments.

Parameters
CornerTreatment cornerTreatment

the corner treatment to use in all four corners.

setAllEdges

public void (削除) setAllEdges (削除ここまで)(EdgeTreatment edgeTreatment)

Set all edge treatments.

Parameters
EdgeTreatment edgeTreatment

the edge treatment to use for all four edges.

setBottomEdge

public void (削除) setBottomEdge (削除ここまで)(EdgeTreatment bottomEdge)

Set the edge treatment for the bottom edge.

Parameters
EdgeTreatment bottomEdge

the desired treatment.

setBottomLeftCorner

public void (削除) setBottomLeftCorner (削除ここまで)(CornerTreatment bottomLeftCorner)

Set the corner treatment for the bottom-left corner.

Parameters
CornerTreatment bottomLeftCorner

the desired treatment.

setBottomRightCorner

public void (削除) setBottomRightCorner (削除ここまで)(CornerTreatment bottomRightCorner)

Set the corner treatment for the bottom-right corner.

Parameters
CornerTreatment bottomRightCorner

the desired treatment.

setCornerTreatments

public void (削除) setCornerTreatments (削除ここまで)(
CornerTreatment topLeftCorner,
CornerTreatment topRightCorner,
CornerTreatment bottomRightCorner,
CornerTreatment bottomLeftCorner
)

Set corner treatments.

Parameters
CornerTreatment topLeftCorner

the corner treatment to use in the top-left corner.

CornerTreatment topRightCorner

the corner treatment to use in the top-right corner.

CornerTreatment bottomRightCorner

the corner treatment to use in the bottom-right corner.

CornerTreatment bottomLeftCorner

the corner treatment to use in the bottom-left corner.

setEdgeTreatments

public void (削除) setEdgeTreatments (削除ここまで)(
EdgeTreatment leftEdge,
EdgeTreatment topEdge,
EdgeTreatment rightEdge,
EdgeTreatment bottomEdge
)

Set edge treatments.

Parameters
EdgeTreatment leftEdge

the edge treatment to use on the left edge.

EdgeTreatment topEdge

the edge treatment to use on the top edge.

EdgeTreatment rightEdge

the edge treatment to use on the right edge.

EdgeTreatment bottomEdge

the edge treatment to use on the bottom edge.

setLeftEdge

public void (削除) setLeftEdge (削除ここまで)(EdgeTreatment leftEdge)

Set the edge treatment for the left edge.

Parameters
EdgeTreatment leftEdge

the desired treatment.

setRightEdge

public void (削除) setRightEdge (削除ここまで)(EdgeTreatment rightEdge)

Set the edge treatment for the right edge.

Parameters
EdgeTreatment rightEdge

the desired treatment.

setTopEdge

public void (削除) setTopEdge (削除ここまで)(EdgeTreatment topEdge)

Set the edge treatment for the top edge.

Parameters
EdgeTreatment topEdge

the desired treatment.

setTopLeftCorner

public void (削除) setTopLeftCorner (削除ここまで)(CornerTreatment topLeftCorner)

Set the corner treatment for the top-left corner.

Parameters
CornerTreatment topLeftCorner

the desired treatment.

setTopRightCorner

public void (削除) setTopRightCorner (削除ここまで)(CornerTreatment topRightCorner)

Set the corner treatment for the top-right corner.

Parameters
CornerTreatment topRightCorner

the desired treatment.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026年05月14日 UTC.