GithubHelp home page GithubHelp logo

morristech / flipanimation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aznslayer/flipanimation

0.0 1.0 0.0 285 KB

Horizontal and vertical flip animator.

License: Other

HTML 93.22% CSS 0.88% Java 5.91%

flipanimation's Introduction

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

flipanimation's People

Contributors

aznslayer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.