Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive UI Bug #365

Closed
ghost opened this issue Apr 11, 2013 · 2 comments
Closed

Responsive UI Bug #365

ghost opened this issue Apr 11, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 11, 2013

Responsive UI demo has a bug, I think this is a SlidingMenu bug.

If the Menu is showed and the orientation is changed the sliding menu retains its state, so it is showing an empty Menu view and the other two fragments on the content side.
Then If you press the back button the menu slides and the view gets corrected.

Doing this at the end of onCreate (like in switchContent):

Handler h = new Handler();
h.postDelayed(new Runnable() {
    public void run() {
        getSlidingMenu().showContent();
    }
}, 50);

Is working but not always, it seems to be some timing problem, so I assume this is not a correct solution.
I suppose this has to be corrected inside the class,
getSlidingMenu().setSlidingEnabled(false)
should slide to content if isMenuShowing is true.

@ghost
Copy link
Author

ghost commented Apr 18, 2013

Hi,
I see no one is getting on this, so I've tried by my own.
The problem was that, on a device with a sliding menu on portrait mode, and a dual view in landscape, If the menu is in "open mode" (showing) and the user flips the device to the landscape mode, the menu was showing as open even if the layout has changed to a dual mode view, so it shows an empty view in the menu, and the other two in the contents.
I think the problem is here in SlidingActivityHelper.java

new Handler().post(new Runnable() {
public void run() {
if ((open) && (mSlidingMenu.isSlidingEnabled() )) {
if (secondary) {
mSlidingMenu.showSecondaryMenu(false);
} else {
mSlidingMenu.showMenu(false);
}
} else {
mSlidingMenu.showContent(false);
}
}
});

I've added "&& (mSlidingMenu.isSlidingEnabled())" to that if sentence.
Now it works perfectly.

Please, I'm a newbie on github, can someone post a pull request for me??
Thanks!!

@Nidhee
Copy link

Nidhee commented Jan 30, 2014

@criscoso tonnes of thnks for solving this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants