1

Since the last update to support library, the Navigation Drawer Appears Below Status Bar. I have tried every possible way that I can to resolve this problem, but couldn't solved it.

I solved it by using WindowTranslucentStatus, but I don't want to use as it makes the status bar too dark than primaryDark.

Any Help is Highly Appreciated!! enter image description here

Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80
Prasad Shirvandkar
  • 944
  • 1
  • 7
  • 17

2 Answers2

0

<RelativeLayout
    android:id="@+id/fragmentContainer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/aapBar"/>

<!--</RelativeLayout>

<LinearLayout
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include
        layout="@layout/tool_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <RelativeLayout
        android:id="@+id/fragmentContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/aapBar">

    </RelativeLayout>

</LinearLayout>-->


<android.support.design.widget.NavigationView
    android:id="@+id/navView"
    style="@style/NavigationTheme"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:headerLayout="@layout/navigation_header"
    app:menu="@menu/navigation_menu">

</android.support.design.widget.NavigationView>


 </android.support.v4.widget.DrawerLayout>

Design Support Library version: 'com.android.support:design:23.2.0'

With this it Works fine can you take this snip and adjust your layouts accordingly if makes sense

Haroon
  • 497
  • 4
  • 13
0

Use ActionbarDrawerToggle like this

mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
        mDrawerLayout, /* DrawerLayout object */
        R.drawable.ic_drawer, /*
                             * nav drawer icon to replace 'Up' caret
                             */
        R.string.drawer_open, /* "open drawer" description */
        R.string.drawer_close /* "close drawer" description */
        ) {

            /**
             * Called when a drawer has settled in a completely closed state.
             */
            @SuppressLint("NewApi")
            public void onDrawerClosed(View view) {
                super.onDrawerClosed(view);
                getActionBar().setTitle(mTitle);
                getActionBar().setLogo(R.drawable.logo);
            }

            /** Called when a drawer has settled in a completely open state. */
            @SuppressLint("NewApi")
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
                getActionBar().setTitle(mDrawerTitle);

            }
        };
AbhayBohra
  • 2,047
  • 24
  • 36