GithubHelp home page GithubHelp logo

irmobydick / lavafab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitvale/lavafab

0.0 1.0 0.0 643 KB

๐Ÿ’ง Android floating action button menu with "lava" animation

Kotlin 100.00%

lavafab's Introduction

LavaFab

sample

License Platform API

This is an Android project allowing to animate a Floating Action Button menu with "lava" animation.

USAGE

Just add LavaFab view in your layout XML and LavaFab library in your project via Gradle:

dependencies {
  implementation 'com.bitvale:lavafab:1.0.1'
}

XML

<com.bitvale.lavafab.LavaFab
    android:id="@+id/lava_fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:lavaBackgroundColor="@color/color_pink"
    app:lavaChild="left|top"
    app:lavaParentSize="@dimen/fab_size"
    app:lavaParentIcon="@drawable/ic_parent"
    app:lavaLeftIcon="@drawable/ic_left"
    app:lavaTopIcon="@drawable/ic_right" 
    app:lavaDrawShadow="true" />

You must use the following properties in your XML to change your LavaFab.

Properties:
  • app:lavaBackgroundColor (color) -> default ?attr/colorAccent
  • app:lavaParentSize (dimension) -> default 56dp
  • app:lavaDrawShadow (boolean) -> default false
  • app:lavaChild (flag) -> default left|top
  • app:lavaParentIcon (drawable) -> default none
  • app:lavaLeftIcon (drawable) -> default none
  • app:lavaLeftTopIcon (drawable) -> default none
  • app:lavaTopIcon (drawable) -> default none
  • app:lavaRightTopIcon (drawable) -> default none
  • app:lavaRightIcon (drawable) -> default none
  • app:lavaRightBottomIcon (drawable) -> default none
  • app:lavaBottomIcon (drawable) -> default none
  • app:lavaLeftBottomIcon (drawable) -> default none

Kotlin

with(lava_fab) {
    setLavaBackgroundResColor(R.color.fab_color)
    setParentOnClickListener { lava_fab_center.trigger() }
    setChildOnClickListener(Child.TOP) { lava_fab_center.collapse() }
    setChildOnClickListener(Child.LEFT) { // some action }
    enableShadow()
    setParentIcon(R.drawable.ic_parent)
    setChildIcon(Child.TOP, R.drawable.ic_child_top)
    setChildIcon(Child.LEFT, R.drawable.ic_child_left)
}

LICENCE

LavaFab by Alexander Kolpakov is licensed under an Apache License 2.0.

lavafab's People

Contributors

bitvale avatar

Watchers

MAY3AM avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.