
Note: Normally when implementing CoordinatorLayout behaviors, we need to implement layoutDependsOn() and onDependentViewChanged(), which are used to track changes in other views contained within the CoordinatorLayout. Not that code uses old Support Library v4. See this example code for the full set of changes. If you forget to implement this last step, you will see Could not inflate Behavior subclass error messages. Design Support LibraryĪdd this to your adle file: dependencies Bring the various drawables into the drawable folders within your Android app. Note that Mac users may need to use the Unarchiver to properly unzip the icon package. Once you've selected the icon to use, download the image by selecting the icon and then "Icon Package" and choose the "Android" package. The best source for these icons is the material design icons site or the official google material icons: This means the image should be single color and fit the material design guidelines. The floating action button uses the same menu icons used for the App Bar at the top of the screen.

Note that those libraries use old Support Library and you need to follow AndroidX Migration guide in order to use them in your apps. In the past, third-party libraries such as makovkastar/FloatingActionButton and futuresimple/android-floating-action-button had to be used.

Google made available during Google I/O 2015 a support library to create floating action buttons library. More info and use cases of the FAB button from Google’s official design specs can be found here. The floating action button represents the primary action within a particular screen. They are distinguished by a circled icon floating above the UI and have special motion behaviors, related to morphing, launching, and its transferring anchor point.”įor example, if we are using an email app and we are listing the inbox folder, the promoted action might be composing a new message. Floating action buttons (or FAB) are: “A special case of promoted actions.
