ResourcesScope

interface ResourcesScope : BaseResourcesScope

The receiver for KComponent methods which need to access resources and widgets like Row, Column, and Text. This class exposes the ability to access functions defined in Resources like stringRes/drawableRes etc.

Inheritors

Properties

Link copied to clipboard
open override val androidContext: Context
Link copied to clipboard
Link copied to clipboard
open override val resourceResolver: ResourceResolver
Link copied to clipboard
open val <T> TreeProp<T>.value: T

Functions

Link copied to clipboard
inline fun ResourcesScope.Column(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null): Column

Constructs a new Column without any children.

inline fun ResourcesScope.Column(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null, init: FlexboxContainerScope.() -> Unit): Column

Constructs a new Column. Add children by using FlexboxContainerScope.child or FlexboxContainerScope.children:

Link copied to clipboard
fun ResourcesScope.createColumn(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null, resolvedContainerScope: FlexboxContainerScope?): Column

Internal function to allow Column to be inlineable.

Link copied to clipboard
fun ResourcesScope.createRow(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null, resolvedContainerScope: FlexboxContainerScope?): Row

Internal function to allow Row to be inlineable.

Link copied to clipboard
fun BaseResourcesScope.drawableColor(@ColorInt color: Int): Drawable
fun BaseResourcesScope.drawableColor(@ColorInt color: Long): Drawable

Return a android.graphics.drawable.Drawable for a ColorInt value as a Drawable instance.

Link copied to clipboard
open fun getIntAttrValue(componentContext: ComponentContext, @StyleableRes id: Int, @StyleableRes attrs: IntArray, defaultValue: Int): Int

Retrieves a styled attribute value for provided {@param id}.

Link copied to clipboard
inline fun <T : Any> ResourcesScope.getTreeProp(): T?

Returns the instance registered for the type T in this hierarchy, and null if no value was registered. Tree props are registered for a sub-hierarchy via TreePropProvider or com.facebook.litho.annotations.OnCreateTreeProp in the Spec API.

Link copied to clipboard

Returns the instance registered for the type T in this hierarchy, throws if no value was registered. Tree props are registered for a sub-hierarchy via TreePropProvider or com.facebook.litho.annotations.OnCreateTreeProp in the Spec API.

Link copied to clipboard
inline fun ResourcesScope.Row(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null): Row

Constructs a new Column without any children.

inline fun ResourcesScope.Row(alignContent: YogaAlign? = null, alignItems: YogaAlign? = null, justifyContent: YogaJustify? = null, wrap: YogaWrap? = null, isReversed: Boolean = false, style: Style? = null, init: FlexboxContainerScope.() -> Unit): Row

Constructs a new Row. Add children by using FlexboxContainerScope.child or FlexboxContainerScope.children:

Link copied to clipboard
open fun Dimen.toPixels(): Int
Link copied to clipboard
inline fun ResourcesScope.Wrapper(style: Style, content: ResourcesScope.() -> Component): Wrapper

Builder function for creating Wrapper components. It's useful for adding additional Style props to a given component.