public class LithoView extends ComponentHost
ViewGroup
that can host the mounted state of a Component
.Modifier and Type | Class and Description |
---|---|
static interface |
LithoView.LayoutManagerOverrideParams
LayoutParams that override the LayoutManager.
|
static interface |
LithoView.OnDirtyMountListener |
static interface |
LithoView.OnPostDrawListener |
Modifier and Type | Field and Description |
---|---|
static String |
SET_ALREADY_ATTACHED_COMPONENT_TREE |
static String |
ZERO_HEIGHT_LOG |
Constructor and Description |
---|
LithoView(ComponentContext context,
AttributeSet attrs) |
LithoView(Context context) |
LithoView(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
static LithoView |
create(Context context,
Component component)
|
void |
draw(Canvas canvas) |
protected void |
forceRelayout() |
ComponentContext |
getComponentContext() |
ComponentTree |
getComponentTree() |
Rect |
getPreviousMountBounds() |
boolean |
isIncrementalMountEnabled() |
void |
offsetLeftAndRight(int offset) |
void |
offsetTopAndBottom(int offset) |
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
void |
onFinishTemporaryDetach() |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onStartTemporaryDetach() |
void |
performIncrementalMount() |
void |
performIncrementalMount(Rect visibleRect,
boolean processVisibilityOutputs) |
protected void |
performLayout(boolean changed,
int left,
int top,
int right,
int bottom) |
void |
rebind() |
void |
release() |
void |
setAnimatedHeight(int height)
Sets the height that the LithoView should take on the next measure pass and then requests a
layout.
|
void |
setAnimatedWidth(int width)
Sets the width that the LithoView should take on the next measure pass and then requests a
layout.
|
void |
setComponent(Component component)
Change the root component synchronously.
|
void |
setComponentAsync(Component component)
Change the root component measuring it on a background thread before updating the UI.
|
void |
setComponentTree(ComponentTree componentTree) |
void |
setDoesOwnIncrementalMount(boolean doesOwnIncrementalMount)
Deprecated.
|
void |
setHasTransientState(boolean hasTransientState) |
void |
setInvalidStateLogParamsList(List<ComponentLogParams> logParamsList)
Register for particular invalid state logs.
|
void |
setOnDirtyMountListener(LithoView.OnDirtyMountListener onDirtyMountListener) |
void |
setOnPostDrawListener(LithoView.OnPostDrawListener onPostDrawListener) |
void |
setTranslationX(float translationX) |
void |
setTranslationY(float translationY) |
protected boolean |
shouldAlwaysLayoutChildren()
Indicates if the children of this view should be laid regardless to a mount step being
triggered on layout.
|
protected boolean |
shouldRequestLayout() |
void |
startTemporaryDetach() |
void |
suppressMeasureComponentTree(boolean suppress)
If set to true, the onMeasure(..) call won't measure the ComponentTree with the given
measure specs, but it will just use them as measured dimensions.
|
String |
toString() |
void |
unbind()
To be called this when the LithoView is about to become inactive.
|
void |
unmountAllItems() |
addView, addView, addView, addViewForTest, addViewInLayout, attachViewToParent, dispatchDraw, dispatchHoverEvent, drawableStateChanged, getChildDrawingOrder, getComponentTouchListener, getContentDescription, getContentDescriptions, getDrawables, getImageContent, getLinkedDrawablesForAnimation, getTag, getTag, getTextContent, hasOverlappingRendering, invalidate, invalidate, invalidate, jumpDrawablesToCurrentState, mount, onInterceptTouchEvent, onLayout, onTouchEvent, performAccessibilityAction, refreshAccessibilityDelegatesIfNeeded, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestLayout, setAccessibilityDelegate, setContentDescription, setTag, setViewTag, setViewTags, setVisibility, unmount, verifyDrawable
public static final String ZERO_HEIGHT_LOG
public static final String SET_ALREADY_ATTACHED_COMPONENT_TREE
public LithoView(Context context)
public LithoView(Context context, AttributeSet attrs)
public LithoView(ComponentContext context, AttributeSet attrs)
protected void forceRelayout()
public void startTemporaryDetach()
protected void onAttachedToWindow()
protected void onDetachedFromWindow()
public void onStartTemporaryDetach()
public void onFinishTemporaryDetach()
public void suppressMeasureComponentTree(boolean suppress)
public void setAnimatedWidth(int width)
public void setAnimatedHeight(int height)
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
protected void performLayout(boolean changed, int left, int top, int right, int bottom)
protected boolean shouldAlwaysLayoutChildren()
public ComponentContext getComponentContext()
ComponentContext
associated with this LithoView. It's a wrapper on the
Context
originally used to create this LithoView itself.protected boolean shouldRequestLayout()
shouldRequestLayout
in class ComponentHost
@Nullable public ComponentTree getComponentTree()
public void setOnDirtyMountListener(LithoView.OnDirtyMountListener onDirtyMountListener)
public void setOnPostDrawListener(@Nullable LithoView.OnPostDrawListener onPostDrawListener)
public void setComponentTree(@Nullable ComponentTree componentTree)
public void setComponent(Component component)
public void setComponentAsync(Component component)
LithoView
doesn't have a ComponentTree initialized, the root will be
computed synchronously.public void rebind()
public void unbind()
public void setHasTransientState(boolean hasTransientState)
public void offsetTopAndBottom(int offset)
public void offsetLeftAndRight(int offset)
public void setTranslationX(float translationX)
public void setTranslationY(float translationY)
public void draw(Canvas canvas)
public void performIncrementalMount(Rect visibleRect, boolean processVisibilityOutputs)
public void performIncrementalMount()
public boolean isIncrementalMountEnabled()
public void release()
public void unmountAllItems()
public Rect getPreviousMountBounds()
@Deprecated public void setDoesOwnIncrementalMount(boolean doesOwnIncrementalMount)
public void setInvalidStateLogParamsList(@Nullable List<ComponentLogParams> logParamsList)
public String toString()