how to know when the next/previous page has comple

2019-06-28 05:17发布

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条回答
贼婆χ
2楼-- · 2019-06-28 05:34

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 
    }
查看更多
登录 后发表回答