I have implemented a Navigation Drawer successfully using the official documentation and some tutorials. This works perfectly fine.
Now, I have added an In-App-Purchase to unlock the full functionality of my app. This extra functionality is accessed through the Navigation Drawer. I have a boolean which gets a true
or false
value in the onCreate()
of the Activity based on if the user has or not made this purchase.
So far so good.
Now, I wan't to lock the Navigation Drawer if the boolean is false
. What is a good/correct way to do this? Do I need to add if-else
blocks at all the child fragments where the Drawer is being toggled or affected? Is there any universal lock which I can conveniently use?
Update: I tried using drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
in my Activity.onCreate()
after looking at this question, but it does not work.