Skip to content

Instantly share code, notes, and snippets.

@nosix
Last active September 15, 2016 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosix/6dbd4edc9554eaac7c9627b07f12937a to your computer and use it in GitHub Desktop.
Save nosix/6dbd4edc9554eaac7c9627b07f12937a to your computer and use it in GitHub Desktop.
FloatingActionButton for Android (SDK 24)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.anyspirit.nsetting.MainActivity">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/base_margin"
android:layout_marginEnd="@dimen/base_margin"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:src="@android:drawable/fab"
app:fabSize="normal"
app:elevation="4dp"
app:backgroundTint="@color/fab" />
<!-- app:elevation : for shadow -->
</RelativeLayout>
dependencies {
...
compile 'com.android.support:design:24.2.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment