You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, inside my mainactivity I put a FrameLayout in which there is another layout. Inside that FramelayoutI initialized sensey while in mainactivity i set dispatchTouchEvent like this:
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
// Setup onTouchEvent for detecting type of touch gesture
//Sensey.getInstance().setupDispatchTouchEvent(event);
rightFragment.sensey.getInstance().setupDispatchTouchEvent(event);
return super.dispatchTouchEvent(event);
}
However when I touch the screen, the touch event is being recognized everywhere while it should be recognized only inside the layout in the fragment.
Can anyone please help me?
EDIT: I managed to put it the listener inside a Framelayout. Now I put 2 listeners in 2 different framelayout and I saw that both boxes are getting touch event but both touches are being registered on the same box.
Is it possible to solve this? I saw that only one instance is being created and I wanted to know if there is some way I can bypass it.
In the meanwhile I'll gonna search if there are other library that can handle multiple touch events.
Thank you
Hello,
This library works very well in activity but not getting touch detection in the fragment.
So how to implement in the fragment. And also don't get dispatchTouchEvent() method in a fragment.
The text was updated successfully, but these errors were encountered: