All Projects → kobakei → Materialfabspeeddial

kobakei / Materialfabspeeddial

Licence: apache-2.0
Android UI library of FAB speed dial

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Materialfabspeeddial

Jjfloatingactionbutton
Floating Action Button for iOS
Stars: ✭ 243 (+25.91%)
Mutual labels:  material-design, fab
Android Material Design For Pre Lollipop
Various UI implementations, animations & effects based on Material Design compatible with pre Lollipop devices as well. (Work in progess)
Stars: ✭ 585 (+203.11%)
Mutual labels:  material-design, fab
Quickactionview
View that shows quick actions when long pressed, inspired by Pinterest
Stars: ✭ 185 (-4.15%)
Mutual labels:  material-design, fab
React Fab Fan
Floating action button fan built with react and react-motion
Stars: ✭ 14 (-92.75%)
Mutual labels:  material-design, fab
Toolbar Button
FAB to Toolbar Button library for Android Material Collapsing Toolbar
Stars: ✭ 299 (+54.92%)
Mutual labels:  material-design, fab
Material Sheet Fab
Android library that provides the floating action button to sheet transition from Google's Material Design.
Stars: ✭ 1,584 (+720.73%)
Mutual labels:  material-design, fab
Dotsindicator
Three material Dots Indicators for view pagers in Android !
Stars: ✭ 2,447 (+1167.88%)
Mutual labels:  material-design
Lightdm Webkit Material
[PROJECT ABANDONED] A material design LightDM Webkit greeter theme
Stars: ✭ 187 (-3.11%)
Mutual labels:  material-design
Preact Mdl
💥 A collection of Preact Components that encapsulate Google's Material Design Lite.
Stars: ✭ 179 (-7.25%)
Mutual labels:  material-design
React Ui Roundup
A one-stop-shop for comparing the features of all the best React frameworks. Useful for designers and engineers alike!
Stars: ✭ 177 (-8.29%)
Mutual labels:  material-design
Vantage Ui Template
Template for UI applications in Vantage
Stars: ✭ 193 (+0%)
Mutual labels:  material-design
Materialstepperview
Steppers - Material Design Components for Android
Stars: ✭ 2,187 (+1033.16%)
Mutual labels:  material-design
Fontawesome.sharp
A library for using Font Awesome in WPF & Windows Forms applications
Stars: ✭ 185 (-4.15%)
Mutual labels:  material-design
React Material Components Web
React wrapper of Google's Material Components Web
Stars: ✭ 184 (-4.66%)
Mutual labels:  material-design
Beamermaterialdesign
Theme for Beamer inspired by Google's Material Design
Stars: ✭ 186 (-3.63%)
Mutual labels:  material-design
Materialprogressbar
Material Design ProgressBar with consistent appearance
Stars: ✭ 2,145 (+1011.4%)
Mutual labels:  material-design
Wanandroid flutter
Flutter完整项目,玩Android-Flutter版客户端。
Stars: ✭ 190 (-1.55%)
Mutual labels:  material-design
Colorsheet
A color picker bottom sheet 🌈
Stars: ✭ 179 (-7.25%)
Mutual labels:  material-design
Wanna
💡✔ Wanna is an implementation of a 21st-century to-do list app.
Stars: ✭ 189 (-2.07%)
Mutual labels:  material-design
Musiclake
MediaPlayer、Exoplayer音乐播放器,可播在线音乐,qq音乐,百度音乐,虾米音乐,网易云音乐,YouTuBe
Stars: ✭ 2,291 (+1087.05%)
Mutual labels:  material-design

MaterialFabSpeedDial

CircleCI

This project aims to provide FloatingActionButton's speed dial pattern in material design guideline.

This project is inspired by fab-speed-dial and overcomes some issues of it (ex. using private APIs of support library). This library supports landscape mode and also supports CoordinatorLayout so it works as same as FloatingActionButton when Snackbar is shown.

Download

Project build.gradle

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

App build.gradle

dependencies {
    compile 'com.github.kobakei:MaterialFabSpeedDial:LATEST_VERSION'
}

LATEST_VERSION is

You can also use snapshot version.

dependencies {
    compile 'com.github.kobakei:MaterialFabSpeedDial:master-SNAPSHOT'
}

What's new in version 2?

Version 2 is major update and has some big changes.

  • Migrate to Android X
  • Convert Java to Kotlin

If you don't want to use v2, please use 1.2.1 instead.

Getting Started

Add to layout file

You can put FabSpeedDial in your layout XML.

<io.github.kobakei.materialfabspeeddial.FabSpeedDial
    android:id="@+id/fab"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:fab_menu="@menu/fab"/>

Menu file is as below. Supported attributes of menu are id, title, icon, orderInCategory, visible, enabled. Other attributes will be ignored.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/one"
        android:title="Cut"
        android:icon="@drawable/ic_action_cut"
        android:orderInCategory="1"/>
    <item
        android:id="@+id/two"
        android:title="Copy"
        android:icon="@drawable/ic_action_copy"
        android:orderInCategory="2"/>
    <item
        android:id="@+id/three"
        android:title="Paste"
        android:icon="@drawable/ic_action_paste"
        android:orderInCategory="3"/>
</menu>

Or you can set up menu items programmatically.

val menu = FabSpeedDialMenu(this)
menu.add("One").setIcon(R.drawable.ic_action_cut)
menu.add("Two").setIcon(R.drawable.ic_action_copy)
menu.add("Three").setIcon(R.drawable.ic_action_paste)
fab.setMenu(menu)

Event listener

You can detect menu open/close event and menu item click event.

fab.addOnStateChangeListener { open ->
    // do something
}

fab.addOnMenuItemClickListener { fab, textView, itemId ->
    // do something
}

Attributes

Attribute Type Description Note
fab_menu Menu resource ID Menu
fab_fabBackgroundColor color int or ColorStateList Main FAB background color
fab_fabDrawable Drawable Main FAB drawable
fab_fabDrawableTint color int or ColorStateList Main FAB drawable tint
fab_fabRippleColor color int Main FAB ripple color
fab_fabRotationAngle float Main FAB rotation angle (degree) Default: 45.0
fab_miniFabBackgroundColor color int or ColorStateList Mini FAB background color
fab_miniFabBackgroundColorList array of color int or ColorStateList Mini FAB background color Array size must be same as menu item size
fab_miniFabDrawableTint color int or ColorStateList Mini FAB drawable tint
fab_miniFabDrawableTintList array of color int or ColorStateList Mini FAB drawable tint Array size must be same as menu item size
fab_miniFabRippleColor color int or ColorStateList Mini FAB ripple color
fab_miniFabRippleColorList array of color int or ColorStateList Mini FAB ripple color Array size must be same as menu item size
fab_miniFabTextColor color int or ColorStateList Mini FAB text color
fab_miniFabTextColorList array of color int or ColorStateList Mini FAB text color Array size must be same as menu item size
fab_miniFabTextBackground drawable Mini FAB text background
fab_miniFabTextBackgroundList drawable Mini FAB text background Array size must be same as menu item size
fab_useTouchGuard boolean Use touch guard or not
fab_touchGuardColor color int Touch guard color Default: #80000000
fab_useRippleOnPreLollipop boolean Use ripple on pre Lollipop Default: true
fab_useRevealEffect boolean Use reveal effect of touch guard Works on API level >= 21. Default: true
fab_extraMargin dimension Extra margin between FABs All FABs have padding app:useCompatPadding="true". To reduce space, set negative value.
fab_showHorizontallyOnLandscape boolean Show menu items horizontally on landscape mode Default: true

fab_miniFab***List attribute is array version of fab_miniFab***. If you want to set different values to each items, please use fab_miniFab***List instead of fab_miniFab***. Notice that size of resource array must be same as menu item size.

Known Issues

  • In Android 4.x, there is an issue about selector of vector drawable XML. If you want to use such XML, according to this StackOverflow, you need to add the following snippet in your Activity classes.
static {
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}

License

Copyright (c) 2017-present Keisuke Kobayashi

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].