Join us for ⁠#Android11: The Beta Launch Show on June 3!

VectorPainter

class VectorPainter : Painter
kotlin.Any
   ↳ androidx.ui.graphics.painter.Painter
   ↳ androidx.ui.graphics.vector.VectorPainter

Painter implementation that abstracts the drawing of a Vector graphic. This can be represented by either a VectorAsset or a programmatic composition of a vector

Summary

Protected methods

Boolean
applyAlpha(alpha: Float)

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

Boolean

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

Unit

Implementation of drawing logic for instances of Painter.

Inherited functions

Inherited extension functions

From androidx.ui.core
DrawModifier
Painter.asModifier(sizeToIntrinsics: Boolean = true, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Inside, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null, rtl: Boolean = false)

Create a DrawModifier from this Painter.

Properties

PxSize

Return the intrinsic size of the Painter.

Protected methods

applyAlpha

protected fun applyAlpha(alpha: Float): Boolean

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

applyColorFilter

protected fun applyColorFilter(colorFilter: ColorFilter?): Boolean

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

onDraw

protected fun CanvasScope.onDraw(): Unit

Implementation of drawing logic for instances of Painter. This is invoked internally within draw after the positioning and configuring the Painter

Properties

intrinsicSize

val intrinsicSize: PxSize

Return the intrinsic size of the Painter. If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return PxSize.UnspecifiedSize. If there is no intrinsic size in a single dimension, return PxSize with Px.Infinity in the desired dimension. If a Painter does not have an intrinsic size, it will always draw within the full bounds of the destination