Git Product home page Git Product logo

easings's Introduction

Easings for Android

API Download Android Arsenal Twitter


If you are not pleased with the native interpolators on Android. Here are 30 custom ones to make motion look more real.
This small library is a port of Robert Penner's easing equations to kotlin on Android to add flavors to your animations, and it's based on https://easings.net/.

GIF LOADING

Get the demo from GooglePlay and see the library's custom interpolators in action.
You can also experiment with the path interpolator editor to get the control points for a custom interpolator of your choice using PathInterpolatorCompat.create(x1, y1, x2, y2).

SETUP

Dependency should be declared in your app module level build.gradle file:

dependencies {

    implementation 'com.ramijemli:easings:1.0.0' 

}

HOW TO USE

This can be used exactly like the native interpolators.

ValueAnimator.ofFloat(0f,1f).apply {
    interpolator = Interpolators(Easings.SIN_IN)
    start()
}

ObjectAnimator.ofFloat(textView, "translationX", 100f).apply {
    interpolator = Interpolators(Easings.ELASTIC_IN_OUT)
    start()
}

myView.animate().apply {
    translationYBy(100f)
    interpolator = Interpolators(Easings.BOUNCE_OUT)
    start()
}
Interpolator Behavior
Sinusoidal ease in
Easings.SIN_IN
Sinusoidal ease out
Easings.SIN_OUT
Sinusoidal ease in out
Easings.SIN_IN_OUT
Quadratic ease in
Easings.QUAD_IN
Quadratic ease out
Easings.QUAD_OUT
Quadratic ease in out
Easings.QUAD_IN_OUT
Cubic ease in
Easings.CUBIC_IN
Cubic ease out
Easings.CUBIC_OUT
Cubic ease in out
Easings.CUBIC_IN_OUT
Quartic ease in
Easings.QUART_IN
Quartic ease out
Easings.QUART_OUT
Quartic ease in out
Easings.QUART_IN_OUT
Quintic ease in
Easings.QUINT_IN
Quintic ease out
Easings.QUINT_OUT
Quintic ease in out
Easings.QUINT_IN_OUT
Exponential ease in
Easings.EXP_IN
Exponential ease out
Easings.EXP_OUT
Exponential ease in out
Easings.EXP_IN_OUT
Circular ease in
Easings.CIRC_IN
Circular ease out
Easings.CIRC_OUT
Circular ease in out
Easings.CIRC_IN_OUT
Back ease in
Easings.BACK_IN
Back ease out
Easings.BACK_OUT
Back ease in out
Easings.BACK_IN_OUT
Elastic ease in
Easings.ELASTIC_IN
Elastic ease out
Easings.ELASTIC_OUT
Elastic ease in out
Easings.ELASTIC_IN_OUT
Bounce ease in
Easings.BOUNCE_IN
Bounce ease out
Easings.BOUNCE_OUT
Bounce ease in out
Easings.BOUNCE_IN_OUT

CONTRIBUTION

All bugs, feature requests, feedback, etc. are welcome. Please, feel free to create an issue.

If you have new ideas, feel free to contribute by opening pull requests on dev branch.

APPS USING IT

Are you using this library in your app? Let us know and we'll show it here.

TO DO

  • Add tension modifier for elastic easing
  • Add path interpolator editor
  • Add sample for google play

LICENSE

Copyright 2019 Rami Jemli  
  
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.  

easings's People

Watchers

James Cloos 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.