Skip to content

Instantly share code, notes, and snippets.

@dakdroid
dakdroid / SnackbarTranslucentWorkaround.java
Last active March 23, 2016 18:06
Android's Snackbar doesn't play nice with translucent navigation. This adds a view below the Snackbar, adds a bottom margin with height = navBarHeight to the Snackbar and animates the view in before the Snackbar animates in. It animates out once the Snackbar is off the window. In action: https://plus.google.com/u/0/photos/109720416927515295704/a…
/*
1. wrap coordinator layout in Relativelayout
2. add the view
3. call makeSnackNow(...)
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">