问题
I am working with Harism Page Curl(Open GL) https://github.com/harism/android_page_curl and its works perfectly fine
But in this example the condition I found is that we must have all Bitmap resource ready(downloaded) but what I want is image will going to load(runtime) from web and will be cache for future like this.
Want some idea that how would I achieve this? a small help/hint is also appreciated. :)
Thanks.
回答1:
This answer assumes that you want to use the Page Curl by Harri Smått (harism) and nothing else.
There are different ways to achieve the wait screen with progress bar:
- Create a custom view that will display the image for every page. When the required image is not available, it will display the wait message together with the progress bar while downloading the image in the background. The
BitmapProvider
returns the bitmap captured from this custom view (by either using aCanvas
or using thedrawingCache
). What is to be noted is that theCurlView
will need to be updated with the latest image from the view whenever there is a change in progress. This can be done byrequestRender
method. - Create an OpenGL progress widget. Whenever the image is not available and need to be downloaded, this progress widget together with the message is shown in place of the page. When the download gets completed, the view is re-rendered with the downloaded image.
回答2:
One option is to do something like this How To apply click listener?, which suggests to maintain two views (one on top of another).
The first one will hold the views you need (the current page if already loaded, otherwise the ProgressBar). The second one will be the OpenGL surface view by harism, which will make the page curling. This way, you can play with hiding/showing/bringing them to top/bottom when you need it.
来源:https://stackoverflow.com/questions/10827745/pagecurlmagazine-with-image-from-web