vendredi 8 mai 2015

close Navigation Drawer with no animation

I am trying to close my navigation drawer after I finish certain activities immediately, without the sliding animation. I don't close it on activity start because I would like it to stay open if the user backs out of the activity. However, I cannot get it to close without a brief flickering animation as it closes itself. I have tried variations of the following code:

protected void closeDrawerImmediate() {
    mDrawerLayout.setVisibility(View.GONE);
    mDrawerLayout.closeDrawers();
    mDrawerLayout.setX(0);
    mDrawerLayout.setVisibility(View.VISIBLE);
}

Aucun commentaire:

Enregistrer un commentaire