Constructor and Description |
---|
ComponentHost(ComponentContext context,
AttributeSet attrs) |
ComponentHost(Context context) |
ComponentHost(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
void |
addView(View child)
Deprecated.
|
void |
addView(View child,
int index)
Deprecated.
|
void |
addView(View child,
int index,
ViewGroup.LayoutParams params)
Deprecated.
|
void |
addViewForTest(View view)
Manually adds a View as a child of this ComponentHost for the purposes of testing.
|
protected boolean |
addViewInLayout(View child,
int index,
ViewGroup.LayoutParams params,
boolean preventRequestLayout)
Deprecated.
|
protected void |
attachViewToParent(View child,
int index,
ViewGroup.LayoutParams params)
Deprecated.
|
void |
dispatchDraw(Canvas canvas) |
boolean |
dispatchHoverEvent(MotionEvent event) |
protected void |
drawableStateChanged() |
protected int |
getChildDrawingOrder(int childCount,
int i) |
boolean |
getClipChildren() |
com.facebook.litho.ComponentTouchListener |
getComponentTouchListener() |
CharSequence |
getContentDescription() |
List<CharSequence> |
getContentDescriptions() |
List<String> |
getContentNames() |
List<Drawable> |
getDrawables() |
ImageContent |
getImageContent() |
List<Drawable> |
getLinkedDrawablesForAnimation()
Returns the Drawables associated with this ComponentHost for animations, for example the
background Drawable and/or the drawable that otherwise has a transitionKey on it that has
caused it to be hosted in this ComponentHost.
|
MountItem |
getMountItemAt(int index) |
int |
getMountItemCount() |
Object |
getTag() |
Object |
getTag(int key) |
TextContent |
getTextContent() |
void |
jumpDrawablesToCurrentState() |
void |
mount(int index,
MountItem mountItem)
Mounts the given
MountItem with unique index. |
void |
mount(int index,
MountItem mountItem,
Rect bounds)
Mounts the given
MountItem with unique index. |
void |
moveItem(MountItem item,
int oldIndex,
int newIndex)
Moves the MountItem associated to oldIndex in the newIndex position.
|
boolean |
onInterceptTouchEvent(MotionEvent ev) |
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b) |
boolean |
onTouchEvent(MotionEvent event) |
boolean |
performAccessibilityAction(int action,
Bundle arguments) |
protected void |
refreshAccessibilityDelegatesIfNeeded(boolean isAccessibilityEnabled) |
void |
removeAllViewsInLayout()
Deprecated.
|
protected void |
removeDetachedView(View child,
boolean animate)
Deprecated.
|
void |
removeView(View view)
Deprecated.
|
void |
removeViewAt(int index)
Deprecated.
|
void |
removeViewInLayout(View view)
Deprecated.
|
void |
removeViews(int start,
int count)
Deprecated.
|
void |
removeViewsInLayout(int start,
int count)
Deprecated.
|
void |
requestDisallowInterceptTouchEvent(boolean disallowIntercept) |
void |
requestLayout() |
void |
setAccessibilityDelegate(View.AccessibilityDelegate accessibilityDelegate) |
void |
setClipChildren(boolean clipChildren) |
void |
setContentDescription(CharSequence contentDescription)
Host views implement their own content description handling instead of just delegating to the
underlying view framework for performance reasons as the framework sets/resets content
description very frequently on host views and the underlying accessibility notifications might
cause performance issues.
|
void |
setTag(int key,
Object tag) |
void |
setViewTag(Object viewTag)
Sets view tag on this host.
|
void |
setViewTags(<any> viewTags)
Sets view tags on this host.
|
void |
setVisibility(int visibility) |
boolean |
shouldDelayChildPressedState() |
protected boolean |
shouldRequestLayout() |
void |
unmount(int index,
MountItem mountItem)
Unmounts the given
MountItem with unique index. |
void |
unmount(MountItem item)
Unmounts the given
MountItem |
protected boolean |
verifyDrawable(Drawable who) |
public ComponentHost(Context context)
public ComponentHost(Context context, AttributeSet attrs)
public ComponentHost(ComponentContext context, AttributeSet attrs)
public void mount(int index, MountItem mountItem)
Host
MountItem
with unique index.public void mount(int index, MountItem mountItem, Rect bounds)
MountItem
with unique index.index
- index of the MountItem
. Guaranteed to be the same index as is passed for
the corresponding unmount(index, mountItem)
call.mountItem
- item to be mounted into the host.bounds
- the bounds of the item that is to be mounted into the hostpublic void unmount(MountItem item)
Host
MountItem
public void unmount(int index, MountItem mountItem)
MountItem
with unique index.public int getMountItemCount()
getMountItemCount
in class Host
MountItem
s that are currently mounted in the host.public MountItem getMountItemAt(int index)
getMountItemAt
in class Host
MountItem
that was mounted with the given index.public List<Drawable> getDrawables()
public List<String> getContentNames()
public TextContent getTextContent()
public ImageContent getImageContent()
public CharSequence getContentDescription()
public void setContentDescription(CharSequence contentDescription)
public void setTag(int key, Object tag)
public void moveItem(MountItem item, int oldIndex, int newIndex)
unmount(int, MountItem)
or moveItem(MountItem, int, int)
.public void setViewTag(Object viewTag)
viewTag
- the object to set as tag.public void setViewTags(<any> viewTags)
viewTags
- the map containing the tags by id.public boolean onInterceptTouchEvent(MotionEvent ev)
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
public com.facebook.litho.ComponentTouchListener getComponentTouchListener()
public boolean dispatchHoverEvent(MotionEvent event)
public List<CharSequence> getContentDescriptions()
public void dispatchDraw(Canvas canvas)
protected int getChildDrawingOrder(int childCount, int i)
public boolean shouldDelayChildPressedState()
public boolean onTouchEvent(MotionEvent event)
protected final void onLayout(boolean changed, int l, int t, int r, int b)
public void requestLayout()
protected boolean shouldRequestLayout()
protected boolean verifyDrawable(Drawable who)
protected void drawableStateChanged()
public void jumpDrawablesToCurrentState()
public void setVisibility(int visibility)
public Object getTag()
public Object getTag(int key)
protected void refreshAccessibilityDelegatesIfNeeded(boolean isAccessibilityEnabled)
public void setAccessibilityDelegate(View.AccessibilityDelegate accessibilityDelegate)
public void setClipChildren(boolean clipChildren)
public boolean getClipChildren()
@Deprecated public void addView(View child)
@Deprecated public void addView(View child, int index)
@Deprecated public void addView(View child, int index, ViewGroup.LayoutParams params)
@Deprecated protected boolean addViewInLayout(View child, int index, ViewGroup.LayoutParams params, boolean preventRequestLayout)
@Deprecated protected void attachViewToParent(View child, int index, ViewGroup.LayoutParams params)
@Deprecated public void removeView(View view)
@Deprecated public void removeViewInLayout(View view)
@Deprecated public void removeViewsInLayout(int start, int count)
@Deprecated public void removeViewAt(int index)
@Deprecated public void removeViews(int start, int count)
@Deprecated public void removeAllViewsInLayout()
@Deprecated protected void removeDetachedView(View child, boolean animate)
public void addViewForTest(View view)
public List<Drawable> getLinkedDrawablesForAnimation()
The core purpose of exposing these drawables is so that when animating the bounds of this ComponentHost, we also properly animate the bounds of its contained Drawables at the same time.
public boolean performAccessibilityAction(int action, Bundle arguments)