question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SlidingMenu Toggle() lag/blinking

See original GitHub issue

Hi all!

First, thank’s for the library @jfeinstein10 , its awesome!

Im making my app on ADT with our library from the master branch… I’ve made the menu slide implementation and have some trouble with toggle() function.

Menu still lag’s just on “open” event and don’t seem smoother slide animation…

I’ve try’d switch targetsdk from 19 to 14 and minsdk to 8 but problem still…

My MainActivity:

@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_layout);

        menu = new SlidingMenu(this);        
        menu.setMode(SlidingMenu.LEFT);        
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
        menu.setShadowDrawable(R.drawable.shadow);
        menu.setShadowWidthRes(R.dimen.shadow_width);
        menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
        menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
        menu.setBehindScrollScale(0.25f);
        menu.setFadeDegree(0.25f);
        menu.setMenu(R.layout.sliding_menu); 
    });

sliding_menu.xml is one listview with one imageview (small icon) and one textview (description of menuitem), background color = #FFF

Any suggestions? Thanks!

EDIT: I’ve looked strange logs on logcat while i try to open, close and open again the menu, it seems one error on first “toggle()” event on my application, then runs normal on close toggle, and on second open event, it seems to pass 3 times on “open” event…

First Open logcat_firstopen

First Close logcat_firstclose

Second Open logcat_secondopen

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
torinnguyencommented, Jul 17, 2014

I have no idea what exactly I’m doing but I got a workaround/hack for this. In CustomViewBehind.java, around line 214, make this change

image

As said, I have no idea what I’m doing, just guessing by keeping the behind view visible all the time, we don’t need to re-build the cache or something along that line.

0reactions
mickyaruncommented, Jul 1, 2016

@torinnguyen Thanks for that fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto close sliding menu onchild click - java - Stack Overflow
I tried slidingMenu.toggle(); after .commit(); but it makes app crashing. – mascIT. Mar 19, 2014 at 9:44.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found