Created
April 11, 2016 09:30
-
-
Save sheerazam/e745478f551b5fcd593fc909639cc173 to your computer and use it in GitHub Desktop.
Scrim Drawer Layout for Lolipop http://stackoverflow.com/questions/26440879/how-do-i-use-drawerlayout-to-display-over-the-actionbar-toolbar-and-under-the-st
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- The important thing to note here is the added fitSystemWindows --> | |
<android.support.v4.widget.DrawerLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/my_drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true" | |
> | |
<!-- Your normal content view --> | |
<FrameLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:background="@drawable/bg_splash" | |
> | |
<!-- The rest of your content view --> | |
<FrameLayout | |
android:id="@+id/main_content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
/> | |
<ImageView | |
android:id="@+id/img" | |
android:layout_width="match_parent" | |
android:layout_height="2dp" | |
android:background="@drawable/action_bar_line" | |
android:layout_marginTop="@dimen/actionbar_size" | |
/> | |
</FrameLayout> | |
<!-- Your drawer view. This can be any view, LinearLayout | |
is just an example. As we have set fitSystemWindows=true | |
this will be displayed under the status bar. --> | |
<com.itverticals.capxi.base.ScrimInsetsFrameLayout | |
android:layout_width="304dp" | |
android:layout_height="match_parent" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
app:insetForeground="#0fff" | |
android:layout_gravity="start" | |
android:fitsSystemWindows="true" | |
android:elevation="10dp" | |
> | |
<!-- Your drawer content --> | |
<FrameLayout | |
android:id="@+id/drawer_content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
/> | |
</com.itverticals.capxi.base.ScrimInsetsFrameLayout> | |
</android.support.v4.widget.DrawerLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Styles Version 21 --> | |
<item name="android:windowDrawsSystemBarBackgrounds">true</item> | |
<item name="android:statusBarColor">@android:color/transparent</item> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment