3D animation examples for support-v4 Fragment transition.

Overview

FragmentAnimations

Platform API Android Arsenal

Animation examples for support.v4.Fragment transition.

These animations do not depends on any external libraries.

Try it on your device via DeployGate

Usage Example

In your Fragment, just code like this.

@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    return CubeAnimation.create(CubeAnimation.UP, enter, DURATION);
}

See more example in ExampleFragment.java

Contents

Cube Animation

CubeAnimation.java

Cube

Flip Animation

FlipAnimation.java

Flip

Push/Pull Animation

PushPullAnimation.java

Push/Pull

Sides Animation

SidesAnimation.java

Move Animation

MoveAnimation.java

Move

Combination

You can use above Animations with another one.

@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    if (enter) {
        return MoveAnimation.create(MoveAnimation.UP, enter, DURATION);
    } else {
        return CubeAnimation.create(CubeAnimation.UP, enter, DURATION);
    }
}

Cube/Move Animation

Cube/Move

Move/Cube Animation

Move/Cube

Push/Move Animation

Push/Move

Move/Pull Animation

Move/Pull

Install

This library is available in jcenter.

dependencies {
    compile 'com.labo.kaji:fragmentanimations:0.1.1'
}

License

Copyright 2015 kakajika

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.
You might also like...
Android Animation Easing Functions. Let's make animation more real!
Android Animation Easing Functions. Let's make animation more real!

Android Easing Functions This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make

Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

A library support circular imageview with rotation animation
A library support circular imageview with rotation animation

Circular Imageview with Rotate Animation This is a fast and efficient open source custom imageview for Android that allow to easy implement disc anima

Examples of the use of animations in jetpack compose and view, as well as measurements of perfomance
Examples of the use of animations in jetpack compose and view, as well as measurements of perfomance

AndroidAnimationWorld Примеры использования анимаций в jetpack compose и view, а также замеры perfomance для

Cute view animation collection.
Cute view animation collection.

Android View Animations One day, I saw an iOS library, which is a view shaker, it's very beautiful. I think Android also need one, and should be bette

A beautiful ripple animation for your app
A beautiful ripple animation for your app

Android Ripple Background A beautiful ripple animation for your app. You can easily change its color, speed of wave, one ripple or multiple ripples. S

A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android
A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android

android-flip Aphid FlipView is a UI component to accomplish the flipping animation like Flipboard does. A pre-built demo APK file for Android OS 2.2+

[] Android library for using the Honeycomb animation API on all versions of the platform back to 1.0!

DEPRECATED NineOldAndroids is deprecated. No new development will be taking place. Existing versions will (of course) continue to function. New applic

BaseAnimation network Android animation set, custom controls, nearly 200 kinds of source code! BaseAnimation, if a new version is updated automatically to remind everyone, I hope everyone will contribute their animated XML files or other source, together to create this open source app!
Comments
  • MoveAnimation direction changes

    MoveAnimation direction changes

    your library is good and working well my problame is i want use move in and move out animation with your library...

    @Override public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {

        if (enter) {
            return MoveAnimation.create(MoveAnimation.RIGHT, enter, 500);
        } else {
            return MoveAnimation.create(MoveAnimation.RIGHT, enter, 500);
        }
    }
    

    i use this for fade in write perfect....but when i use BACKBUTTON then that out with right

    if i use

    if (enter) { return MoveAnimation.create(MoveAnimation.RIGHT, enter, 500); } else { return MoveAnimation.create(MoveAnimation.LEFT, enter, 500); }

    for exit whenever i replace my fragment then fregment is close with left and second open with right

    so thats the wrong method i follow...

    how can i open all fragment from right and press backbutton close from right ???

    opened by birjubhatt 0
  • Animation directions changed to opposite

    Animation directions changed to opposite

    When clicking left button it hides current fragment to left and opens another from right, which I suppose is incorrect and little bit annoying. It should open new fragment from right when user clicks on right button and from left when user clicks left button, which is logically correct.

    opened by ilyaskhametov 2
  • How to handle backpressed fragment animation

    How to handle backpressed fragment animation

    I am using your fragment animation,i am moving one fragment to another fragment at that time animation is working properly but when i back press second fragment animation is not happening properly

    opened by skyshine999 1
  • Change animation directions

    Change animation directions

    In your demo app when I click left button it hides current fragment to left and opens another from right, which I suppose is incorrect and little bit annoying :) It should open new fragment from right when user clicks on right button and from left when user clicks left button, I suppose this is logically right. Thanks in advance.

    opened by ilyaskhametov 2
Owner
Keita Kajiwara
Keita Kajiwara
Android Transition animations explanation with examples.

UNMAINTAINED No maintainance is intended. The content is still valid as a reference but it won't contain the latest new stuff Android Transition Frame

Luis G. Valle 13.6k Dec 28, 2022
ArcAnimator helps to create arc transition animation: 2.3.+

ArcAnimator ArcAnimator helps to create arc transition animation: 14+ | ArcAnimator Demo | TransitionLoop Demo* *TransitionLoop Prototype by Min-Sang

Asyl Isakov 1.2k Dec 20, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
This is a simple util to create Activity transition animation

TransitionHelper This is a simple util to create Activity transition animation API compatible with Android 2.2+ 中文说明 Screenshots How to use 1.startAct

ImmortalZ 1.6k Dec 12, 2022
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

Orbitary ?? Jetpack Compose animation library that allows you to implement animations such as shared element transition. Download Gradle Add the depen

Jaewoong Eum 503 Dec 30, 2022
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

?? Jetpack Compose animation library that allows you to implement animations such as shared element transition.

Jaewoong Eum 504 Jan 2, 2023
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Lightweight Android library for cool activity transition animations

Bungee min SDK 16 (Android Jellybean 4.1) written in Java A lightweight, easy-to-use Android library that provides awesome activity transition animati

Dean Spencer 172 Nov 18, 2022