Auto Detection of State of Drawer

Is it good idea that Drawer will check its own state and same invoking function is used for opening and closing of drawer.

It is working cool with my prototype of app. 
Actually I was in need of using navigation bar button for closing and opening the drawer.

Thanks.