Skip to content

Android - Fabric - dispatch events to other react component on the scene #137

Closed Answered by zabojad
zabojad asked this question in Q&A
Discussion options

You must be logged in to vote

OK, I've fixed my problem by changing the way I get the event dispatcher I use.

I now do this:

    private fun passTouchEventToViewAndChildren(v: ViewGroup, ev: MotionEvent) {
        val childrenCount = v.childCount
        for (i in 0 until childrenCount) {
            val child = v.getChildAt(i)
            if (child.id > 0 && isViewInsideTouch(ev, child) && child.visibility == View.VISIBLE) {
                try {
                    val mmEventDispatcher = UIManagerHelper.getEventDispatcherForReactTag((context as ReactContext), child.id) ;
                    mmEventDispatcher!!.dispatchEvent(
                            TouchEvent.obtain(
                                    UIManage…

Replies: 2 comments

Comment options

zabojad
Jun 26, 2023
Collaborator Author

You must be logged in to vote
0 replies
Comment options

zabojad
Jun 26, 2023
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by cortinico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant