Clans / FloatingActionButton

Android Floating Action Button based on Material Design specification
Apache License 2.0
5.22k stars 1.13k forks source link

Menu hides touch events #265

Open toSilence opened 8 years ago

toSilence commented 8 years ago

Hi,

the FloatingActionMenu hides the touch events for underlying Views even if the Menu is closed.

Is there any setting to bubble up the touch events?

Any help appreciated Thx

crescent7272 commented 8 years ago

Hi I have also same problem, is there any solution?

toSilence commented 8 years ago

Hi, yes, i finally used following order:

<LinearLayout>
<android.support.design.widget.CoordinatorLayout>
<View behind FloatingActionButton>
<FloatingActionButton>
</android.support.design.widget.CoordinatorLayout>
<other stuff>
</LinearLayout>
crescent7272 commented 8 years ago

You saved my life thanks!!! For those who want to align bottom their fab menu button, can use android:layout_gravity="end|bottom" in coordinator layout.

Egorand commented 8 years ago

@toSilence I'm facing the same problem and I can't get my head around your solution. I use a ListView with FloatingActionMenu on top, all inside a CoordinatorLayout. So in your snippet, what exactly is <other stuff> - can it be a ListView? Then it will overlay the FAM, right? And why a LinearLayout? Would appreciate if you could post the actual layout you're using to solve the problem. Thanks!

toSilence commented 8 years ago

Hi, The is from my example. It could be any view. And it's maybe not needed in your case. No in my case, the will be at the bottom of the FAM (no overlay). With the LinearLayout (vertical) the will be at the bottom.

ahmadalibaloch commented 8 years ago

I don't know where to set but I think the library uses visibility constant INVISIBLE and that should be replaced with GONE look here in FloatingActionMenu.java

public void hideMenu(final boolean animate) {
        if (!isMenuHidden() && !mIsMenuButtonAnimationRunning) {
            mIsMenuButtonAnimationRunning = true;
            if (isOpened()) {
                close(animate);
                mUiHandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        if (animate) {
                            startAnimation(mMenuButtonHideAnimation);
                        }
                        setVisibility(INVISIBLE);
                        mIsMenuButtonAnimationRunning = false;
                    }
                }, mAnimationDelayPerItem * mButtonsCount);
            } else {
                if (animate) {
                    startAnimation(mMenuButtonHideAnimation);
                }
                setVisibility(INVISIBLE);
                mIsMenuButtonAnimationRunning = false;
            }
        }
    }
aviadmini commented 8 years ago

It seems that changing to android:clickable="false" worked.

ivorcho commented 8 years ago

I had the same problem and in my case it was happening because of the android:fillAfter="true" property in my hide animation xml file. After removing it worked.

alaindesigns commented 8 years ago

changing the width and height of the FloatingActionMenu to "match_parent" fixed it for me.

thair-jaber commented 7 years ago

i'm still having this issue can any one help me. i'v tried all the above solutions and no one works.

mikechoch commented 7 years ago

@thairA2Ajaber I am also having the same issue, but im using a RecyclerView and it won't allow me to scroll or click any items inside the RecyclerView. If I move the RecyclerView below my FloatingActionMenu in the XML it hides the FloatingActionMenu and then makes the RecyclerView scrollable.

How do we fix this?

ahmadalibaloch commented 7 years ago

until the problem is solved use android:clickable="false" android:fillAfter="false" like this <com.github.clans.fab.FloatingActionMenu ....... android:clickable="false" android:fillAfter="false" ....