ComponentTreeDebugEventListener
interface ComponentTreeDebugEventListener
This is used as a listener for events that happen on the scope of a given ComponentTree. These events can be related with both the render
UI pipeline, or with the view-side events created by rendercore in the LithoView that is associated to the ComponentTree to which this listener observes.
In order to specify which events you are interested in, you should override the ComponentTreeDebugEventListener.events and list any of the events present in LithoDebugEvent or DebugEvent.
A client can attach one of these listeners during the creation of a ComponentTree:
val listener = object: ComponentTreeDebugEventListener {
override fun onEvent(debugEvent: DebugEvent) {
/* do your logging / business logic */
}
override val events = setOf(LayoutCommitted, MountItemMount)
}
val componentTree = ComponentTree.create(context, MyComponent())
.withComponentTreeDebugEventListener(listener)
.create()
val lithoView = LithoView.create(context, componentTree)
Content copied to clipboard