Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

FAM with setClosedOnTouchOutside only closes for singleTap, not fling events etc #248

Closed
code77se opened this issue Apr 22, 2016 · 0 comments
Milestone

Comments

@code77se
Copy link

code77se commented Apr 22, 2016

I have a RecyclerView with a FAM on top of it. If I open the menu and then do a single tap outside the menu, it closes as expected. But any other gesture is ignored, for example if I try to fling the list the nothing happens. I do not expect the fling to actually cause a RecyclerView scroll event, but I do expect the FAM to close upon any outside touch event.

My expected behavior is what's observed in e.g. Google Inbox (except that Google Inbox also dims the RecyclerView area upon expanding the FAM).

Note that I've successfully accomplished this with a manual touchlistener:

    fabMenu.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
                return fabMenu.isOpened();
            } else if (event.getAction() == MotionEvent.ACTION_UP) {
                if (fabMenu.isOpened()) {
                    fabMenu.close(fabMenu.isAnimated());
                    return true;
                }
            }

            return false;
        }
    });

Shouldn't this be the default behaviour when using setClosedOnTouchOutside?

@Clans Clans added this to the 1.6.4 milestone Apr 22, 2016
Clans pushed a commit that referenced this issue May 24, 2016
@Clans Clans closed this as completed May 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants