Animations Plus

Additional

Language
Java
Version
1.0.0 (Oct 21, 2018)
Created
Aug 27, 2018
Updated
Oct 21, 2018
Owner
Mohamed Mo'men (mmoamenn)
Contributor
Mohamed Mo'men (mmoamenn)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertising

Animation Plus in Android

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

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.0.0'
 }

How to use in your application

Height animation

 HeightAnimation heightAnimation = new HeightAnimation(view , currentHight , targetHeight);
 heightAnimation.setDuration(TIME);
 view.startAnimation(heightAnimation);

Width animtion

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

Animation direction Options

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

Padding Animation

PaddingAnimation paddingAnimation = new PaddingAnimation(view, AnimationDirection.ALL, currentPadding, targetPadding);
paddingAnimation.setDuration(TIME);
view.startAnimation(paddingAnimation);

Margin Animation

MarginAnimation marginAnimation = new MarginAnimation(view, AnimationDirection.START, 100);
marginAnimation.setDuration(TIME);
view.startAnimation(marginAnimation);

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

AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(marginAnimation);
animationSet.addAnimation(paddingAnimation);
animationSet.addAnimation(sacleAnimation);
animationSet.addAnimation(transetionAnimation);
animationSet.start();