LithoRenderTreeView
An implementation of BaseMountingView that can mount a LayoutState without the need for a ComponentTree
Properties
Hosts are guaranteed to have only one accessible component in them due to the way the view hierarchy is constructed in LayoutState. There might be other non-accessible components in the same hosts such as a background/foreground component though. This is why this method iterates over all mount items in order to find the accessible one.
Sets a focus change listener on this host.
Sets a long click listener on this host.
Sets a touch listener on this host.
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.
An EventHandler that will be invoked when ComponentHost.onInterceptTouchEvent is called.
This is a helper method to get all the text (as CharSequence) that is contained inside this ComponentHost.
Functions
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Manually adds a View as a child of this ComponentHost for the purposes of testing. This should only be used for tests as this is not safe and will likely cause weird crashes if used in a production environment.
Add view tags to this host.
Dispatch a visibility events to all the components hosted in this BaseMountingView.
When a ViewGroup gets a child with duplicateParentState=true added to it, it forever sets a flag (FLAG_NOTIFY_CHILDREN_ON_DRAWABLE_STATE_CHANGE) which makes the View crash if it ever has addStatesFromChildren set to true. We track this so we know not to recycle ComponentHosts that have had this flag set.
Invalidates the accessibility tree of this host if an AccessibilityDelegate is set and any children implement virtual views.
Moves the MountItem associated to oldIndex in the newIndex position. This happens when a LithoView needs to re-arrange the internal order of its items. If an item is already present in newIndex the item is guaranteed to be either unmounted or moved to a different index by subsequent calls to either ComponentHost.unmount or ComponentHost.moveItem.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Litho handles adding/removing views automatically using mount/unmount calls. Manually adding/ removing views will mess up Litho's bookkeeping of added views and cause weird crashes down the line.
Sets the height that the BaseMountingView should take on the next measure pass and then requests a layout. This should be called from animation-driving code on each frame to animate the size of the BaseMountingView.
Sets the width that the BaseMountingView should take on the next measure pass and then requests a layout. This should be called from animation-driving code on each frame to animate the size of the BaseMountingView.
If true, calling setVisibilityHint will delegate to setVisibilityHint and skip mounting if the visibility hint was set to false. You should not need this unless you don't have control over calling setVisibilityHint on the BaseMountingView you own.
Sets the transform pivot of a View - used for scale and rotation transforms - to be centered at the given point, expressed as a percentage of the View's width and height. The default pivot point is (50f, 50f).
Deprecated: Consider subscribing the LithoView to a LithoLifecycleOwner instead.
Marked as @Deprecated. setVisibilityHint should be used instead, which by default does not process new mount events while the visibility hint is set to false (skipMountingIfNotVisible should be set to true). This method should only be used to maintain the contract with the usages of setVisibilityHint before `skipMountingIfNotVisible` was made to default to true. All usages should be audited and migrated to setVisibilityHint.
This method is needed because if the disappearing item ended up being remounted to the root, then the index can be different than the one it was created with.
Deprecated: Consider subscribing the BaseMountingView to a LithoLifecycleOwner instead.