Skip to content

Instantly share code, notes, and snippets.

@andhie
Last active August 29, 2015 14:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save andhie/8ac6f7cd436e6dd5b654 to your computer and use it in GitHub Desktop.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
The FAB widget inflates a default style which is available in
/sdk/extras/android/support/design/res/values. As per Material Design
guidelines, the FAB elevation is 6dp instead of the preset 8dp value.
Other default FAB values are correct with respect to the specs.
Thus to get the correct FAB, we only need to override app:elevation.
NOTE: it is app:elevation and NOT the API 21+ android:elevation.
NOTE2 : This FAB is not assigned any icon, just a solid colorAccent FAB
-->
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:elevation="6dp" />
</FrameLayout>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/color_primary</item>
<item name="colorPrimaryDark">@color/color_primary_dark</item>
<item name="colorAccent">@color/color_accent</item>
<item name="android:windowBackground">@android:color/white</item>
</style>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment