Skip to content

An simple & awesome animation library written in Kotlin for Android

Notifications You must be signed in to change notification settings

rommansabbir/AnimationX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release

AnimationX

An simple & awesome animation library written in Kotlin for Android

Screenshots

Success

Documentation

Installation


Step 1. Add the JitPack repository to your build file s

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

Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.rommansabbir:AnimationX:{Version}'
	}

Version available

Releases
2.0

Whats new in this version?

  • Added Animation Listener
  • Performance Improved

Usages

    /**
     * Animation can be applied to all views which extends [View]
     * Just call the extension function's according to your requirement
     * To show animation according to your requirement, call the extension function & pass the animation key
     */
     

    /**
    * To show attention animation, call [animationXAttention] & pass the animation key
    */
        imageView.animationXAttention(Attention.ATTENTION_BOUNCE, duration = 500, listener = object : Animator.AnimatorListener{
            override fun onAnimationStart(p0: Animator?) {
                TODO("Not yet implemented")
            }

            override fun onAnimationEnd(p0: Animator?) {
                TODO("Not yet implemented")
            }

            override fun onAnimationCancel(p0: Animator?) {
                TODO("Not yet implemented")
            }

            override fun onAnimationRepeat(p0: Animator?) {
                TODO("Not yet implemented")
            }

        })


    /**
    * To show bounce animation, call [animationXBounce] & pass the animation key
    */
    imageView.animationXBounce(Bounce.BOUNCE_IN)
        

    /**
    * To show fade animation, call [animationXFade] & pass the animation key
    */
    imageView.animationXFade(Fade.FADE_IN_DOWN)
    

    /**
    * To show flip animation, call [animationXFlip] & pass the animation key
    */
    imageView.animationXFlip(Flip.FLIP_IN_X)
        

    /**
    * To show rotate animation, call [animationXRotate] & pass the animation key
    */
    imageView.animationXRotate(Rotate.ROTATE_IN)


    /**
    * To show slide animation, call [animationXSlide] & pass the animation key
    */
    imageView.animationXSlide(Slide.SLIDE_IN_DOWN)


    
    /**
    * To show zoom animation, call [animationXZoom] & pass the animation key
    */
    imageView.animationXZoom(Zoom.ZOOM_IN_DOWN)
    

    /**
     * On the other hand, if you want to show animation manually
     */
     AnimationX().setDuration(2000)
     .setAnimation(Attention.bounce(imageView, AnimationX().getNewAnimatorSet())).start()

Animations

Default value for duration is 1000 Milliseconds.

Class Name
Attention Bounce Fade Flip Rotate Slide Zoom

Attention

Attention
ATTENTION_BOUNCE portfolio_view ATTENTION_FLASH portfolio_view
ATTENTION_PULSE portfolio_view ATTENTION_RUBERBAND portfolio_view
ATTENTION_SHAKE portfolio_view ATTENTION_STAND_UP portfolio_view
ATTENTION_SWING portfolio_view ATTENTION_TA_DA portfolio_view
ATTENTION_WAVE portfolio_view Wobble portfolio_view

Bounce

Bounce
BOUNCE_IN_DOWN portfolio_view BOUNCE_IN_UP portfolio_view
BOUNCE_IN_LEFT portfolio_view BOUNCE_IN_RIGHT portfolio_view
BOUNCE_IN portfolio_view

Fade

Fade
FADE_IN_DOWN portfolio_view FADE_IN_UP portfolio_view
FADE_IN_LEFT portfolio_view FADE_IN_RIGHT portfolio_view
FADE_OUT_DOWN portfolio_view FADE_OUT_UP portfolio_view
FADE_OUT_LEFT portfolio_view FADE_OUT_RIGHT portfolio_view
FADE_IN portfolio_view FADE_OUT portfolio_view

Flip

Flip
FLIP_IN_X portfolio_view FLIP_IN_Y portfolio_view
FLIP_OUT_X portfolio_view FLIP_OUT_Y portfolio_view

Rotate

Rotate
ROTATE_IN_DOWN_LEFT portfolio_view ROTATE_IN_DOWN_RIGHT portfolio_view
ROTATE_IN_UP_LEFT portfolio_view ROTATE_IN_UP_RIGHT portfolio_view
ROTATE_OUT_DOWN_LEFT portfolio_view ROTATE_OUT_DOWN_RIGHT portfolio_view
ROTATE_OUT_UP_LEFT portfolio_view ROTATE_OUT_UP_RIGHT portfolio_view
ROTATE_IN portfolio_view ROTATE_OUT portfolio_view

Slide

Slide
SLIDE_IN_DOWN portfolio_view SLIDE_IN_UP portfolio_view
SLIDE_IN_LEFT portfolio_view SLIDE_IN_RIGHT portfolio_view
SLIDE_OUT_DOWN portfolio_view SLIDE_OUT_UP portfolio_view
SLIDE_OUT_LEFT portfolio_view SLIDE_OUT_RIGHT portfolio_view

Zoom

Zoom
ZOOM_IN_DOWN portfolio_view ZOOM_IN_UP portfolio_view
ZOOM_IN_LEFT portfolio_view ZOOM_IN_RIGHT portfolio_view
ZOOM_OUT_DOWN portfolio_view ZOOM_OUT_UP portfolio_view
ZOOM_OUT_LEFT portfolio_view ZOOM_OUT_RIGHT portfolio_view
ZOOM_IN portfolio_view ZOOM_OUT portfolio_view

This library has been developed based on daimajia/AndroidViewAnimations

Contact me

Portfolio | LinkedIn | Twitter | Facebook

License


Apache Version 2.0

Copyright (C) 2020 Romman Sabbir

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.

About

An simple & awesome animation library written in Kotlin for Android

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages