Skip to content

Instantly share code, notes, and snippets.

@andhie

andhie/activity_main.xml

Last active Aug 29, 2015
Embed
What would you like to do?
<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
You can’t perform that action at this time.