Git Product home page Git Product logo

book-animation's Introduction

Summary

Book-animation is a simple library that allows you to make a book turn interaction. It's comprised of a PageTurnLayout that extends FrameLayout. Making pages is as simple as adding views to your PageTurnLayout and the rest is handled for you.

Simply check out the sample project to see how it works!

Sample video can be found here http://www.youtube.com/watch?v=3YY5XSOojhs&feature=youtu.be

Latest

This project is fully mavenized now. Should make it much easier to import.

book-animation's People

Contributors

briangriffey avatar cesine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

book-animation's Issues

Not working

Hello,

I want use book animation for my application but PageTurnLayout not working.

my code :

@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

    layout =  new  PageTurnLayout ( this.getBaseContext() ); 
    PageTurnLayout.LayoutParams layoutparams = new  PageTurnLayout . LayoutParams ( ViewGroup . LayoutParams.MATCH_PARENT , ViewGroup . LayoutParams.MATCH_PARENT);             
    layout . setLayoutParams ( layoutparams );
    layout.setBackgroundColor(getResources().getColor(R.color.fond));

    menus = Restaurants.menus;

    for (int i = 0; i < menus.size(); i++) {

        LinearLayout menu = new LinearLayout(layout.getContext());
        LinearLayout.LayoutParams params = new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT , Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL );             
        menu.setLayoutParams(params);
        menu.setBackgroundColor(getResources().getColor(R.color.fond));
        menu.setOrientation ( LinearLayout . VERTICAL ); 

        TextView nom = new TextView(menu.getContext());
        nom. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 1f ));
        nom.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        nom.setTypeface(TBLActivity.CLB);
        nom.setTextColor(getResources().getColor(R.color.text));
        nom.setTextSize(12);
        nom.setText(menus.get(i).nom);

        TextView descriptif = new TextView(menu.getContext());
        descriptif. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 0.4f ));
        descriptif.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        descriptif.setTypeface(TBLActivity.CLB);
        descriptif.setTextColor(getResources().getColor(R.color.text));
        descriptif.setTextSize(6);
        descriptif.setText(menus.get(i).descriptif);

        TextView prix = new TextView(menu.getContext());
        prix. setLayoutParams ( new  LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT, 1f ));
        prix.setGravity(Gravity . CENTER_HORIZONTAL | Gravity . CENTER_VERTICAL);
        prix.setTypeface(TBLActivity.CLB);
        prix.setTextColor(getResources().getColor(R.color.text));
        prix.setTextSize(5);
        prix.setText(menus.get(i).prix);

        menu.addView(nom);
        menu.addView(descriptif);
        menu.addView(prix);

        layout.addView(menu);

    }

    setContentView(layout);
}

EditText

How would one go about putting a edittext on a page. I've tried but the touch event doesn't reach the editText.

Page Turn Triggered by Button

Hi! This project might be dead, but I was interested in using what you've got as long as I can find a way to trigger the full animation with a button press. I'm having difficulty finding the right place to hook in to run a full animation (am not familiar with Android, obviously), any chance I could get some support in this? If I getting working, I would contribute. ๐Ÿ‘

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.