MarkerEdgeTreatment
public
final
class
MarkerEdgeTreatment
extends EdgeTreatment
Draws an arrow on the edge given the radius of a circle. The arrow is drawn as two perpendicular
lines tangent to the circle. This allows the arrow to be drawn smoothly on a pill or circular
shape.
If you just want a triangle of a specific size use TriangleEdgeTreatment
instead.
Summary
Public methods |
void
|
getEdgePath(float length, float center, float interpolation, ShapePath shapePath)
Generates a ShapePath for this edge treatment.
|
Inherited methods |
From class
com.google.android.material.shape.EdgeTreatment
|
From class
java.lang.Object
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
MarkerEdgeTreatment
public MarkerEdgeTreatment (float radius)
Public methods
getEdgePath
public void getEdgePath (float length,
float center,
float interpolation,
ShapePath shapePath)
Generates a ShapePath
for this edge treatment.
EdgeTreatments have an origin of (0, 0) and a destination of (0, length) (i.e. they
represent the top edge), and are automatically rotated and scaled as necessary when applied to
other edges. Only the horizontal, top EdgeTreatment needs to be defined in order to apply it to
all four edges.
Parameters |
length |
float : the length of the edge. |
center |
float : the distance to the center of the edge. This takes into account any offset added
by the proceeding corner. Drawing anything at (center, 0) will be center aligned with the
shape. Normally you'll want to use this instead of length / 2. |
interpolation |
float : the interpolation of the edge treatment. Ranges between 0 (none) and 1
(fully) interpolated. Custom edge treatments can implement interpolation to support shape
transition between two arbitrary states. Typically, a value of 0 indicates that the custom
edge treatment is not rendered (i.e. that it is a straight line), and a value of 1
indicates that the treatment is fully rendered. Animation between these two values can
"heal" or "reveal" an edge treatment. |
shapePath |
ShapePath : the ShapePath that this treatment should write to.
|
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 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]