SlidingMenu icon indicating copy to clipboard operation
SlidingMenu copied to clipboard

Sliding Menu clickable even if i didnt open it

Open Dannnyho opened this issue 10 years ago • 4 comments

I have using the jfeinstein10/SlidingMenu (All-sides branch) (https://github.com/jfeinstein10/SlidingMenu/tree/all-sides/)

Everything going well, but i can still click my menu when i enter the activity where it even didn't open yet. I think i click the behind view. Which mean i am triggling every listener in the sliding menu when it didnt open yet.

But the "bug" disappear when i open and close the sliding menu

Here is my code for setting the menu:

    setBehindContentView(R.layout.activity_main);
    getSupportFragmentManager().beginTransaction()
            .replace(R.id.menu_frame, new MenuFragment()).commit();
    getSupportFragmentManager().beginTransaction()
    .replace(R.id.cart_frame, new CartFragment()).commit();
    sm = getSlidingMenu();
    sm.setMenu(R.layout.cart_frame, SlidingMode.RIGHT);
    sm.setMenu(R.layout.menu_frame, SlidingMode.LEFT);
    sm.setBehindWidthRes(R.dimen.slidingmenu_width_right, SlidingMode.RIGHT);
    sm.setBehindWidthRes(R.dimen.slidingmenu_width_left, SlidingMode.LEFT);
    sm.setMode(SlidingMode.LEFT_RIGHT);
    sm.setShadowWidthRes(R.dimen.shadow_width);
    sm.setShadowDrawable(R.drawable.shadow);
    sm.setFadeEnabled(false);

Dannnyho avatar Feb 12 '15 01:02 Dannnyho

Have you found a solution? I am experiencing the same problem.

zaur avatar Mar 17 '15 16:03 zaur

@Dannnyho seems like I've found a workaround. allsides branch is a bit outdated. Have a look at mChildrenEnabled in CustomViewBehind, master branch, and setChildrenEnabled() calls from CustomViewAbove. https://github.com/jfeinstein10/SlidingMenu/blob/master/library%2Fsrc%2Fcom%2Fjeremyfeinstein%2Fslidingmenu%2Flib%2FCustomViewBehind.java

zaur avatar Mar 17 '15 16:03 zaur

Thanks very much.

I thought all sides branch may have some bugs too.

Do you mean, you solved it by amending the mChildrenEnabled and setChildrenEnabled??

Best, Danny

On 18 March 2015 at 03:51, Zaur Agamov [email protected] wrote:

@Dannnyho https://github.com/Dannnyho seems like I've found a workaround. allsides branch is a bit outdated. Have a look at mChildrenEnabled in CustomViewBehind, master branch, and setChildrenEnabled() calls from CustomViewAbove.

https://github.com/jfeinstein10/SlidingMenu/blob/master/library%2Fsrc%2Fcom%2Fjeremyfeinstein%2Fslidingmenu%2Flib%2FCustomViewBehind.java

— Reply to this email directly or view it on GitHub https://github.com/jfeinstein10/SlidingMenu/issues/703#issuecomment-82473526 .

Dannnyho avatar Mar 17 '15 22:03 Dannnyho

yes, I just added everything related to mChildrenEnabled to CustomViewBehind and CustomViewAbove.

zaur avatar Mar 24 '15 05:03 zaur