public class LithoView extends ComponentHost
ViewGroup
that can host the mounted state of a Component
.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 |
endBoundsAnimation()
Should be called when the animation system finishes animating the bounds of this LithoView.
|
protected void |
forceRelayout() |
ComponentContext |
getComponentContext() |
ComponentTree |
getComponentTree() |
Rect |
getPreviousMountBounds() |
boolean |
isExpectingBoundsAnimation() |
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 |
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 |
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.
|
void |
unbind()
To be called this when the LithoView is about to become inactive.
|
addView, addView, addView, addViewForTest, addViewInLayout, attachViewToParent, dispatchDraw, dispatchHoverEvent, drawableStateChanged, getChildDrawingOrder, getComponentTouchListener, getContentDescription, getContentDescriptions, getDrawables, getImageContent, getLinkedDrawableForAnimation, getTag, getTag, getTextContent, invalidate, invalidate, invalidate, jumpDrawablesToCurrentState, mount, onInterceptTouchEvent, onLayout, onTouchEvent, performAccessibilityAction, refreshAccessibilityDelegatesIfNeeded, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestLayout, setAccessibilityDelegate, setContentDescription, setImportantForAccessibility, setTag, setViewTag, setViewTags, setVisibility, unmount, verifyDrawable
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 setAnimatedHeight(int height)
NB: This method should only be called if the LithoView is expecting a bounds animation
(isExpectingBoundsAnimation()
.
public boolean isExpectingBoundsAnimation()
public void endBoundsAnimation()
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 setComponentTree(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 performIncrementalMount(Rect visibleRect, boolean processVisibilityOutputs)
public void performIncrementalMount()
public boolean isIncrementalMountEnabled()
public void release()
public Rect getPreviousMountBounds()
@Deprecated public void setDoesOwnIncrementalMount(boolean doesOwnIncrementalMount)