Android Floating Action Button based on Material Design specification
Yet another implementation of Floating Action Button for Android with lots of features.
The library requires Android API Level 14+.
Watch a short Demo Video on YouTube or try it using Android simulator in the browser on Appetize.io.
Sample APK can be found in Releases section.
56dpand mini
40dpbutton sizes
FloactinActionButton
FloatingActionMenuprogrammatically
FloatinActionMenu's background
FloatingActionMenu
FloatingActionMenu's button
Add a dependency to your
build.gradle:
dependencies { compile 'com.github.clans:fab:1.6.4' }Add the
com.github.clans.fab.FloatingActionButtonto your layout XML file. ```XML
``<com.github.clans.fab.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_marginbottom="8dp" android:layout_marginright="8dp" android:src="@drawable/ic_menu" fab:fab_colornormal="@color/app_primary" fab:fab_colorpressed="@color/app_primary_pressed" fab:fab_colorripple="@color/app_ripple"></com.github.clans.fab.floatingactionbutton>
You can set an icon for the **FloatingActionButton** usingandroid:src
xml attribute. Use drawables of size24dp` as specified by guidlines. Icons of desired size can be generated with Android Asset Studio.
Here are all the FloatingActionButton's xml attributes with their default values which means that you don't have to set all of them:
XMLAll of these FloatingActionButton's attributes has their corresponding getters and setters. So you can set them programmatically.
Here are all the FloatingActionMenu's xml attributes with their default values which means that you don't have to set all of them: ```XML
If you're using custom style for labels - other labels attributes will be ignored.Labels shadow preferences depends on their corresponding FloatingActionButtons' shadow preferences.
For more usage examples check the sample project.
Changelog
Please see the Changelog page to see what's recently changed.
Credits
I used android-floating-action-button library by Jerzy Chalupski as a base for development.
License
Copyright 2015 Dmytro Tarianyk
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```