SPEAKER NOTES:
Welcome to Week 6! Today we focus on three everyday UI needs for our Hope Foundation golf app: lists, app bars, and dialogs.
Hook: "Your app is useless if the user can’t scroll through 18 holes, access actions, or confirm changes." We’ll solve all three.
SPEAKER NOTES:
We start with Quiz 2, then move into the core Compose tools for lists. We’ll close with app bars and dialogs, which we’ll build out further on Wednesday.
SPEAKER NOTES:
Quiz 2 covers Weeks 4–5: Compose basics, state, and ViewModels. Keep this short and focused.
SPEAKER NOTES:
Confirm timing and expectations. Remind students that the quiz mirrors common mistakes from recent labs.
SPEAKER NOTES:
Lists are how users navigate data. For Hope Foundation, think: scorecards, team rosters, and hole summaries.
SPEAKER NOTES:
We use LazyColumn because it only composes what’s on screen. It’s memory-efficient and fast.
SPEAKER NOTES:
This prevents building all 18 holes at once when only 6 fit on screen.
SPEAKER NOTES:
The list manages composition and reuse, similar to RecyclerView but with simpler APIs.
SPEAKER NOTES:
Scrolling stays smooth even with hundreds of items. This matters for lists like golfer histories.
SPEAKER NOTES:
Keys are critical to avoid item state bugs when lists change.
SPEAKER NOTES:
Point out three essentials: content padding, spacing, and stable keys. Keys preserve item identity.
SPEAKER NOTES:
Keep list rows small and reusable. When UI grows, splitting components keeps code readable.
SPEAKER NOTES:
Let’s highlight pitfalls that cause stuttering or incorrect list behavior.
SPEAKER NOTES:
Without keys, Compose might reuse state incorrectly. This can show the wrong score in the wrong row.
SPEAKER NOTES:
Don’t parse JSON or run complex calculations inside a row. Precompute outside.
SPEAKER NOTES:
Avoid nested scrolls. Use a single LazyColumn and include headers/footers.
SPEAKER NOTES:
Spacing is usability, not decoration. Make rows tap-friendly.
SPEAKER NOTES:
App bars provide navigation and actions. Dialogs handle confirmations and data entry.
SPEAKER NOTES:
Explain the three slots: title, navigation icon, actions. Actions are right-side icons.
SPEAKER NOTES:
Use the right app bar type depending on context.
SPEAKER NOTES:
Default choice for most screens.
SPEAKER NOTES:
Center aligned is useful for branding or a prominent title.
SPEAKER NOTES:
Large app bars can collapse on scroll. We’ll demo this later in the term.
SPEAKER NOTES:
Actions should be common tasks, not destructive ones.
SPEAKER NOTES:
Dialogs should always have clear confirm/dismiss options. Note `onDismissRequest` for taps outside.
SPEAKER NOTES:
Dialogs should be rare and purposeful. They interrupt the flow.