Skip to content

A lightweight android library that provides extra native animations like margin, padding, height and width animations

License

Notifications You must be signed in to change notification settings

mmoamenn/AnimationsPlus

Repository files navigation

Animation Plus in Android

A lightweight Android library that provides extra native animations like margin, padding, height and weight animations.

what's new in 1.1.0

Support AndroidX and kotlin tutorials.

Note

Last version before support AndroidX com.github.mmoamenn:AnimationsPlus:1.0.0

Installing

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

	dependencies {
		compile 'com.github.mmoamenn:AnimationsPlus:1.1.0'
	}

How to use in your application

Height animation

Height animation

val heightAnimation = HeightAnimation(view, currentHight, targetHeight)
heightAnimation.duration = TIME
view.startAnimation(heightAnimation)

Width animtion

Height animation

val heightAnimation = WidthAnimation(view, currentWidth, targetWidth)
widthAnimation.setDuration(TIME)
view.startAnimation(heightAnimation)

Animation direction Options

enum class AnimationDirection {
    START, END, TOP, BOTTOM, ALL
}

Padding Animation

Height animation

val heightAnimation = HeightAnimation(view, currentHight, targetHeight)
heightAnimation.duration = TIME
view.startAnimation(heightAnimation)

Margin Animation

Height animation

val marginAnimation = MarginAnimation(view, AnimationDirection.START, 100)
marginAnimation.duration = TIME
view.startAnimation(marginAnimation)

You can add above animations to any animation set and deal with them like any native animation

val animationSet = AnimationSet(true).apply {
    addAnimation(marginAnimation)
    addAnimation(paddingAnimation)
    addAnimation(sacleAnimation)
    addAnimation(transetionAnimation)
}
animationSet.start()

About

A lightweight android library that provides extra native animations like margin, padding, height and width animations

Resources

License

Stars

Watchers

Forks

Packages

No packages published