jfeinstein10 / SlidingMenu

An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!
Apache License 2.0
11.08k stars 5.05k forks source link

Sliding Menu Locks Up Sometimes #668

Open hggz opened 10 years ago

hggz commented 10 years ago

I haven't received an exception for this issue, however sometimes when the sliding menu is revealed through a swipe gesture, the sliding menu locks up. I can't interact with it or dismiss yet I can tap the elements in the fragment activity it's attached too.

I initialize the sliding menu in the onCreateView method like this:

menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW); menu.setMenu(R.layout.menu_frame); getSupportFragmentManager() .beginTransaction() .replace(R.id.menu_frame, new MenuListFragment()) .commit();

any suggestions?

tannymanny commented 10 years ago

Same problem here. It is very easy to reproduce. Just make the drawer swipe in and out, repeatedly and quickly and it will lock up immediately.

I am stucked with library in a project and regretting the decision to use it.

It locks up the entire activity but it does not block the UI thread. SO my activity can still update its views with a UI thread, but no Touch-events gets through to any Ui elements in the activity.

Any solution would be highly appreciated.

tannymanny commented 10 years ago

Can you answer please jfeinstein10 ?????? Your library is destroying a project.

ChanningSun commented 10 years ago

It Works Well On My Machine.

slideMenu = new SlidingMenu(this);
slideMenu.setMode(SlidingMenu.RIGHT);
slideMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
slideMenu.setBehindOffsetRes(R.dimen.slide_menu_offset);
slideMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
slideMenu.setMenu(R.layout.layout_slidemenu);

and then fill it with a fragment.

FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
beginTransaction.replace(R.id.category_fragment_container, categoryFragment);
beginTransaction.add(R.id.menu_container, drawerMenuFragment).commit();
tannymanny commented 10 years ago

Yeah but try clicking on the actionbar button repeatedly to invoke the swipe gesture. If you do 2 or three swipe gestures in a second, then the ntire screen freezes.

tannymanny commented 10 years ago

try invoking the method:

SlidingFragmentActivity::toggle()

repeatedly through UI buttons and you will end up in a freeze scenario.

arshadtehrani commented 9 years ago

I had similar issue, enabling hardwareAcceleration in manifest solved it.