Page curl animation - issue

2019-02-15 14:34发布

问题:

I am developing a project in which on the same view when a button clicks, the contents got changed. e.g.

suppose there are 5 questions and on next button click, the questions and answers will change, from 1-5 questions. and I want to implement page curl animation on button click...

I got the page curl animation code from github https://github.com/harism/android_page_curl , but still confused with how to implement this project as a library in my application,

so that I can use the page curl animation when the user click on next and previous button, can anyone pplss guide me into this, how can I implement this code on next button click...

Thanks.....

回答1:

I had used Page Curl example.. I am posting my code.. I hope it helps you.. On next button click write below code:-

PageCurlView pageCurlView = new PageCurlView(this, true);              
// If you would like to see the on-screen debug info
pageCurlView.bDrawDebug = true;
this.setContentView(pageCurlView);

You can get PageCurlView.java. from here.

You can set color of "mCurlEdgePaint". And put your background in this lines

mBackground = BitmapFactory.decodeResource(context.getResources(),R.drawable.background_main);
mForeground = BitmapFactory.decodeResource(context.getResources(),R.drawable.background_main_bg);