A book with ListViewer (or Label Display of csv )

Hello Every one, I need a help please.

I want to build an app which contains Listviewers each Listviewer contains sentences by making csv files with precise start and stop times for each sentence by highlighting each sentence.
the csv has three items:
Column 1: A number of ListViewer
column 2: mp3 sound
column 3 : a link of download mp3 sound
column 4 : for start and stop time for sentence with highlighitng each sentence.

Is there another idea easier than using Listviewer such as using a text. Please advise me to do that.

In anticipation, I have prepared a working demo that uses a text of 12 sentences, a sound file of the text, and a list of timings. These are combined with a textbox and a clock timer to read and highlight each sentence. Also provided is a font size changer to increase or decrease the font size of the text.

You should be able to build up your book/reader app using this structure.

Credits @Taifun for the Textbox and Advanced Player extensions used in this demo.

viewreader.aia (1.9 MB)

BLOCKS

Video Preview

#Notes

  • The text is taken from the first chapter of Robinson Crusoe by Daniel Defoe. Most of you will probably know the main story, but the book provides so much more both before, during and after being shipwrecked on a desert island! I recommend this book to you.

  • I used an online text reader to generate the sound file, recording the passage to my computer using linux tools (yad/lame/sox).

  • Tested using companion 2.62 on Android 10 and Android 12.

Thank you so much Tim for help. That is exactly what I want.
Is it possible to add touch any sentece to start reading that sentence.

Yes, this is possible, with a Select mode and a couple more clock timers and a few more blocks....

viewreaderselect.aia (1.9 MB)

BLOCKS

Video Preview

Hello Tim,
Can you please post a Video Preview to see how it is working after select any sentence and start reading the selected sentence. Thank you.

added above

That's awsome!
I just wonder why when I select any sentence in the middle of the story it just read that selected sentence and stop at the end of that sentence while the story hasn't completed yet (This option fine don't delete it) . I just need to add one more option read the next sentences until finish the story.
Good job Tim!
Thank very much.

Please read my edited topic above.

I believe we need to start again, as working backwards is never a good thing....

Any other features you want to add?

Remind me, for a page of text, do you have each sentence as a separate element in a csv file ?

1 Like

These are the csv for both of a text and mp3 sound and consider that I have 40 Texts and 5 readers for each text
1.csv (771 Bytes)
1soundlinks.csv (1.5 KB)

2soundlinks,
3soundlinks,
4soundlinks,
5soundlinks

Do you want the numbers to show in the text? e.g.

1 first bit of text 2 second bit of text 3 third bit of text

Yes exactly, I want these numbers in text.

If I work on something like this? :

image

( I am aware that the arabic text runs right to left but we can handle that later...)

1 Like

Thank you so much Tim for taking care of this project.

Hello Tim,

If it is possible you can highlight a sentence with yellow color and leave the next one without highlight for all texts to be much better in seen before start reading and when start reading the highlight color could be green color. like this:

Possibly....it might be better to just break up the sentences/phrases with a line break or two...

image
I am trying to avoid going back to html, or adding further complexity by using labels or dynamic components.

I am however having issues with your example text csv file 1.csv.

If I treat it like a csv like a csv (in order to separate the number from the text) then it outputs in App Inventor as a list like this (because there are commas in the text)

image

There is a word at the end of each line (which appears to translate to "party" in English)

If I just display the contents as text it looks like this:

image

Do you have a standard content and a standard format for your text csv files, or how do you want to handle this. All the text can be wrapped in double quotes for there to be two elements, the line number, and the text in one sublist. This needs to be resolved before any other work.

1 Like

What you have sent through is not really helping. The csv content needs to be standardised. If we want to show the number, that is element (index1) which other elements of a line in the csv need to be displayed, index2, or all indexes after the number.

Try This please:
114.csv (485 Bytes)

OK, that follows the same format at 1.csv:

number,text,text
number,text,text
number,text,text

Do you want to show all three elements for each line?

1 Like