Skip to content

Use this awesome library to add animation effect in Activity, Fragment, ViewPager, ViewPager2 By Single Line of Code

License

Notifications You must be signed in to change notification settings

DD4You/DDAnimatoo

Repository files navigation

DDAnimatoo

platform API Download License

Bored with same animation for activity, Fragment, ViewPager and Viewpager2 transition? DDAnimatoo is a lightweight and easy to use Android library that provides many activity, Fragment, ViewPager and Viewpager2 transition animations.

  • min SDK 16 (Android Jellybean 4.1)
  • written in Java

A lightweight, easy-to-use Android library that provides awesome activity, Fragment, ViewPager and Viewpager2 transition animations

Screenshots

Installation

Add the dependency to your module build.gradle:

dependencies {
	        implementation 'in.dd4you.animatoo:anim:1.0.0'
}

Usage

DDAnimatoo has 15 different activity/Fragment transition animations:

  1. in and out.
  2. swipe left.
  3. swipe right.
  4. split.
  5. shrink.
  6. card.
  7. zoom.
  8. fade.
  9. spin.
  10. diagonal.
  11. windmill.
  12. slide up.
  13. slide down.
  14. slide left.
  15. slide right.

DDAnimatoo has 12 different ViewPager/ViewPager2 transition animations:

  1. Background To Foreground.
  2. Cube In.
  3. Cube Out.
  4. Depth Page.
  5. Flip Horizontal.
  6. Flip Vertical.
  7. Foreground To Background.
  8. Rotate Down.
  9. Rotate Up.
  10. Tablet Page.
  11. Zoom In.
  12. Zoom Out.

For Activity

Using DDAnimatoo is extremely simple, A single short line of code following startActivity(...) is all that's needed, for example:

startActivity(new Intent(context, TargetActivity.class));
Animatoo.animateZoom(context);  //fire the zoom animation

Another example, this time firing the animation when the back button is pressed:

@Override
public void onBackPressed(){
  super.onBackPressed();
  Animatoo.animateSlideLeft(context); //fire the slide left animation
}

For Fragment

Using DDAnimatoo is extremely simple, A single short line of code following FragmentTransaction(...) is all that's needed, for example:

FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
FrAnimatoo.animateZoom(fragmentTransaction);  //fire the zoom animation
fragmentTransaction.replace(frameLayout.getId(), new FragmentName());
fragmentTransaction.commit();

For ViewPager

Using DDAnimatoo is extremely simple, A single short line of code, for example:

viewPager.setPageTransformer(new VpAnimatoo.BackgroundToForeground())

For ViewPager2

Using DDAnimatoo is extremely simple, A single short line of code, for example:

viewPager2.setPageTransformer(new Vp2Animatoo.BackgroundToForeground())

All the available methods for Activity:

Animatoo.animateZoom(context);
Animatoo.animateFade(context);
Animatoo.animateWindmill(context);
Animatoo.animateSpin(context);
Animatoo.animateDiagonal(context);
Animatoo.animateSplit(context);
Animatoo.animateShrink(context);
Animatoo.animateCard(context);
Animatoo.animateInAndOut(context);
Animatoo.animateSwipeLeft(context);
Animatoo.animateSwipeRight(context);
Animatoo.animateSlideLeft(context);
Animatoo.animateSlideRight(context);
Animatoo.animateSlideDown(context);
Animatoo.animateSlideUp(context);

All the available methods for Fragment:

FrAnimatoo.animateZoom(fragmentTransaction);
FrAnimatoo.animateFade(fragmentTransaction);
FrAnimatoo.animateWindmill(fragmentTransaction);
FrAnimatoo.animateSpin(fragmentTransaction);
FrAnimatoo.animateDiagonal(fragmentTransaction);
FrAnimatoo.animateSplit(fragmentTransaction);
FrAnimatoo.animateShrink(fragmentTransaction);
FrAnimatoo.animateCard(fragmentTransaction);
FrAnimatoo.animateInAndOut(fragmentTransaction);
FrAnimatoo.animateSwipeLeft(fragmentTransaction);
FrAnimatoo.animateSwipeRight(fragmentTransaction);
FrAnimatoo.animateSlideLeft(fragmentTransaction);
FrAnimatoo.animateSlideRight(fragmentTransaction);
FrAnimatoo.animateSlideDown(fragmentTransaction);
FrAnimatoo.animateSlideUp(fragmentTransaction);

All the available methods for ViewPager:

new VpAnimatoo.BackgroundToForeground()
new VpAnimatoo.CubeIn()
new VpAnimatoo.CubeOut()
new VpAnimatoo.DepthPage()
new VpAnimatoo.FlipHorizontal()
new VpAnimatoo.FlipVertical()
new VpAnimatoo.ForegroundToBackground()
new VpAnimatoo.RotateDown()
new VpAnimatoo.RotateUp()
new VpAnimatoo.TabletPage()
new VpAnimatoo.ZoomIn()
new VpAnimatoo.ZoomOut()

All the available methods for ViewPager2:

new Vp2Animatoo.BackgroundToForeground()
new Vp2Animatoo.CubeIn()
new Vp2Animatoo.CubeOut()
new Vp2Animatoo.DepthPage()
new Vp2Animatoo.FlipHorizontal()
new Vp2Animatoo.FlipVertical()
new Vp2Animatoo.ForegroundToBackground()
new Vp2Animatoo.RotateDown()
new Vp2Animatoo.RotateUp()
new Vp2Animatoo.TabletPage()
new Vp2Animatoo.ZoomIn()
new Vp2Animatoo.ZoomOut()

Contribution

Please fork repository and contribute using pull requests.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

License

Copyright 2020 DD4You.in

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

Use this awesome library to add animation effect in Activity, Fragment, ViewPager, ViewPager2 By Single Line of Code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages