Package-level declarations

Types

Link copied to clipboard
class BorderEdge(@ColorInt val color: Int? = null, val width: Dimen? = null)

Stores properties that are used to customise border edges

Link copied to clipboard

Stores properties that are used to customise an effect that is applied to the border.

Link copied to clipboard
class BorderRadius(val all: Dimen? = null, val topLeft: Dimen? = null, val topRight: Dimen? = null, val bottomLeft: Dimen? = null, val bottomRight: Dimen? = null)

Stores properties that are used to customise the border radii

Link copied to clipboard
class ExperimentalRecycler(binder: Binder<RecyclerView>, hasFixedSize: Boolean = true, isClipToPaddingEnabled: Boolean = true, leftPadding: Int = 0, topPadding: Int = 0, rightPadding: Int = 0, bottomPadding: Int = 0, @ColorInt refreshProgressBarBackgroundColor: Int? = null, @ColorInt refreshProgressBarColor: Int = Color.BLACK, isClipChildrenEnabled: Boolean = true, isNestedScrollingEnabled: Boolean = true, scrollBarStyle: Int = View.SCROLLBARS_INSIDE_OVERLAY, itemDecoration: RecyclerView.ItemDecoration? = null, isHorizontalFadingEdgeEnabled: Boolean = false, isVerticalFadingEdgeEnabled: Boolean = false, fadingEdgeLength: Dimen = 0.dp, @IdRes recyclerViewId: Int = View.NO_ID, overScrollMode: Int = View.OVER_SCROLL_ALWAYS, contentDescription: CharSequence? = null, itemAnimator: RecyclerView.ItemAnimator = DEFAULT_ITEM_ANIMATOR, recyclerEventsController: RecyclerEventsController? = null, onScrollListeners: List<RecyclerView.OnScrollListener?> = emptyList(), snapHelper: SnapHelper? = null, isPullToRefreshEnabled: Boolean = true, touchInterceptor: LithoRecyclerView.TouchInterceptor? = null, onItemTouchListener: RecyclerView.OnItemTouchListener? = null, onRefresh: () -> Unit? = null, sectionsViewLogger: SectionsRecyclerView.SectionsRecyclerViewLogger? = null, style: Style? = null) : PrimitiveComponent

Experimental implementation of {@link RecyclerCollectionComponentSpec} that wraps a {@link ExperimentalRecycler} instead of {@link RecyclerSpec}

Functions

Link copied to clipboard
inline fun ResourcesScope.Border(edgeAll: BorderEdge? = null, edgeHorizontal: BorderEdge? = null, edgeVertical: BorderEdge? = null, edgeStart: BorderEdge? = null, edgeEnd: BorderEdge? = null, edgeTop: BorderEdge? = null, edgeBottom: BorderEdge? = null, edgeLeft: BorderEdge? = null, edgeRight: BorderEdge? = null, radius: BorderRadius? = null, effect: BorderEffect? = null): Border

Creates a border style to be applied to a component

Link copied to clipboard
inline fun ResourcesScope.Card(style: Style? = null, @ColorInt cardBackgroundColor: Int = Color.WHITE, cornerRadius: Dimen = 2.dp, elevation: Dimen = 2.dp, @ColorInt clippingColor: Int = Integer.MIN_VALUE, @ColorInt shadowStartColor: Int = 922746880, @ColorInt shadowEndColor: Int = 50331648, shadowBottomOverride: Dimen? = null, disableClipTopLeft: Boolean = false, disableClipTopRight: Boolean = false, disableClipBottomLeft: Boolean = false, disableClipBottomRight: Boolean = false, transparencyEnabled: Boolean = false, child: ResourcesScope.() -> Component): Card

Builder function for creating CardSpec components.

Link copied to clipboard
inline fun ResourcesScope.HorizontalScroll(initialScrollPosition: Dimen? = null, scrollbarEnabled: Boolean = true, wrapContent: Boolean = false, fillViewport: Boolean = false, eventsController: HorizontalScrollEventsController? = null, noinline onScrollChange: (View, scrollX: Int, oldScrollX: Int) -> Unit? = null, horizontalFadingEdgeEnabled: Boolean = false, fadingEdgeLength: Int = 0, child: ResourcesScope.() -> Component): HorizontalScroll

Builder function for creating HorizontalScrollSpec components.

Link copied to clipboard
inline fun ResourcesScope.Image(drawable: Drawable, style: Style? = null, scaleType: ImageView.ScaleType = ScaleType.FIT_CENTER): Image

Builder function for creating ImageSpec components.

Link copied to clipboard
inline fun ResourcesScope.Progress(@ColorInt color: Int? = null, style: Style? = null, indeterminateDrawable: Drawable? = null): Progress

Builder function for creating ProgressSpec components.

Link copied to clipboard
fun ResourcesScope.SizeConstraintsAwareComponent(style: Style? = null, content: ComponentScope.(SizeConstraints) -> Component): Component

Utility for creating a layout tree that depends on its own and/or its children's size.

Link copied to clipboard
inline fun ResourcesScope.SolidColor(@ColorInt color: Int, style: Style? = null): SolidColor

Builder function for creating SolidColorSpec components.

Link copied to clipboard
inline fun ResourcesScope.Spinner(options: List<String>, selectedOption: String, @LayoutRes itemLayout: Int = android.R.layout.simple_dropdown_item_1line, selectedTextSize: Dimen = 16.sp, @ColorInt selectedTextColor: Int = 0xDE000000.toInt(), caret: Drawable? = null, noinline onItemSelected: (ItemSelectedEvent) -> Unit): Spinner

Builder function for creating SpinnerSpec components.

Link copied to clipboard
inline fun ResourcesScope.Text(text: CharSequence?, style: Style? = null, @ColorInt textColor: Int = Color.BLACK, textSize: Dimen = 14.sp, textStyle: Int = NORMAL, typeface: Typeface? = DEFAULT, @ColorInt shadowColor: Int = Color.GRAY, shadowRadius: Dimen = 0.dp, shadowDx: Dimen = 0.dp, shadowDy: Dimen = 0.dp, alignment: TextAlignment = TextAlignment.TEXT_START, breakStrategy: Int = 0, verticalGravity: VerticalGravity = VerticalGravity.TOP, isSingleLine: Boolean = false, ellipsize: TextUtils.TruncateAt? = null, lineSpacingMultiplier: Float = 1.0f, lineHeight: Dimen? = null, extraSpacing: Dimen? = null, letterSpacing: Float = 0.0f, minLines: Int = 0, maxLines: Int = Int.MAX_VALUE, includeFontPadding: Boolean = true, accessibleClickableSpans: Boolean = false, clipToBounds: Boolean = true, handle: Handle? = null, customEllipsisText: CharSequence? = null, @ColorInt backgroundColor: Int? = null, @ColorInt highlightColor: Int? = null, textDirection: TextDirectionHeuristicCompat? = null, @AttrRes defStyleAttr: Int = 0, @StyleRes defStyleRes: Int = 0, dynamicTextColor: DynamicValue<Int>? = null, testKey: String? = null): Text

Temporary builder function for creating TextSpec components. In the future it will either be auto-generated or modified to have the final set of parameters.

Link copied to clipboard
inline fun ResourcesScope.TextInput(initialText: CharSequence, style: Style? = null, hint: CharSequence = "", @ColorInt textColor: Int = Color.BLACK, @ColorInt hintTextColor: Int = Color.LTGRAY, textSize: Dimen = 14.sp, typeface: Typeface = Typeface.DEFAULT, textAlignment: Int = View.TEXT_ALIGNMENT_GRAVITY, gravity: Int = Gravity.CENTER_VERTICAL or Gravity.START, editable: Boolean = true, multiline: Boolean = false, minLines: Int = 1, maxLines: Int = Int.MAX_VALUE, inputType: Int = EditorInfo.TYPE_CLASS_TEXT, imeOptions: Int = EditorInfo.IME_NULL, inputFilter: InputFilter? = null, inputFilters: List<InputFilter>? = null, noinline onTextChanged: (TextChangedEvent) -> Unit? = null, noinline onSelectionChanged: (SelectionChangedEvent) -> Unit? = null, noinline onInputFocusChanged: (InputFocusChangedEvent) -> Unit? = null, noinline onKeyUp: (KeyUpEvent) -> Boolean? = null, noinline onKeyPreIme: (KeyPreImeEvent) -> Boolean? = null, noinline onEditorAction: (EditorActionEvent) -> Boolean? = null, noinline onInputConnection: (InputConnectionEvent) -> InputConnection? = null, handle: Handle? = null, inputBackground: Drawable? = null, textWatcher: TextWatcher? = null): TextInput

Builder function for creating TextInputSpec components.

Link copied to clipboard
inline fun ResourcesScope.VerticalScroll(initialScrollPosition: Dimen = 0.px, scrollbarEnabled: Boolean = false, scrollbarFadingEnabled: Boolean = true, verticalFadingEdgeEnabled: Boolean = false, nestedScrollingEnabled: Boolean = false, fadingEdgeLength: Dimen = 0.dp, fillViewport: Boolean = false, overScrollMode: Int = View.OVER_SCROLL_IF_CONTENT_SCROLLS, eventsController: VerticalScrollEventsController? = null, noinline onScrollChange: (NestedScrollView, scrollY: Int, oldScrollY: Int) -> Unit? = null, noinline onScrollStateChange: (View, Int) -> Unit? = null, noinline onInterceptTouch: (NestedScrollView, event: MotionEvent) -> Boolean? = null, style: Style? = null, child: ResourcesScope.() -> Component): Component

Builder function for creating Vertical Scroll Primitive.