Coder Social home page Coder Social logo

flying-fab's Introduction

FlyingFab

License: MIT Download Kotlin

FlyingFab is a small library for animating FAB as if it is "flying", written in Kotlin.

It is created for the specific case in which an AppBarLayout containing CollapsingToolbarLayout is present alongside with the FAB.

It listens for AppBarLayout.OnOffsetChangedListener and implements FAB animation depending on its state - Collapsed, Expanded or Collapsing.

The interface is pretty simple to use. You just need to pass the AppBarLayout and the FAB after they are inflated.

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_animated_fab)
        
        FlyingFab().setup(app_bar_layout, fab_1)
        //...
}

FlyingFab includes a flexible API that allows developers to change the animation duration and TimeInterpolator for the up or/and down animations. You just need to use the methods below:

public fun interpolatorUp(interpolator: TimeInterpolator?): FlyingFab
public fun interpolatorDown(interpolator: TimeInterpolator?): FlyingFab
public fun animationDurationUp(animationDuration: Long?): FlyingFab
public fun animationDurationDown(animationDuration: Long?): FlyingFab

Download

Grab via Gradle:

compile 'bg.devlabs.flyingfab:library:<latest version>'

or Maven:

<dependency>
  <groupId>bg.devlabs.flyingfab</groupId>
  <artifactId>flying-fab</artifactId>
  <version><latest version></version>
  <type>pom</type>
</dependency> 

Samples

Code samples are available in the app module. Here's a sample video:

Sample Video

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else you can send me an email.

Author

Simona Stoyanova - @sstoyanova on GitHub, @SimonaStoyanova on Twitter

License

FlyingFab is released under the MIT License.

Disclaimer

As this animation is not recognized as a best practice I don't advice you to use it in your application.

flying-fab's People

Contributors

sstoyanova avatar

Watchers

 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.