public static class Border.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Border |
build() |
Border.Builder |
color(YogaEdge edge,
int color)
Specifies a color for a specific edge
|
Border.Builder |
colorRes(YogaEdge edge,
int colorRes)
Specifies a color for a specific edge
|
Border.Builder |
cornerEffect(float radius)
Deprecated.
Please use
radiusPx(int) instead |
Border.Builder |
dashEffect(float[] intervals,
float phase)
Applies a dash effect to the border
|
Border.Builder |
discreteEffect(float segmentLength,
float deviation)
Applies a discrete effect to the border
|
Border.Builder |
pathDashEffect(Path shape,
float advance,
float phase,
PathDashPathEffect.Style style)
Applies a path dash effect to the border
|
Border.Builder |
radiusAttr(int attrId)
Specifies the border radius for all corners
|
Border.Builder |
radiusAttr(int attrId,
int defaultResId)
Specifies the border radius for all corners
|
Border.Builder |
radiusAttr(int corner,
int attrId,
int defaultResId)
Specifies the border radius for the given corner
|
Border.Builder |
radiusDip(float radius)
Specifies the border radius for all corners
|
Border.Builder |
radiusDip(int corner,
float radius)
Specifies the border radius for the given corner
|
Border.Builder |
radiusPx(int radius)
Specifies the border radius for all corners
|
Border.Builder |
radiusPx(int corner,
int radius)
Specifies the border radius for the given corner
|
Border.Builder |
radiusRes(int radiusRes)
Specifies the border radius for all corners
|
Border.Builder |
radiusRes(int corner,
int res)
Specifies the border radius for the given corner
|
Border.Builder |
widthAttr(YogaEdge edge,
int attrId)
Specifies a width for a specific edge
|
Border.Builder |
widthAttr(YogaEdge edge,
int attrId,
int defaultResId)
Specifies a width for a specific edge
|
Border.Builder |
widthDip(YogaEdge edge,
float width)
Specifies a width for a specific edge
|
Border.Builder |
widthPx(YogaEdge edge,
int width)
Specifies a width for a specific edge
|
Border.Builder |
widthRes(YogaEdge edge,
int widthRes)
Specifies a width for a specific edge
|
public Border.Builder widthPx(YogaEdge edge, int width)
Note: Having a border effect with varying widths per edge is currently not supported
edge
- The YogaEdge
that will have its width modifiedwidth
- The desired width in raw pixelspublic Border.Builder widthDip(YogaEdge edge, float width)
Note: Having a border effect with varying widths per edge is currently not supported
edge
- The YogaEdge
that will have its width modifiedwidth
- The desired width in density independent pixelspublic Border.Builder widthRes(YogaEdge edge, int widthRes)
Note: Having a border effect with varying widths per edge is currently not supported
edge
- The YogaEdge
that will have its width modifiedwidthRes
- The desired width resource to resolvepublic Border.Builder widthAttr(YogaEdge edge, int attrId)
Note: Having a border effect with varying widths per edge is currently not supported
edge
- The YogaEdge
that will have its width modifiedattrId
- The attribute to resolve a width value frompublic Border.Builder widthAttr(YogaEdge edge, int attrId, int defaultResId)
Note: Having a border effect with varying widths per edge is currently not supported
edge
- The YogaEdge
that will have its width modifiedattrId
- The attribute to resolve a width value fromdefaultResId
- Default resource value to utilize if the attribute is not setpublic Border.Builder radiusPx(int radius)
radius
- The desired border radius for all cornerspublic Border.Builder radiusDip(float radius)
radius
- The desired border radius for all cornerspublic Border.Builder radiusRes(int radiusRes)
radiusRes
- The resource id to retrieve the border radius value frompublic Border.Builder radiusAttr(int attrId)
attrId
- The attribute id to retrieve the border radius value frompublic Border.Builder radiusAttr(int attrId, int defaultResId)
attrId
- The attribute id to retrieve the border radius value fromdefaultResId
- Default resource to utilize if the attribute is not setpublic Border.Builder radiusPx(int corner, int radius)
corner
- The Border.Corner
to specify the radius ofradius
- The desired radiuspublic Border.Builder radiusDip(int corner, float radius)
corner
- The Border.Corner
to specify the radius ofradius
- The desired radiuspublic Border.Builder radiusRes(int corner, int res)
corner
- The Border.Corner
to specify the radius ofres
- The desired dimension resource to use for the radiuspublic Border.Builder radiusAttr(int corner, int attrId, int defaultResId)
corner
- The Border.Corner
to specify the radius ofattrId
- The attribute ID to retrieve the radius fromdefaultResId
- Default resource ID to use if the attribute is not setpublic Border.Builder color(YogaEdge edge, int color)
edge
- The YogaEdge
that will have its color modifiedcolor
- The raw color value to usepublic Border.Builder colorRes(YogaEdge edge, int colorRes)
edge
- The YogaEdge
that will have its color modifiedcolorRes
- The color resource to usepublic Border.Builder dashEffect(float[] intervals, float phase)
Specifying two effects will compose them where the first specified effect acts as the outer effect and the second acts as the inner path effect, e.g. outer(inner(path))
intervals
- Must be even-sized >= 2. Even indices specify "on" intervals and odd indices
specify "off" intervalsphase
- Offset into the given intervals@Deprecated public Border.Builder cornerEffect(float radius)
radiusPx(int)
insteadradius
- The amount to round sharp angles when drawing the borderpublic Border.Builder discreteEffect(float segmentLength, float deviation)
Specifying two effects will compose them where the first specified effect acts as the outer effect and the second acts as the inner path effect, e.g. outer(inner(path))
segmentLength
- Length of line segmentsdeviation
- Maximum amount of deviation. Utilized value is random in the range
[-deviation, deviation]public Border.Builder pathDashEffect(Path shape, float advance, float phase, PathDashPathEffect.Style style)
Specifying two effects will compose them where the first specified effect acts as the outer effect and the second acts as the inner path effect, e.g. outer(inner(path))
shape
- The path to stamp alongadvance
- The spacing between each stampphase
- Amount to offset before the first stampstyle
- How to transform the shape at each positionpublic Border build()