Pratik
Pratik

Reputation: 1541

Sliding transition not smooth in SlidingMenu Lib Android

I am using Sliding Menu lib (link) for getting the sliding menu like Facebook app and its really very cool.
I have integrated it into my project by using following code and its working.

slidingMenu = new SlidingMenu(this);
slidingMenu.setMode(SlidingMenu.RIGHT);
slidingMenu.setShadowDrawable(R.drawable.shadowright);
slidingMenu.setShadowWidth(80);
slidingMenu.setBehindScrollScale(0);
slidingMenu.setBehindOffsetRes(R.dimen.behind_offset);
slidingMenu.setFadeDegree(0);
slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
slidingMenu.setMenu(R.layout.popupmenu);

But issue is when I click on right most button to get sliding menu It slide as I want but the transition is not smooth. It start to slide stuck for fraction of seconds and again continue to slide.

So how can I use it to slide smoothly.

Upvotes: 2

Views: 2822

Answers (3)

lamelias
lamelias

Reputation: 11

Actually ,When you want to switch ,You can use this showContent(false) or toggle(false) which will prevent the so-called smoothly scroll and transition immediately (It is so-called smoothly scroll that cause to lag ) .

Upvotes: 0

Pratik
Pratik

Reputation: 1541

I found solution for my problem.

What I did is just add
android:hardwareAccelerated="true"

in application tag in AndroidManifest.xml.

So now its sliding smoothly as I wanted.

Upvotes: 12

Thibault D.
Thibault D.

Reputation: 10004

It's possible that the view hosted in your "content" on "menu" area of the sliding menu is redrawing through the animation at a big cost. Try to "pause" its redrawings while the menu is sliding and/or optimize this redrawing.

That's, at least, the issue I had. It's likely you have the same.

Upvotes: 0

Related Questions