Skip to content

morristech/FlipAnimation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlipAnimation

This class extends the Animation class and provide extra APIs to perform a horizontal and vertical view flip. It uses the Camera class for transformations to provide a smooth 3D feel.

1 -> 2

3 -> 4

Download: JAR library

Usage

When using this library, simply add the JAR to your project:

Right click on project --> Properties --> Java Build Path --> Libraries --> Add External JARs

Example

// Flag to keep track of which view is on top
boolean mIsTopView = true;

// Setting the top and bottom view for flip animation
final FlipAnimation flipAnimation = new FlipAnimation(topView, bottomView);

// Setting a horizontal flip; the other option is a vertical flip
flipAnimation.setOrientation(FlipAnimation.HORIZONTAL);

// Listening to button clicks to perform the flip
button.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
        final boolean flipSuccessful;

        if (mIsTopView) {
            flipSuccessful = flipAnimation.flip(mIsTopView);
        } else {
            flipSuccessful = flipAnimation.flip(mIsTopView);
        }

        // If flip was not successful, that means the animation wasn't
        // done
        if (flipSuccessful) {
            mIsTopView = !mIsTopView;
        }
    }
});

License

About

Horizontal and vertical flip animator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 93.2%
  • Java 5.9%
  • CSS 0.9%