Using HorizontalViewPager1 instead of Canvas and Imagespirite

Thank you very much Tim,

Sure, I prefer to download all pages in startup the app as you said. However, I need every csv in seperate because I have just simplify the blocks in order to let me understand how the blocks works. So, is it possible to do that.

Actually, I have 600 pages. and 20 readers.

Hello Tim,

I hope it would be possible to include around 600 pages because I am afraid if I include 600 VerticalArrangement components

image

You would probably only want three pages, then use logic to load other pages as required. Then you may need to change the way you download pages back to how you were doing, or something similar.

I remember doing something similar some time ago for Osama Sayer, I will see if I can find it.

Won't you end up with @ 60 csv files instead of 20 ?

Thank you very much Tim for helping.

Regarding csv files:
I have only three types of csv files:

1-
pagelinks.csv for downloading all pages.

2-

1Page_Sound.csv for Reader 1
2Page_Sound.csv for Reader 2
....
....
....
20Page_Sound.svv for Reader 20

3-
1soundlinks.csv contains link for downloading sound for reader 1
....
....
20soundlinks.csv

As I told you that I just simplify the block to be easy for me to understand the blocks is working.

Here is one approach to the logic needed to load pages as you swipe, using only five components in the pager. This relies on your page names containing their number in the same position. Additional logic would be needed to go to a specific page - beyond the next or previous page numbers. I guess you could setup a download routine to get the next page whilst on the previous page, so that it is already downloaded when one swipes forward. If you need to swipe to the next page from right to left (instead of how I have done it - left to right), you should be able to easily reverse the logic.

hzpLogic.aia (58.3 KB)

Credits @vknow360 for the Pager extension

Thank you very much @TIMAI2 & @vknow360 for the Pager extension.
I will try to add my blocks and see how it works.

I have added my block but I think I have done something wrong.


hzpLogic_Taha.aia (95.7 KB)

Make your list of pages first, then apply them from the list. As you add more pages, update the list and refresh.

I have tried what you had told me to make my list pages
image


image

but I didn't know excatly what is the next step

image

:question:

I need to read the list from External SD Card which is in csv file
hzpLogic_Taha.aia (95.7 KB)

I have do it. But it show page1.png page2.png page3.png only.

hzpLogic_Taha_2.aia (97.1 KB)

Hello Tim,
I have fixed the blocks and I hope you can fix the page4 page5 page6
I have also added download all pages in the first start

hzpLogic_Taha_fix_1.aia (98.6 KB)

image

:question:

Check the path you are returning...looks like you are doubling up on a filename ?

I have removed the block for all but still there is something missing
image

Find it then. Debug your blocks to see what is happening.

Hello Tim,

I have fixed the pages.

Is it possible to add TinyDB in order to open the app with the last page when I open the app again.


hzpLogic_Taha_fix_2.aia (98.2 KB)

Yes.

See this example for ensuring that your pages list is always the latest and saved to the tinydb:

Also save to the tinydb a list of the three pages currently in view, then use this list to populate the three pages loaded on Screen.Initialise.

Hello Tim,

Thank you very much Tim for your help and support.

It really a great job.

Is it possible to start swipping the first image in the opposite side? I mean to swipe images the same way the clock moving.