public class

SvgPath

extends SvgElement
java.lang.Object
   ↳ net.pierrox.lightning_launcher.script.api.svg.SvgElement
     ↳ net.pierrox.lightning_launcher.script.api.svg.SvgPath

Class Overview

SVG path (<path>).

Summary

Public Constructors
SvgPath(net.pierrox.android.lsvg.SvgPath path)
Public Methods
Paint getFillPaint()
Return the paint used to fill the path, may be null if the path is not filled.
Path getPath()
Return the android Path object, decoded from the string specification.
Paint getStrokePaint()
Return the paint used to stroke the path, may be null if the path is not stroked.
void setFillPaint(Paint fillPaint)
Update the paint used to fill the path.
boolean setPath(String d)
Update the path using the given specification
void setStrokePaint(Paint strokePaint)
Update the paint used to stroke the path.
boolean setStyle(String style)
Update the style (fill, stroke and visibility) using the given style specification
[Expand]
Inherited Methods
From class net.pierrox.lightning_launcher.script.api.svg.SvgElement
From class java.lang.Object

Public Constructors

public SvgPath (net.pierrox.android.lsvg.SvgPath path)

Public Methods

public Paint getFillPaint ()

Return the paint used to fill the path, may be null if the path is not filled. If the paint object is modified, the element need to be refreshed using invalidate()

public Path getPath ()

Return the android Path object, decoded from the string specification. If the path object is modified, the element need to be refreshed using invalidate()

public Paint getStrokePaint ()

Return the paint used to stroke the path, may be null if the path is not stroked. If the paint object is modified, the element need to be refreshed using invalidate()

public void setFillPaint (Paint fillPaint)

Update the paint used to fill the path. The paint should have been configured this way: fillPaint.setStyle(Paint.Style.FILL);

Parameters
fillPaint paint, either a new one, or the paint returned by getFillPaint()

public boolean setPath (String d)

Update the path using the given specification

Parameters
d path specification as defined here : https://svgwg.org/svg2-draft/paths.html#TheDProperty
Returns
  • true if the path specification has been parsed correctly, false if couldn't be understood

public void setStrokePaint (Paint strokePaint)

Update the paint used to stroke the path. The paint should have been configured this way: strokePaint.setStyle(Paint.Style.STROKE);

Parameters
strokePaint paint, either a new one, or the paint returned by getStrokePaint()

public boolean setStyle (String style)

Update the style (fill, stroke and visibility) using the given style specification

Parameters
style recognized elements are: fill, stroke, stroke-width, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-dasharray, stroke-dashoffset, stroke-opacity, fill-opacity, display
Returns
  • true if the style specification has been parsed correctly, false if couldn't be understood