Harsh
Harsh

Reputation: 644

Android : Navigation Drawer List overlapping Action Bar using SystemBarTint Lib

I'm using SystemBarTint library in my application and my navigation drawer list is overlapping action bar.

Screenshot can be found here : https://i.sstatic.net/wZFVz.jpg

Please someone help me out!

Here is my layout of navigation drawer >>

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
 android:clipToPadding="false"
 >

<!-- The main content view -->

<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:layout_marginLeft="@dimen/drawer_content_padding"
    android:clipToPadding="false"
android:fitsSystemWindows="true"/>

<!-- The navigation drawer -->

<ListView
    android:id="@+id/drawer"
    android:layout_width="@dimen/drawer_size"
    android:layout_height="match_parent"
    android:layout_gravity="start"

    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp" 
    android:background="#111"
    android:clipToPadding="false"
    />

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

Upvotes: 0

Views: 1391

Answers (2)

JustADev
JustADev

Reputation: 258

I had the same issue, fixed it by wrapping my drawer activity with a "FrameLayout" These two lines must be added to the framelayout:

android:fitsSystemWindows="true"
android:clipToPadding="false"

So your layout will be like:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:clipToPadding="false">
..
..
..
<!--Your layout-->
</FrameLayout>

Upvotes: 1

joselufo
joselufo

Reputation: 3415

Remove this code in your project:

SystemBarTintManager tintManager = new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);

Upvotes: 0

Related Questions