B4A Library PageTurnView library providing a page turn animation

Discussion in 'Additional libraries, classes and official updates' started by agraham, Aug 12, 2011.

  1. MikieK

    MikieK Member Licensed User

    look, you have to bare in mind that I have absolutely no training in VB. I started off years ago playing around with qbasic. So I'm not going to understand most anything. The way I find my way is by trial and error.

    I willl try to explain...
    Because I don't understand what return means.

    If you where to load a WebView, I think theoretically you could control before the pageturner is initialised and then produce a bitmap based on the current view to be used in the page turner.

    I don't understand why this would be impossible, surely the library in question will just refer to the java module or code that handles the event, in wich case it will require similar inputs?

    Let me know If I'm wrong, I'm constantly trying to learn.
     
  2. Smee

    Smee Well-Known Member Licensed User

    We are all new at some time or another. But you probably should not give advice like

    if you dont know what the result would be or if you do not know what the statement itself means. As for the rest of it i'll let that go through to the keeper.

    Andrew,
    This is the code snippet
    Code:
    If Page = MaxRecs Then       ' Last page Load new Records from Next Directory
       CatNum=CatNum+1      ' Increment the directory flag
       LastPageNum=MaxRecs ' in case we need to go back a directory
       OpenPictureTable         'loads all pic names in array for this directory
       PageTurner.CurrentPage=0  'Start the display at zero
    end if
    Hope you can help with this

    Joe
     
  3. MikieK

    MikieK Member Licensed User

    again, all I know is what I've tried, and strangely enough, I didn't get an error when I tried that- I didn't get what I was looking for, but I didn't get an error.
    Again, If you look at my zip file I uploaded, I'm working on an alternative to this library (one that works with list views or simiar). Give me a day or two, and I will upload it, and you will be free to criticise/ use it as much as you want. Assuming that you want a similar thing... ie. a page turning animation that works with a non bitmap layout?
     
  4. agraham

    agraham Expert Licensed User

    Looks OK but you haven't really described the problem you are getting. Did you put the Log statements in as I suggested earlier?
     
  5. Smee

    Smee Well-Known Member Licensed User

    No offence meant. I look forward to reading through your alternative

    Cheers

    @ Andrew
    yep i have logs in but i am getting a diff of 1 each time. Gunna try something different 2morrow. too tired now

    Joe
     
  6. agraham

    agraham Expert Licensed User

    I think I know what is confusing you. The library will ask for the previous and maybe the next page when you set CurrentPage so you will need to cope with that as you change your picture tables. Maybe you need to keep two tables open at any one time to cope with the overlap.

    EDIT:- Only the previous page I now suspect.
     
    Last edited: Aug 16, 2011
  7. ZJP

    ZJP Active Member Licensed User

    Hi,

    Nice update and example Agraham.
    It works with RichString? I tried without success.

    JP
     
    Last edited: Aug 16, 2011
  8. MikieK

    MikieK Member Licensed User

  9. agraham

    agraham Expert Licensed User

    TextPaginator? No, it only works with a normal string and a single font.
     
  10. ZJP

    ZJP Active Member Licensed User

    Thx.
    The solution: Build a page with RichtString, save it in jpg and reload it in the "book".

    JP
     
    Last edited: Aug 17, 2011
  11. Smee

    Smee Well-Known Member Licensed User

    Yes i thought of that but the trouble is there could be 13 directories that the user may arbitrarily start at and they may decide to go forwards OR backwards. I'm gunna have to think about how i can deal with that.
     
  12. MikieK

    MikieK Member Licensed User

  13. Smee

    Smee Well-Known Member Licensed User

    Andrew,

    I have come across a problem with tracing the pages. They dont seem to count properly, following is a list of the log

    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    0/9 /cats/baby/BABY 123.jpg
    1/9 /cats/baby/BABY 124.jpg
    2/9 /cats/baby/BABY 140.jpg
    3/9 /cats/baby/BABY 168.jpg
    4/9 /cats/baby/BABY 169.jpg
    5/9 /cats/baby/BABY 170.jpg
    6/9 /cats/baby/BABY 67.jpg
    7/9 /cats/baby/BABY 67A.jpg
    8/9 /cats/baby/BABY 68.jpg
    9/9 /cats/baby/BABY 69.jpg
    9 - 9
    0/8 /cats/bagswallets/BAGS 01.jpg
    1/8 /cats/bagswallets/GENERAL 367.jpg
    1/8 /cats/bagswallets/GENERAL 367.jpg
    2/8 /cats/bagswallets/GENERAL 367A.jpg
    3/8 /cats/bagswallets/GENERAL 494.jpg
    4/8 /cats/bagswallets/GENERAL 523.jpg
    5/8 /cats/bagswallets/GENERAL 559.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    7/8 /cats/bagswallets/WALLETS 44.jpg
    8/8 /cats/bagswallets/WALLETS 58.jpg
    5/8 /cats/bagswallets/GENERAL 559.jpg
    5/8 /cats/bagswallets/GENERAL 559.jpg
    4/8 /cats/bagswallets/GENERAL 523.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    4/8 /cats/bagswallets/GENERAL 523.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    3/8 /cats/bagswallets/GENERAL 494.jpg
    3/8 /cats/bagswallets/GENERAL 494.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    6/8 /cats/bagswallets/WALLETS 41.jpg
    4/8 /cats/bagswallets/GENERAL 523.jpg
    3/8 /cats/bagswallets/GENERAL 494.jpg

    you can see it seems to jump a few pages at times. any idea how i could rectify this

    Regards

    joe
     
  14. agraham

    agraham Expert Licensed User

    Is this a perceived problem from reading the log or an actual visual problem? I can't see how the library could ask for out of sequence pages unless you are directly setting CurrentPage or giving it the wrong reply to the GetPages event. It might look in the log out order when turning backwards. If you are on page 5 and turn back the library will ask for page 3 in order to display the reverse of page 3 together with page 4. As it already has page 4 displayed reversed with page 5 it has no need to re-request it. So you see a request for page 5 then page 3 but that is in fact correct.
     
  15. Smee

    Smee Well-Known Member Licensed User

    It is an actual problem. If the page is slightly turned but then released the page no is set at the following page but the page shown is not the one in the log
     
  16. Smee

    Smee Well-Known Member Licensed User

    this is the log of turning pages in a smooth motion
    Installing file.
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    0/9 /cats/baby/BABY 123.jpg
    1/9 /cats/baby/BABY 124.jpg
    2/9 /cats/baby/BABY 140.jpg
    3/9 /cats/baby/BABY 168.jpg
    4/9 /cats/baby/BABY 169.jpg
    5/9 /cats/baby/BABY 170.jpg
    6/9 /cats/baby/BABY 67.jpg
    7/9 /cats/baby/BABY 67A.jpg
    8/9 /cats/baby/BABY 68.jpg
    9/9 /cats/baby/BABY 69.jpg
    it is all corect

    After reversing back to the start

    0/9 /cats/baby/BABY 123.jpg
    1/9 /cats/baby/BABY 124.jpg
    1/9 /cats/baby/BABY 124.jpg

    The log shows that we are showing page 1 but in reality it is page 0. I half turned the page and let go.

    The reason it is a problem is because i need to display item numbers of items that are on that page. It will show the item codes from page 1 not page 0. (They are stored in an array with the same number as the page)
     
  17. agraham

    agraham Expert Licensed User

    Sorry, but I don't understand what you mean by this.
    But is it the one the user expects?
     
  18. agraham

    agraham Expert Licensed User

    No, the log shows that the last page requested by the library was 1, it doesn't mean that it is displaying page 1.
     
  19. Smee

    Smee Well-Known Member Licensed User

     
  20. agraham

    agraham Expert Licensed User

    That is correct, that is how it is designed. You can't assume that the displayed page is the last page requested as the user may have dropped the page back to the previous one.

    I'm missing something here. If it asks for a specific page why can't you just build it and give it to it? How can it get out of order :confused:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice