GithubHelp home page GithubHelp logo

playlikecurl's Introduction

demo

Notice ⚠️

This repo is no longer maintained

Introduction

It is an project for implementing 'Page Curl' similar to what we see in Google Play Books using OpenGL 1.0. The source code is released under MIT License can be used in commercial or personal projects.

The main motive to work on 'PlayLikeCurl' is that its way more efficient than the traditional curl effect and is better looking because it's way more smoother than the traditional curl.

In this project the below common sinusoidal graph equation is used to achieve the play like curl:-

Asin(2π/λ*x)

Where,
A = Amplitude (i.e. the elevation of curl we want).
λ = Wavelength (i.e. the length of the curl we want).
x = The X axis variable which will change as you move the page.

In this i have drawn 3 pages on SurfaceView namely 'LeftPage' , 'CenterPage' and 'RightPage', 'CenterPage' is always visible and is responsible for 'right curl' animation while 'LeftPage' is responsible for 'left curl' animation and 'RightPage' just stay static.

For detecting gestures the default GestureDetector class has been used.

ToDo

  • Need to add shadow below the page when it will move.

How to Use

Add Gradle dependency:

dependencies {
    compile 'com.github.karacken:karackencurllib:0.0.1'
}

Use Code:

PageSurfaceView  pageSurfaceView = new PageSurfaceView(this);
String[] asset_res_array=null;
asset_res_array=  new String[]{"page1.png", "page2.png", "page3.png"};
PageCurlAdapter pageCurlAdapter=new PageCurlAdapter(asset_res_array);
pageSurfaceView.setPageCurlAdapter(pageCurlAdapter);
setContentView(pageSurfaceView);

References

playlikecurl's People

Contributors

micoder-dev avatar karankalsi avatar

Stargazers

Meeradiya 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.