FloatingActionButton

by Clans

Android Floating Action Button based on Material Design specification

5.1K Stars 1.1K Forks Last release: over 4 years ago (v1.6.4) Apache License 2.0 154 Commits 15 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

WARNING! FURTHER DEVELOPMENT AND SUPPORT IS DISCONTINUED.

FloatingActionButton

Maven Central Android Arsenal

Yet another implementation of Floating Action Button for Android with lots of features.

Requirements

The library requires Android API Level 14+.

Demo

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.

Screenshots

Main screen Menu closed Menu default opened Menu custom opened Menu mini opened Menu right opened Menu down opened Progress background Progress no background

Features

  • Ripple effect on Android Lollipop devices
  • Option to set custom normal/pressed/ripple colors
  • Option to set custom shadow color and offsets
  • Option to disable shadow for buttons and (or) labels
  • Option to set custom animations
  • Option to set custom icon drawable
  • Support for normal
    56dp
    and mini
    40dp
    button sizes
  • Custom FloatingActionMenu icon animations
  • Option to expand menu up and down
  • Option to show labels to the left and to the right of the menu
  • Option to show circle progress on
    FloactinActionButton
  • Option to add button to the
    FloatingActionMenu
    programmatically
  • Option to dim the
    FloatinActionMenu
    's background
  • Option to remove all buttons from the
    FloatingActionMenu
  • Option to set a label for the
    FloatingActionMenu
    's button

Usage

Add a dependency to your

build.gradle
:
dependencies {
    compile 'com.github.clans:fab:1.6.4'
}
Add the
com.github.clans.fab.FloatingActionButton
to 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** using
android:src
xml attribute. Use drawables of size
24dp` as specified by guidlines. Icons of desired size can be generated with Android Asset Studio.

Floating action button

Here are all the FloatingActionButton's xml attributes with their default values which means that you don't have to set all of them:

XML

All of these FloatingActionButton's attributes has their corresponding getters and setters. So you can set them programmatically.

Floating action menu

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. ```

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.