Skip to content

Can't implement double tap #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IlyaEremin opened this issue Sep 21, 2014 · 4 comments
Closed

Can't implement double tap #32

IlyaEremin opened this issue Sep 21, 2014 · 4 comments

Comments

@IlyaEremin
Copy link

Hello again! :)
I have FrameLayout and SwipeLayout inside it.
I implemented double tap listener with GestureDetector on my FrameLayout, but it is not work properly with SwipeLayout. Double tap event fire randomly (I tap 10 times very fast but get only 1 or 2 double tap event instead of 5). If I remove SwipeLayout from view or set it visibility to GONE - double tap work fine. My view:

<FrameLayout>
  <RelativeLayout>
    <SwipeLayout/> // 2 viewGroup inside.
  </RelativeLayout>
</FrameLayout>

And some element outside and inside RelativeLayout
My code:

class MyFrameLayout extends FrameLayout {
...
    @Override public boolean onInterceptTouchEvent(MotionEvent ev) {
        return gestureDetector.onTouchEvent(ev) && super.onInterceptTouchEvent(ev);
    }

    protected class GestureListener extends GestureDetector.SimpleOnGestureListener {

        @Override
        public boolean onDown(MotionEvent e) {
            return true;
        }

        @Override
        public boolean onDoubleTap(MotionEvent e) {
            someActions();
            return false;
        }
    }

...
}

If you need more details then feel free to ask it.

@daimajia
Copy link
Owner

Ok, I think i got the reason, I'll fix it ASAP.

@daimajia
Copy link
Owner

Hi, I released v1.1.6 this morning.
It start to support double click

Please have a try, if there is any problems, feel free to contact me.

@IlyaEremin
Copy link
Author

Work like charm, thank you for quick response!

@daimajia
Copy link
Owner

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants