Comments (5)
I don't think we can set image during page flipping, that is because the image need to be sent to OpenGL as drawing texture ahead and OpenGL will memorize it in its cache and draw it on screen during animation.
So the only possible way I can come up with is that you can set a default image which express the loading is ongoing to OpenGL if the image has not been completed loading before animating and then set the real image after the animation is finished. Hope it is useful for you. Thanks!
from android-pageflip.
I forked your project, here is what I came up with, can you take a look at it please? https://github.com/ursusursus/android-PageFlip/blob/master/Sample/src/main/java/com/eschao/android/widget/sample/pageflip/SinglePageRender.java
Somehow this feels very brittle, the pageNo indexes in your singlepagerender dont change in "one place" but all over the code, so Im not sure if I refactored the code correctly
from android-pageflip.
Simply had a look you codes, it seems ok. But I don't know how long the following codes will take:
page.isSecondaryBitmapLoading() && LoadBitmapTask.get(mContext).getBitmap(mPageNo + 1) != null
Before you do any changes, you need to understand why my original sample codes always prepare the next or pre bitmap ahead. The major reason is that we want to provide a smooth page flipping to user and don't let user feel some delay. If you start loading next bitmap when user trigger a page flip by finger movement or other actions, you'd better set a blank or default bitmap as the first or second texture here since the loading normally need some time to finish. If you do not, in terms of your codes, I think user will feel obvious delay during page flipping. You can try and see what it will happen.
from android-pageflip.
what I tried to do in onPageChanged is to load 3 bitmaps, pageNo - 1, pageNo and pageNo + 1 ... getBitmap() just queries it from cache, if there is none, then just draws color onto canvas
from android-pageflip.
Yes, you can do like what you said. Only one thing we need to remember is that make sure the animation is smooth as could as we can whatever we do during page flipping . If some actions take too long time to make the animation smooth to user, we should consider an alternative way to eliminate it. Of course, any changes is up to your codes and your usage. Try and get a good balance for your app.
from android-pageflip.
Related Issues (20)
- specific position
- How to add SupportMapFragment to Canvas HOT 1
- Modify current page./redraw current page. HOT 1
- How to maintain the sequence of the page flip. HOT 1
- Landscape View in Flip Page not working HOT 3
- 如何跳转到指定页 HOT 2
- Black screen in landscape view. Realme 5 phone android 9 HOT 3
- Any suggestions on how to handle front and back pages in doublePagesRender? HOT 3
- Dynamic bitmaps HOT 5
- Navigating to a specific page HOT 1
- Incorrect Page Number. HOT 2
- Landscape Mode Issue HOT 3
- There is a problem with page ranking HOT 2
- Help
- I
- Instead of Bitmaps, does it support custom layout or webview even? HOT 1
- Can we use it on PDF? HOT 8
- Could not find com.github.eschao:android-PageFlip:1.0.2. HOT 4
- 有双页翻页效果的电子书的例子吗
- 从第二页左下角翻回第一页没有效果
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-pageflip.