Responsive UI Bug #365

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

Projects

None yet

2 participants

@ghost
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
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
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