/FragmentAnimations

3D animations for support-v4 Fragment transition.

Primary LanguageJava

FragmentAnimations

Animation examples for support.v4.Fragment transition.

Try it on your device via DeployGate

These animations do not depends on any external libraries.

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

Move Animation

MoveAnimation.java

Move

Cube Animation

CubeAnimation.java

Cube

Flip Animation

FlipAnimation.java

Flip

Push/Pull Animation

PushPullAnimation.java

Push/Pull

Sides Animation

SidesAnimation.java

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