how to know when the next/previous page has completely loaded in the page curl effect by harism?

耗尽温柔 提交于 2019-12-12 11:35:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!