问题
I have implemented Page Curl Effect by harism in my application.
Now I need to do some text animation on top of the pages. I am able to put the text over the pages and also able to animate. However, I need to know when the curl effect has completed and next/previous page has completely loaded, as I need to make the TextView invisible and stop the animation when the page curl effect is in process.
I have been struggling to find when the page is completely loaded/page curl animation has finished. I have also posted my question on github harism repository in the issues section and android-developers forum on Google Groups, but have not received any replies. Hope to get some help out here.
Thanks!
回答1:
There is method onDrawFrame in CurlView class. There you can see that parts of code where you can determine if page has been completely loaded:
if (mCurlState == CURL_LEFT) {
--mCurrentIndex;
// left curl has been completely loaded
//here you can add some code
}
and if it is right page curl
if (mCurlState == CURL_RIGHT) {
++mCurrentIndex;
// right curl has been completely loaded
//here you can add some code
}
来源:https://stackoverflow.com/questions/17849143/how-to-know-when-the-next-previous-page-has-completely-loaded-in-the-page-curl-e