0

My project has two Navigation Drawers. One on the left using start and another on the right using end.

As it is suggested here push activity on the right when open drawer

I got my activity to move right whenever I am opening my drawer. But the problem is it is moving right, on the movement of both the drawers. It makes sense to move right every-time because I have only assigned it to move right whenever any drawer moves.

My question is how to detect which drawer is being moved so that I can either move it right or left based on my preference ?

Here is a Github repo of the project https://github.com/ishanatmuz/StudioHello

Community
  • 1
  • 1
Ishan
  • 3,303
  • 5
  • 29
  • 47

1 Answers1

0

Use Tags tag your drawers and in the onDrawerOpened check this tag

example:

rightDrawer.setTag("Right");

@Override
void onDrawerOpened(View view) {
if(view.getTag().toString().equals("Right"))
          //codeHere
}
Muhannad Fakhouri
  • 1,468
  • 11
  • 14