I have DrawerLayout setup with a drawer on either side
<FrameLayout android:id="@+id/navigation_drawer"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start" />
<FrameLayout android:id="@+id/navigation_drawer_right"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="end" />
The right drawer is populated when a certain method is run, however, before that method is run I can swipe from the right and the screen dims but nothing shows (because the layout is empty until the method has been run).
How can I disable swipe from the right until the method has been run? I've seen solutions to fully disable any swiping, but that wouldn't work for me as the left drawer needs to always work (the setup right draw function is called when a particular option is selected on the left drawer).
Or, would there be a better way to do this? Maybe dynamically adding the right FrameLayout when the function is run?
Open your phone's Settings app. Swipe up on Home button. Turn Swipe up on Home button off or on. If you turn it on, you're using 2-button navigation.
Tap the settings icon. Tap General. Scroll down to Swipe actions at the bottom of the screen. Choose whether you want to Select, Complete or Schedule a task when swiping left or right.
This disables the swipe:
mDrawerLayout = (DrawerLayout) findViewById(R.id.navigation_drawer_right);
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
And to enable swipe:
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With