基于 Material Design 规范的 Android 浮动动作按钮
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.
56dp and mini 40dp button sizesFloactinActionButtonFloatingActionMenu programmaticallyFloatinActionMenu's backgroundFloatingActionMenuFloatingActionMenu's buttonAdd 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.
…
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.
Here are all the FloatingActionButton's xml attributes with their default values which means that you don't have to set all of them:
…
All 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:
…
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.
Please see the Changelog page to see what's recently changed.
I used android-floating-action-button library by Jerzy Chalupski as a base for development.
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.
暂无开放 Issues,或尚未同步最近议题。