/ Animations

A library for auto setting and scaling animate for views

A library for auto setting and scaling animate for views

ScalingAnimationDroid

ScalingAnimationDroid It's a library for auto setting and scaling animate for views.

ScalingAnimationDroid

Getting Started

Installation Gradle:

Add the following to your project level build.gradle:

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

Add this to your app build.gradle:

dependencies {
    implementation 'com.github.annchar:ScalingAnimationDroid:1.0.0'
}

Usage

ScalingAnimationDroid is really easy to use. The library gives to your Views a beautiful touch effect.

Kotlin

Some of material widgets needs to be casted to View, otherwise it will show Type mismatch warning.

  ScalingAnimationDroid(textview_title) // Use attributes by default
  ScalingAnimationDroid(button_search) // Use attributes by default
  
  // Custom Attributes
  ScalingAnimationDroid(card_view1).apply {
            setScalingAnimationType(ScalingAnimationType.SCALING_IN)
            setDurationActionDown(400)
            setDurationActionUp(400)
            setScalingPadding(0.8f)
  }
  
  // OR
  val animateView = ScalingAnimationDroid(card_view1)
  animateView.setScalingAnimationType(ScalingAnimationType.SCALING_IN)
  animateView.setDurationActionDown(400)
  animateView.setDurationActionUp(400)
  animateView.setScalingPadding(0.8f)

JAVA

After views are binded simply pass the name of widget to ScalingAnimationDroid constructor.

  new ScalingAnimationDroid(textview_title); // Use attributes by default
  new ScalingAnimationDroid(button_search); // Use attributes by default
  
  // Custom Attributes
  ScalingAnimationDroid animateView = new ScalingAnimationDroid(card_view1);
  animateView.setScalingAnimationType(ScalingAnimationType.SCALING_IN);
  animateView.setDurationActionDown(400);
  animateView.setDurationActionUp(400);
  animateView.setScalingPadding(0.8f);

Config Attributes

Attribute Description Default
Scaling animation type (ScalingAnimationType) The type of animation. ScalingAnimationType.SCALING_IN
Duration action down (Int) Time to control animate for your touch. 400 (milliseconds)
Duration action up (Int) Time to control animate for move on. 400 (milliseconds)
Scaling padding (Float) Alpha degree value between 0.0f and 1.0f 0.8f
  • ScalingAnimationType

    • This is ScalingAnimationType.SCALING_IN

ScalingAnimationType_In

* This is `ScalingAnimationType.SCALING_OUT`

ScalingAnimationType_out

GitHub