PageCurl(magazine) with Image from web

佐手、 提交于 2019-12-18 17:13:27

问题


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:

  1. 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 a Canvas or using the drawingCache). What is to be noted is that the CurlView will need to be updated with the latest image from the view whenever there is a change in progress. This can be done by requestRender method.
  2. 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

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