I'll start by being clear - I do not want to close/hide the drawer. That is trivial. I want to remove it entirely.
I have inherited a project in which we use a 'Debug Drawer' - A drawer which shows in debug builds but not in the production application. The layout is as follows. Having the ScrollView as visibility="gone"
has no effect.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout android:id="@+id/activity_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView android:id="@+id/debug_drawer"
android:visibility="gone"
android:layout_width="290dp"
android:layout_height="match_parent"
android:layout_gravity="end" />
<fragment android:id="@+id/navigation_drawer"
android:name="com.app.NavigationFragment"
android:layout_width="290dp"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
I have tried the following without success
@Override
public void setContentView(int layoutResID) {
super.setContentView(R.layout.activity_layout);
if (BuildConfig.DEBUG) {
final ViewGroup debugDrawerContainer = findById(this, R.id.debug_drawer);
debugDrawerContainer.setVisibility(View.VISIBLE);
}
}