Package-level declarations

Types

Link copied to clipboard
abstract class BaseRenderInfo : RenderInfo

Keeps the list item information that will allow the framework to understand how to render it.

Link copied to clipboard
interface Binder<V : ViewGroup>

This binder class is used to asynchronously layout Components given a list of Component and attaching them to a ViewGroup through the bind(ViewGroup) method.

Link copied to clipboard
class Button(text: String, style: Style? = null) : KComponent
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

LinearSmoothScroller subclass that snaps the target position to center.

Link copied to clipboard

A callback invoked when the data for a section has been dispatched to the underlying RecyclerView. This can happen after setRoot is called because the setRoot may be async, or we may wait for layouts to complete before inserting into the adapter.

Link copied to clipboard

Event sent to TextEdit to clear focus.

Link copied to clipboard
abstract class CollectionItem<V : View>(val id: Int, val viewType: Int, var renderInfo: RenderInfo)

Abstract class representing an item in a collection that can be rendered as a child view of a collection. This class provides the foundation for managing collection items with their rendering lifecycle.

Link copied to clipboard

Abstract base class for holders that manage root host views in collection items. This class serves as a foundation for view holders that need to provide access to a root view and maintain associated data for collection items.

Link copied to clipboard
class CollectionLayoutData(val layoutInfo: LayoutInfo, val collectionConstraints: SizeConstraints, val collectionSize: Size?, var items: List<CollectionItem<*>>, val isVertical: Boolean, val isDynamicSize: Boolean) : ItemSizeConstraintsProviderScope
Link copied to clipboard
class CollectionLayoutScope(val layoutInfo: LayoutInfo, val collectionConstraints: SizeConstraints, val collectionSize: Size?, val isVertical: Boolean, val wrapInMainAxis: Boolean, val crossAxisWrapMode: CrossAxisWrapMode) : ItemSizeConstraintsProviderScope
Link copied to clipboard

A value class that wraps an integer representing the orientation of a collection. This provides type safety and convenience methods for working with RecyclerView orientations.

Link copied to clipboard

This class is responsible for preparing the items in the collection. It will prepare the items that are in the viewport and the items that are in the range of the viewport.

Link copied to clipboard

RecyclerView adapter that can be used to render a list of CollectionItems. The adapter will create a PrimitiveRecyclerViewHolder for each item and will call CollectionItem.onBindView and CollectionItem.onViewRecycled on the holder when the item is bound and recycle respectively.

Link copied to clipboard

A helper class to manage scrolling behavior in the LithoRecyclerView.

Link copied to clipboard
fun interface ComponentCreator

A provider function for a Component.

Link copied to clipboard

RenderInfo that can render components.

Link copied to clipboard
@ThreadSafe
open class ComponentTreeHolder

A class used to store the data backing a RecyclerBinder. For each item the ComponentTreeHolder keeps the RenderInfo which contains the original Component and either the ComponentTree or the TreeState depending upon whether the item is within the current working range or not.

Link copied to clipboard

Pool for pre-computing and storing ComponentTrees. Can be used to pre-compute and store ComponentTrees before they are inserted in a RecyclerBinder. The RecyclerBinder will fetch the precomputed ComponentTree from the pool if it's available instead of computing a layout calculation when the item needs to be computed.

Link copied to clipboard

Interface to provide name of the model used for tracing purposes.

Link copied to clipboard
Link copied to clipboard
class EdgeSnappingSmoothScroller(context: Context, snapPreference: Int, offset: Int) : LinearSmoothScroller

LinearSmoothScroller subclass that snaps the target position to start/end or either ends.

Link copied to clipboard

Event sent by EditText when the return key is pressed or the IME signals an 'action'. Return true if the handler consumed the event.

Link copied to clipboard

EditTextStateUpdatePolicy specifies when EditText component should update its internal input state

Link copied to clipboard
class ExperimentalCard(content: Component, cardBackgroundDrawable: Drawable? = null, cardBackgroundTransitionKey: String? = null, @ColorInt cardBackgroundColor: Int = Color.WHITE, cardBackgroundColorDv: DynamicValue<Int>? = null, @ColorInt clippingColor: Int = UNSET_CLIPPING, @ColorInt shadowStartColor: Int = DEFAULT_SHADOW_START_COLOR, @ColorInt shadowEndColor: Int = DEFAULT_SHADOW_END_COLOR, cornerRadius: Float = UNSET_CORNER_RADIUS, elevation: Float = UNSET_ELEVATION, shadowTopOverride: Float = CardShadowDrawable.UNDEFINED, shadowBottomOverride: Float = CardShadowDrawable.UNDEFINED, shadowLeftOverride: Float = CardShadowDrawable.UNDEFINED, shadowRightOverride: Float = CardShadowDrawable.UNDEFINED, transparencyEnabled: Boolean = false, disableClipTopLeft: Boolean = false, disableClipTopRight: Boolean = false, disableClipBottomLeft: Boolean = false, disableClipBottomRight: Boolean = false) : KComponent

A component that renders a given component into a card border with shadow.

Link copied to clipboard
class ExperimentalCardClip(@ColorInt clippingColor: Int = Color.WHITE, cornerRadius: Float = 0.0f, disableClipTopLeft: Boolean = false, disableClipTopRight: Boolean = false, disableClipBottomLeft: Boolean = false, disableClipBottomRight: Boolean = false, style: Style? = null) : PrimitiveComponent

A component that paints rounded edges to mimic a clipping operation on the component being rendered below it. Used in CardSpec.

Link copied to clipboard
class ExperimentalCardShadow(@ColorInt shadowStartColor: Int = Color.TRANSPARENT, @ColorInt shadowEndColor: Int = Color.TRANSPARENT, cornerRadius: Float = 0.0f, shadowSize: Float = 0.0f, shadowDx: Float = CardShadowDrawable.UNDEFINED, shadowDy: Float = CardShadowDrawable.UNDEFINED, hideTopShadow: Boolean = false, hideBottomShadow: Boolean = false, shadowLeftSizeOverride: Float = CardShadowDrawable.UNDEFINED, shadowRightSizeOverride: Float = CardShadowDrawable.UNDEFINED, style: Style? = null) : PrimitiveComponent

A component that is able to render the card's shadow.

Link copied to clipboard
class ExperimentalHorizontalScroll(val child: Component, val scrollbarEnabled: Boolean = true, val horizontalFadingEdgeEnabled: Boolean = false, val fillViewport: Boolean = false, val overScrollMode: Int = View.OVER_SCROLL_IF_CONTENT_SCROLLS, val fadingEdgeLength: Dimen = 0.dp, val initialScrollPosition: Dimen = LAST_SCROLL_POSITION_UNSET.dp, val eventsController: HorizontalScrollEventsController? = null, val onScrollChangeListener: HorizontalScrollLithoView.OnScrollChangeListener? = null, val scrollStateListener: ScrollStateListener? = null, val incrementalMountEnabled: Boolean = false, val wrapContent: Boolean = false, val style: Style? = null) : PrimitiveComponent
Link copied to clipboard
class ExperimentalImage(drawable: Drawable?, scaleType: ImageView.ScaleType = ScaleType.FIT_CENTER, useIntrinsicSize: Boolean = true, style: Style? = null) : PrimitiveComponent

A component to render a Drawable.

Link copied to clipboard
class ExperimentalSolidColor(@ColorInt color: Int, alpha: Float = -1.0f, style: Style? = null) : KComponent

A component that renders a solid color.

Link copied to clipboard
class ExperimentalTextInput(initialText: CharSequence = "", hint: CharSequence = "", inputBackground: Drawable? = UNSET_DRAWABLE, shadowRadius: Float = 0.0f, shadowDx: Float = 0.0f, shadowDy: Float = 0.0f, @ColorInt shadowColor: Int = Color.GRAY, textColorStateList: ColorStateList = ColorStateList.valueOf(Color.BLACK), hintColorStateList: ColorStateList = ColorStateList.valueOf(Color.LTGRAY), @ColorInt highlightColor: Int? = null, textSize: Int = TextComponentSpec.UNSET, typeface: Typeface = Typeface.DEFAULT, textStyle: TextStyle = TextStyle.Normal, textAlignment: Int = View.TEXT_ALIGNMENT_GRAVITY, @GravityInt gravity: Int = Gravity.CENTER_VERTICAL or Gravity.START, editable: Boolean = true, cursorVisible: Boolean = true, inputType: Int = EditorInfo.TYPE_CLASS_TEXT, rawInputType: Int = EditorInfo.TYPE_NULL, imeOptions: Int = EditorInfo.IME_NULL, privateImeOptions: String? = null, inputFilters: List<@JvmSuppressWildcards InputFilter?>? = null, multiline: Boolean = false, ellipsize: TextUtils.TruncateAt? = null, minLines: Int = 1, maxLines: Int = Int.MAX_VALUE, cursorDrawableRes: Int = -1, error: CharSequence? = null, errorDrawable: Drawable? = null, keyListener: KeyListener? = null, importantForAutofill: Int = 0, autofillHints: Array<String?>? = null, disableAutofill: Boolean = false, movementMethod: MovementMethod = ArrowKeyMovementMethod.getInstance(), textWatchers: List<TextWatcher>? = null, selectionActionModeCallback: ActionMode.Callback? = null, insertionActionModeCallback: ActionMode.Callback? = null, excludeFromIncrementalMount: Boolean = false, textInputController: TextInputController? = null, onTextChanged: (EditText, String) -> Unit? = null, onTextPasted: (EditText, String) -> Unit? = null, onSelectionChanged: (Int, Int) -> Unit? = null, onInputFocusChanged: (Boolean) -> Unit? = null, onKeyUp: (KeyEvent, Int) -> Boolean? = null, onKeyPreImeEvent: (KeyEvent, Int) -> Boolean? = null, onEditorAction: (TextView, KeyEvent?, Int) -> Boolean? = null, onInputConnection: (InputConnection?, EditorInfo) -> InputConnection?? = null, style: Style? = null) : PrimitiveComponent

Component that renders an editable text input using an android EditText. It is measured based on the input text String representation.

Link copied to clipboard
class ExperimentalTransparencyEnabledCardClip(backgroundDrawable: Drawable? = null, cardBackgroundColor: Int = DEFAULT_BACKGROUND_COLOR, clippingColor: Int = DEFAULT_CLIPPING_COLOR, cornerRadius: Float = 0.0f, disableClipTopLeft: Boolean = false, disableClipTopRight: Boolean = false, disableClipBottomLeft: Boolean = false, disableClipBottomRight: Boolean = false, @ColorInt dynamicCardBackgroundColor: DynamicValue<Int>? = null, style: Style? = null) : PrimitiveComponent

A component that paints a card with rounded edges to perform a clipping operation on the component being rendered below it. Used in CardSpec when transparencyEnabled(true).

Link copied to clipboard
class ExperimentalVerticalScroll(val scrollbarEnabled: Boolean, val nestedScrollingEnabled: Boolean, val verticalFadingEdgeEnabled: Boolean, val fillViewport: Boolean, val scrollbarFadingEnabled: Boolean, val overScrollMode: Int, val fadingEdgeLength: Dimen, @ColorInt val fadingEdgeColor: Int?, val initialScrollPosition: Dimen, val eventsController: VerticalScrollEventsController?, val onScrollChange: (NestedScrollView, scrollY: Int, oldScrollY: Int) -> Unit?, val onInterceptTouch: (NestedScrollView, event: MotionEvent) -> Boolean?, val onScrollStateChange: ScrollStateListener?, val incrementalMountEnabled: Boolean = true, val child: Component, val style: Style?) : PrimitiveComponent
Link copied to clipboard

Use this with TextInput to get the field's current line count.

Link copied to clipboard

Return the beginning of the range of text to which the specified markup object is attached.

Link copied to clipboard

Use this with TextInput to get the field's current text.

Link copied to clipboard
class GridLayoutInfo(gridLayoutManager: GridLayoutManager) : LayoutInfo
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Event sent to TextEdit to make cursor invisible.

Link copied to clipboard

A controller that can be passed as com.facebook.litho.annotations.Prop to a [ ] to trigger events from outside the component hierarchy.

Link copied to clipboard
class HorizontalScrollLithoView @JvmOverloads constructor(context: Context, val renderTreeView: BaseMountingView = LithoView(context)) : HorizontalScrollView, HasLithoViewChildren

Extension of HorizontalScrollView that allows to add more features needed for HorizontalScrollSpec and ExperimentalHorizontalScroll primitive component.

Link copied to clipboard
Link copied to clipboard
object ImageSpec

A component that is able to display drawable resources. It takes a drawable resource ID as prop.

Link copied to clipboard

Event that corresponds to an underlying android.widget.EditText#onCreateInputConnection(EditorInfo editorInfo). If you handled the event, return either the input connection passed through the parameter or a Wrapper using androidx.core.view.inputmethod.InputConnectionCompat#createWrapper.

Link copied to clipboard

Event sent by EditText when the input focus changed by user

Link copied to clipboard

Creates an ItemDecoration that provides the developer a function to measure the View if the insets required depend on the measured size of the View. The measure function will use the size constraints recorded by Binder of the Recycler Component. This approach is required because the RecyclerView gets the insets from the ItemDecoration before the View is measured, so the measured size of the view is 0, and the insets would not be correct.

Link copied to clipboard

Class that provides scope and context information for item size constraint calculations in collection layouts. This class encapsulates the essential parameters needed to determine how individual items should be sized within a collection.

Link copied to clipboard

Event that corresponds to an underlying android.widget.EditText#onKeyPreIme(). If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

Link copied to clipboard

Event that corresponds to an underlying android.widget.EditText#onKeyUp(). If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

Link copied to clipboard

A Factory used to create RunnableHandlers in RecyclerBinder.

Link copied to clipboard

An implementation of this interface will provide the RecyclerBinder with all the information about the RecyclerView layout.

Link copied to clipboard

Utility class for calculating the wrapped height of given holders.

Link copied to clipboard
open class LinearLayoutInfo(linearLayoutManager: LinearLayoutManager) : LayoutInfo

An implementation for LayoutInfo to implement linear lists with a LinearLayoutManager.

Link copied to clipboard
class LithoCollectionItem(componentContext: ComponentContext, id: Int = LithoTree.generateComponentTreeId(), viewType: Int = DEFAULT_COMPONENT_VIEW_TYPE, renderInfo: RenderInfo) : CollectionItem<LithoRenderTreeView>
Link copied to clipboard
open class LithoRecyclerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) : RecyclerView, HasPostDispatchDrawListener

Extension of RecyclerView that allows to add more features needed for Recycler

Link copied to clipboard
class LithoScrollView @JvmOverloads constructor(context: Context, val renderTreeView: BaseMountingView = LithoView(context), attrs: AttributeSet? = null, defStyleAttr: Int = 0) : NestedScrollView, HasLithoViewChildren

Extension of NestedScrollView that allows to add more features needed for VerticalScrollSpec.

Link copied to clipboard
fun interface LithoViewFactory

A factory used to create LithoViews in RecyclerBinder.

Link copied to clipboard

Mountable CharSequence that is aware when the Text component using this CharSequence is mounted and unmounted.

Link copied to clipboard

Because a LayoutInfo/LayoutManager may rely on padding to generate a child measure specs, and because padding isn't accessible in a thread-safe way, this interface gives a LayoutManager the chance to record the RecyclerView's padding when it's attached.

Link copied to clipboard
Link copied to clipboard
class PrimitiveImageLayoutData(val width: Int, val height: Int, val matrix: DrawableMatrix? = null)

The layout data required by the Image Primitive to mount, and bind the drawable in the host.

Link copied to clipboard

A ViewHolder implementation for RecyclerView that manages primitive views through delegation. This class wraps a CollectionItemRootHostHolder delegate to provide RecyclerView compatibility while maintaining access to the underlying view and associated data.

Link copied to clipboard
class ProgressPrimitiveComponent(color: Int = Color.TRANSPARENT, indeterminateDrawable: Drawable? = null, style: Style? = null) : PrimitiveComponent

Renders an infinitely spinning progress bar.

Link copied to clipboard

Renders an infinitely spinning progress bar.

Link copied to clipboard
class ProgressView(context: Context) : ProgressBar
Link copied to clipboard

An event that is triggered when a pull-to-refresh action is performed.

Link copied to clipboard
Link copied to clipboard
class Recycler @JvmOverloads constructor(val binder: Binder<RecyclerView>, binderStrategy: PrimitiveRecyclerBinderStrategy? = null, 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, itemDecorations: List<RecyclerView.ItemDecoration>? = null, isHorizontalFadingEdgeEnabled: Boolean = false, isVerticalFadingEdgeEnabled: Boolean = false, isLeftFadingEnabled: Boolean = true, isRightFadingEnabled: Boolean = true, isTopFadingEnabled: Boolean = true, isBottomFadingEnabled: Boolean = true, fadingEdgeLength: Int = 0, edgeFactory: RecyclerView.EdgeEffectFactory? = null, @IdRes recyclerViewId: Int = View.NO_ID, overScrollMode: Int = View.OVER_SCROLL_ALWAYS, contentDescription: CharSequence? = null, itemAnimator: RecyclerView.ItemAnimator? = NoUpdateItemAnimator(), recyclerEventsController: RecyclerEventsController? = null, onScrollListeners: List<RecyclerView.OnScrollListener>? = null, snapHelper: SnapHelper? = null, isPullToRefreshEnabled: Boolean = true, touchInterceptor: LithoRecyclerView.TouchInterceptor? = null, onItemTouchListener: RecyclerView.OnItemTouchListener? = null, onRefresh: () -> Unit? = null, sectionsViewLogger: SectionsRecyclerView.SectionsRecyclerViewLogger? = null, excludeFromIncrementalMount: Boolean = false, paddingAdditionDisabled: Boolean = false, onBeforeLayoutListener: LithoRecyclerView.OnBeforeLayoutListener? = null, onAfterLayoutListener: LithoRecyclerView.OnAfterLayoutListener? = null, style: Style? = null) : PrimitiveComponent
Link copied to clipboard

This binder class is used to asynchronously layout Components given a list of Component and attaching them to a Recycler.

Link copied to clipboard
Link copied to clipboard

A delegation that is used to customize the adapter behaviour for the RecyclerView that the RecyclerBinder uses.

Link copied to clipboard
data class RecyclerBinderConfig(val componentsConfiguration: ComponentsConfiguration? = null, val isCircular: Boolean = false, val lithoViewFactory: LithoViewFactory? = null, val hScrollAsyncMode: Boolean = false, val requestMountForPrefetchedItems: Boolean = false, val recyclerViewItemPrefetch: Boolean = false, val itemViewCacheSize: Int = 0, val componentWarmer: ComponentWarmer? = null, val estimatedViewportCount: Int? = null, val layoutHandlerFactory: LayoutHandlerFactory? = null, val rangeRatio: Float = DEFAULT_RANGE_RATIO, val enableStableIds: Boolean? = null, val wrapContent: Boolean = false, val crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap, val paginationStrategy: Int = RecyclerBinder.PaginationStrategy.DEFAULT, val recyclingStrategy: Int = RecyclerBinder.RecyclingStrategy.DEFAULT)

This configuration is meant to be used in the context of RecyclerBinder. It allows you to define to define specific behavior changes to the default behaviour of the RecyclerBinder.

Link copied to clipboard

This builder is just a helper class for Java clients.

Link copied to clipboard
class RecyclerBinderException @JvmOverloads constructor(message: String, cause: Exception? = null) : RuntimeException
Link copied to clipboard
class RecyclerBinderOperationExecutor(recyclerBinder: RecyclerBinder, useBackgroundChangeSets: Boolean = false, onDataBound: OnDataBound? = null, onDataRendered: OnDataRendered? = null) : RecyclerBinderUpdateCallback.OperationExecutor
Link copied to clipboard

An implementation of ListUpdateCallback that generates the relevant com.facebook.litho.Components when an item is inserted/updated.

Link copied to clipboard

The ViewHolder that hosts LithoView used by RecyclerBinder

Link copied to clipboard

An controller that can be passed as com.facebook.litho.annotations.Prop to a Recycler component to trigger events from outside the component hierarchy.

Link copied to clipboard

An interface for generating traversing order for a range.

Link copied to clipboard
class RecyclerViewLayoutManagerOverrideParams(width: Int, height: Int, val widthMeasureSpec: Int, val heightMeasureSpec: Int, val isFullSpan: Boolean) : RecyclerView.LayoutParams, LayoutManagerOverrideParams
Link copied to clipboard

An event that a RecyclerBinder can trigger to notify the Recycler that it should re-measure.

Link copied to clipboard

Remove the specified object from the range of text to which it was attached.

Link copied to clipboard
interface RenderInfo
Link copied to clipboard

Holds a mapping of Views inside a Litho hierarchy to related debugging information. This is needed as a way of passing data to Views inside a Section hierarchy without relying on the specific type of view that is used. For example, while a ComponentRenderInfo will be rendered inside a LithoView always, a ViewRenderInfo could be using any type of View. This is to avoid passing debugging data through structures that could be used by developers, such as the view tag.

Link copied to clipboard
class RenderInfoViewCreatorController(val componentViewType: Int)

Helper class to keep track of the different view types that we're rendering using ViewRenderInfo.

Link copied to clipboard

Replaces the text input text from startIndex to endIndex with the given text.

Link copied to clipboard

Event sent to TextEdit to request focus.

Link copied to clipboard
class RichText(text: CharSequence, textStyle: TextStyle? = null, style: Style? = null, touchableSpanListener: TouchableSpanListener? = null, clickableSpanListener: ClickableSpanListener? = null, usePerformantTruncation: Boolean = RenderCoreConfig.usePerformantTruncation, useTruncationCaching: Boolean = RenderCoreConfig.useTruncationCaching) : PrimitiveComponent
Link copied to clipboard
fun interface ScrollStateListener

Scroll change listener invoked when the scroll position changes.

Link copied to clipboard

Utilities for sections debugging. Note: this should probably be in the sections package, but that package has a dependency on the widget package where RecyclerBinder lives.

Link copied to clipboard

Wrapper that encapsulates all the features Recycler provides such as sticky header and pull-to-refresh

Link copied to clipboard

Event sent by EditText when the selection (particular case: cursor position) gets changed by user

Link copied to clipboard

Event sent to TextEdit to send accessibility event.

Link copied to clipboard

Use this with TextInput to set the field's current selection.

Link copied to clipboard

Attach the specified markup object to the range (start, end) of the text, or move the object to that range if it was already attached elsewhere.

Link copied to clipboard

Use this with TextInput to set the field's current text.

Link copied to clipboard

Event sent to TextEdit to make cursor visible.

Link copied to clipboard
object SnapUtil

Utility class containing snapping related behavior of RecyclerView.

Link copied to clipboard
class Spinner @JvmOverloads constructor(options: List<String>, selectedOption: String, onItemSelected: (String) -> Unit, style: Style = Style, @ColorInt selectedTextColor: Int = -0x22000000, selectedTextSize: Float = -1f, caret: Drawable? = null, @LayoutRes itemLayout: Int = android.R.layout.simple_dropdown_item_1line) : KComponent

A simple spinner (dropdown) component. Derived from the standard Android android.widget.Spinner

Link copied to clipboard
Link copied to clipboard
open class StaggeredGridLayoutInfo @JvmOverloads constructor(spanCount: Int, orientation: Int, reverseLayout: Boolean, gapStrategy: Int, eagerlyClearsSpanAssignmentsOnUpdates: Boolean = false, invalidatesItemDecorationsOnUpdates: Boolean = false) : LayoutInfo

An implementation for LayoutInfo to implement staggered grids with a StaggeredGridLayoutManager.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Enumeration of text alignment values. These values differ from android.text.Layout.Alignment and View.TEXT_ALIGNMENT_* because this full list of values is not supported by either implementation.

Link copied to clipboard

Event sent by EditText when the text entered by the user changes.

Link copied to clipboard
@MountSpec(isPureRender = true, poolSize = 30, canPreallocate = true, events = [TextOffsetOnTouchEvent::class])
object TextComponentSpec

Component to render text. See text-widget for more details.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Text component should implement an event of this type in order to receive callback on what was the text offset when text was touched initially. This event is fired only when motion event action is ACTION_DOWN.

Link copied to clipboard

Event sent by EditText when the text entered is pasted from clipboard.

Link copied to clipboard
object TextSpec
Link copied to clipboard
value class TextStyle
Link copied to clipboard
Link copied to clipboard

A class that schedules a background draw of a Layout or Drawable. Drawing a Layout in the background ensures that the glyph caches are warmed up and ready for drawing the same Layout on a real Canvas. This will substantially reduce drawing times for big chunks of text. On the other hand over-using text warming might rotate the glyphs cache too quickly and diminish the optimization. Similarly, for Drawable starting on art it will be put in a texture cache of RenderNode, which will speed up drawing.

Link copied to clipboard
class TouchableFeedback(content: Component, @ColorInt color: Int = Color.WHITE, @ColorInt highlightColor: Int = Color.LTGRAY) : KComponent

A Component that can wrap another component to add touch feedback via a RippleDrawable background.

Link copied to clipboard
class TreePropsWrappedRenderInfo(renderInfo: RenderInfo?, val treePropContainer: TreePropContainer?) : RenderInfo

A wrapper around RenderInfo that also stores TreeProps used for rendering the component.

Link copied to clipboard

Enum for setting vertical gravity of a component. Currently used to design where to vertically align text in a text component.

Link copied to clipboard

A controller that can be passed as com.facebook.litho.annotations.Prop to a VerticalScrollSpec to trigger events from outside the component hierarchy.

Link copied to clipboard
Link copied to clipboard
interface ViewportInfo

An implementation of this interface will provide both the androidx.recyclerview.widget.RecyclerView's current visible views position and the total number of items in its androidx.recyclerview.widget.RecyclerView.Adapter.

Link copied to clipboard
@ThreadSafe
class ViewportManager(currentFirstVisiblePosition: Int, currentLastVisiblePosition: Int, layoutInfo: LayoutInfo)

This class will handle all viewport changes due to both scrolling and ViewHolder removal that is not related to scrolling.

Link copied to clipboard

RenderInfo that can render views.

Link copied to clipboard

Collection of the AttributeKey that are used across Litho's widgets.

Properties

Link copied to clipboard

Dummy drawable used for differentiating user-provided null background drawable from default drawable of the spec

Functions

Link copied to clipboard
fun CollectionItem<*>.areSizeConstraintsCompatible(constraints: SizeConstraints): Boolean

Checks if the provided size constraints are compatible with this CollectionItem's current size constraints and measured size.

Link copied to clipboard
fun bindLegacyAttachBinder(sectionsRecyclerView: SectionsRecyclerView, sectionsViewLogger: SectionsRecyclerView.SectionsRecyclerViewLogger?, isPullToRefreshEnabled: Boolean, onRefresh: () -> Unit?, onScrollListeners: List<RecyclerView.OnScrollListener>?, touchInterceptor: LithoRecyclerView.TouchInterceptor?, onItemTouchListener: RecyclerView.OnItemTouchListener?, snapHelper: SnapHelper?, recyclerEventsController: RecyclerEventsController?): LithoRecyclerView

Binds the sectionsRecyclerView to the data according to the behavior that was present in the initial version of the RecyclerSpec regarding the attach binders (previously RecyclerSpec.onBind).

Link copied to clipboard
fun ResourcesScope.bindLegacyMountBinder(sectionsRecyclerView: SectionsRecyclerView, contentDescription: CharSequence?, hasFixedSize: Boolean, isClipToPaddingEnabled: Boolean, paddingAdditionDisabled: Boolean, leftPadding: Int, topPadding: Int, rightPadding: Int, bottomPadding: Int, isClipChildrenEnabled: Boolean, isNestedScrollingEnabled: Boolean, scrollBarStyle: Int, isHorizontalFadingEdgeEnabled: Boolean, isVerticalFadingEdgeEnabled: Boolean, isLeftFadingEnabled: Boolean, isRightFadingEnabled: Boolean, isTopFadingEnabled: Boolean, isBottomFadingEnabled: Boolean, fadingEdgeLength: Int, @IdRes recyclerViewId: Int, overScrollMode: Int, edgeFactory: RecyclerView.EdgeEffectFactory?, @ColorInt refreshProgressBarBackgroundColor: Int?, @ColorInt refreshProgressBarColor: Int, itemAnimator: RecyclerView.ItemAnimator?): LithoRecyclerView

Binds the sectionsRecyclerView to the data according to the behavior that was present in the initial version of the RecyclerSpec regarding mount binders (previously RecyclerSpec.onMount).

Link copied to clipboard

Measures the size of the Collection.

Link copied to clipboard
fun getBackgroundOrDefault(context: Context, specifiedBackground: Drawable?): Drawable?
Link copied to clipboard

Calculates the size constraints for the child of the Recycler.

Link copied to clipboard
fun setParams(editText: EditText, hint: CharSequence?, background: Drawable?, shadowRadius: Float, shadowDx: Float, shadowDy: Float, shadowColor: Int, textColorStateList: ColorStateList?, hintColorStateList: ColorStateList?, highlightColor: Int?, textSize: Int, typeface: Typeface?, textStyle: TextStyle, textAlignment: Int, gravity: Int, editable: Boolean, cursorVisible: Boolean, inputType: Int, rawInputType: Int, keyListener: KeyListener?, imeOptions: Int, privateImeOptions: String?, inputFilters: List<InputFilter?>?, multiline: Boolean, ellipsize: TextUtils.TruncateAt?, minLines: Int, maxLines: Int, cursorDrawableRes: Int, movementMethod: MovementMethod?, text: CharSequence?, error: CharSequence?, errorDrawable: Drawable?, isForMeasure: Boolean, importantForAutofill: Int, autofillHints: Array<String?>?)
Link copied to clipboard
fun unbindLegacyAttachBinder(sectionsRecyclerView: SectionsRecyclerView, recyclerEventsController: RecyclerEventsController?, onScrollListeners: List<RecyclerView.OnScrollListener>?, onItemTouchListener: RecyclerView.OnItemTouchListener?)

Unbinds the sectionsRecyclerView to the data according to the behavior that was present in the initial version of the RecyclerSpec regarding the attach binders (previously RecyclerSpec.onUnbind).

Link copied to clipboard
fun unbindLegacyMountBinder(sectionsRecyclerView: SectionsRecyclerView, @ColorInt refreshProgressBarBackgroundColor: Int?, edgeFactory: RecyclerView.EdgeEffectFactory?, snapHelper: SnapHelper?)

Unbinds the sectionsRecyclerView to the data according to the behavior that was present in the initial version of the RecyclerSpec regarding mount binders (previously RecyclerSpec.onUnmount).