Summary - What I’m trying to do
My application is a mobile reading application. There are essentially 3 screens for the project: home screen (shows images of the available book covers via DVG), book summary screen (enlarged cover image and text summary of book via DVG), and reader screen (text for the chapter and button to advance to the next chapter). The part I’m having trouble with is how I display the text for each chapter of the book on the reader screen.
Ultimately, I want to save readers progress as a local table for each book they read so the app automatically loads the right chapter when they open the book again. However, right now I’m having trouble getting the chapter text logic to work right. What I’d like it to do is check which chapter the user is on for the story and open the right chapter. If they haven’t made any progress, then to open the first chapter. Then after each time they hit the “Next Chapter” button in the reader it updates the local table to increase the chapter for that particular story.
I’ve done a bunch of searching through the docs and these forums (VLOOKUPS in LocalDB, storing rows as objects, etc.), and I’ve learned enough to feel like I know it is possible, but I haven’t been able to crack the code on how to do it. I believe there is some combination of changing the way I store the data (do I change the table so each chapter has a row and curse through to find the right row that matches the story & the user’s progress setting) to how I actually try to access the data via blocks.
Screens
- Home screen - this is a DVG of the book covers and title delivered by airtable data source
- Summary screen - when a user selects a book from the home screen they can see an enlarged image of the book cover and a short summary of the book. This is done by passing the rowID of the story and setting a label text with the summary column. A user may then hit the “start reading” button.
- Reader screen - when a user selects start reading it is meant to load the last chapter the user was on or the 1st chapter of the book if they hadn’t previously opened the book.
Data Sources
- Airtable - this contains all the book information and there is a row for each book (title, cover image, summary, and a column for each chapter text). I think I may need to change this to separate tables, but I’m not sure.
- Local table - this contains a column for the title of each book and the chapter progress they’ve made, with the default progress set to chapter 1.
This is my first post so happy to provide more information if I’ve missed something. I’d share the project but it’s a private project.