Search code examples
androidconductor

Can't show navigation drawer using conductor


I've been trying to get the DrawerLayout/NavigationView to work with conductor but can't seem to get it showing via drawerLayout.openDrawer or swiping.

Activity's onCreate:

protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);

        navigationView.setItemIconTintList(null);

        router = Conductor.attachRouter(this, content, savedInstanceState);
        if (!router.hasRootController()) {
            router.setRoot(RouterTransaction.with(new SkillDetailsController()));
        }
    }

activity_main:

<com.bluelinelabs.conductor.ChangeHandlerFrameLayout
    android:id="@android:id/content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

<android.support.design.widget.NavigationView
    android:id="@+id/main_navigation"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:headerLayout="@layout/view_main_navigation_header"
    app:menu="@menu/main_menu" />

When I remove the line containing router.setRoot(...), the nav drawer seems to work.


Solution

  • Found the answer. Using @android:id/content was confusing Conductor... I think. Changing it to a new id fixed the issue.