CompositionSettings.Builder
class CompositionSettings.Builder
A builder for CompositionSettings instances.
Summary
Public functions |
|
|---|---|
CompositionSettings |
build()Builds the |
CompositionSettings.Builder |
setAlpha(alpha: @FloatRange(from = 0, to = 1) Float)Sets the alpha. |
CompositionSettings.Builder |
setBorderColor(borderColor: @ColorInt Int)Sets the border color. |
CompositionSettings.Builder |
setBorderWidthRatio(borderWidthRatio: @FloatRange(from = 0, to = 1) Float)Sets the border width as a normalized ratio from 0 to 1. |
CompositionSettings.Builder |
setOffset(Sets the offset. |
CompositionSettings.Builder |
setRoundedCornerRatio(Sets the rounded corner ratio as a normalized value from 0 to 1. |
CompositionSettings.Builder |
Sets the scale. |
CompositionSettings.Builder |
Sets the z-order. |
Public constructors
Public functions
build
fun build(): CompositionSettings
Builds the CompositionSettings.
| Returns | |
|---|---|
CompositionSettings |
setAlpha
fun setAlpha(alpha: @FloatRange(from = 0, to = 1) Float): CompositionSettings.Builder
Sets the alpha. 0 means fully transparent, 1 means fully opaque.
| Parameters | |
|---|---|
alpha: @FloatRange(from = 0, to = 1) Float |
alpha value. |
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setBorderColor
fun setBorderColor(borderColor: @ColorInt Int): CompositionSettings.Builder
Sets the border color.
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setBorderWidthRatio
fun setBorderWidthRatio(borderWidthRatio: @FloatRange(from = 0, to = 1) Float): CompositionSettings.Builder
Sets the border width as a normalized ratio from 0 to 1.
0 means no border. 1 means the border width equals half of the smaller dimension of the frame, which causes the borders to meet at the center and fill the smaller dimension. The ratio is relative to half of the smaller dimension of the frame, consistent with setRoundedCornerRatio.
| Parameters | |
|---|---|
borderWidthRatio: @FloatRange(from = 0, to = 1) Float |
border width ratio value. |
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setOffset
fun setOffset(
offsetX: @FloatRange(from = "-1", to = 1) Float,
offsetY: @FloatRange(from = "-1", to = 1) Float
): CompositionSettings.Builder
Sets the offset.
| Parameters | |
|---|---|
offsetX: @FloatRange(from = "-1", to = 1) Float |
offset X value. |
offsetY: @FloatRange(from = "-1", to = 1) Float |
offset Y value. |
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setRoundedCornerRatio
fun setRoundedCornerRatio(
roundedCornerRatio: @FloatRange(from = 0, to = 1) Float
): CompositionSettings.Builder
Sets the rounded corner ratio as a normalized value from 0 to 1.
0 means no rounding (sharp corners). 1 means fully rounded (the radius of the rounded corners equals half of the smaller dimension of the frame, making the frame a circle if it's square, or pill-shaped if it's rectangular). Values in between provide partial rounding proportional to half of the smaller dimension of the frame.
| Parameters | |
|---|---|
roundedCornerRatio: @FloatRange(from = 0, to = 1) Float |
rounded corner ratio value. |
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setScale
fun setScale(scaleX: Float, scaleY: Float): CompositionSettings.Builder
Sets the scale.
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |
setZOrder
fun setZOrder(zOrder: @IntRange(from = 0) Int): CompositionSettings.Builder
Sets the z-order. Larger z-order means rendered later (appears on top). Must be non-negative.
| Returns | |
|---|---|
CompositionSettings.Builder |
Builder instance. |