B4A Library PageTurnView library providing a page turn animation

This library displays bitmap images and provides a page turn animation to allow the user to "turn" the pages.

This library wraps an Android view which written by Harri Smått and released as open source under the Apache 2.0 licence. It was located for Basic4android use by forum member Smee.

There is no credit due to me for the functionality of this library. As Harri wrote it as a normal Android view I have merely wrapped Erel's view structure around it to make it accessible to Basic4android.

Belated warning in 2021! Use Release mode. You can probably use legacy debug mode if you need to, but normal debug mode will not work with this library.

EDIT :- Version 1.1 posted. See post #6 for details.

EDIT :- Version 1.2 posted. See post #10 for details.

EDIT :- Version 1.3 posted. See post #43 for details.

EDIT :- Version 1.4 posted. See post #158 for details.
 

Attachments

  • PageTurnView1.4.zip
    38.6 KB · Views: 616
Last edited:

zeuspower

Member
Licensed User
Longtime User
Thanks for the fast responce...:)

but my main problem is that when an action : Pager.Paginate(text)
happens once, then on another cycle with new data ,it contains the previous data and the new one...

for example :

we have an sql database with mythic persons...

the first time the user selects,HERCULES...i read the data ,fill with them the pager ,everything is ok,the user reads the data and enjoys the page turn effect

the next time ,the user wants to read,let's say,for PROMETHEUS,select it,and i in my code read again the sql data for Prometheus, do the pager.paginate(text) again,but the pages now contain all the text-data from the previous selection(hercules) plus the new text-data (prometheus)...

I hope i made clear what I want...
maybe i miss something in the understanding of the whole concept ,or in fact there is no solution to this ?

:sign0104:
 

ChrShe

Member
Licensed User
Longtime User
I don't think you can just dim again without destroying the old instance.

Could he do something like Paginator =NULL to clear the existing instance, then reassign it with new content?
 

zeuspower

Member
Licensed User
Longtime User
yep ! it is working,thanks Agraham...

a simple solution but it had puzzled me ,a lot...(I will use in my next new app)
so a donation must be coming you way :sign0098:
 

murdoch1976

Member
Licensed User
Longtime User
:sign0085:

It would be great to have this page turner force scale the bitmap to fit the page.

At the moment, for some reason, even if my bitmap (originates from a JPG) is smaller than the actual page for some reason it seems to zoom up to the top left corner of the image.

Any ideas?
 

murdoch1976

Member
Licensed User
Longtime User
Apologies. Just read post 117, and that worked for me. I had left the whole canvas thing out.

Lovely job. Thank you! :)
 

tpakis

Active Member
Licensed User
Longtime User
I'm having a problem with one of my apps. In some devices it gives this error (found it in developer console)

java.lang.NullPointerException
at anywheresoftware.b4a.agraham.pageturnview.CurlViewWrapper.getBitmapCount(CurlViewWrapper.java:140)
at anywheresoftware.b4a.agraham.pageturnview.CurlView.updateBitmaps(CurlView.java:652)
at anywheresoftware.b4a.agraham.pageturnview.CurlView.onPageSizeChanged(CurlView.java:178)
at anywheresoftware.b4a.agraham.pageturnview.CurlRenderer.updatePageRects(CurlRenderer.java:235)
at anywheresoftware.b4a.agraham.pageturnview.CurlRenderer.onSurfaceChanged(CurlRenderer.java:135)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1506)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1267)

any ideas?
 

agraham

Expert
Licensed User
Longtime User
It's failing when trying to raise the GetPages event because it is receiving null rather than an Int return value. Look in the Logs, you will probably see an ""ignoring event: "before the stack trace. If so it is because the Activity is paused. Make sure that you are calling OnPause in Activity_Pause and OnResume in Activity_Resume.
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I am sorry if this has been answered somehow but I did not understand whats the best way to load a long text (book) without affecting performance?
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Ok , I tried loading all content to a list
and then use a for loop to paginate its items but I have around 700 items ( The activity takes around 7 seconds to load)
Please advise me
I believe I am doing it noobs way.
 

Beja

Expert
Licensed User
Longtime User
Please someone point me to the location of this view's documentation..

Thanks in advance.
 

Beja

Expert
Licensed User
Longtime User
Yes Klaus,
Thank you so much..

searching with PageTurnView didn't return this for me.. (good excuse, right?!!)
 

klaus

Expert
Licensed User
Longtime User
Click on Documentation in the top menu.
And there you find the list of all documentation.
The fist chapter is Tutorials and examples:.
And the second is Libraries.
Click on PageTurnView - v1.30 - Written by Andrew Graham and you get the documentation page.
Other solutions are
- Vaders Help documentation - B4a Object Browser.
- agrahams B4A XML file help viewer. This one is running every time on my computer.
 
Top