Skip to content

Add Pull-to-Refresh demo using Material3 PullToRefreshBox - #209

Open
dipenpradhan wants to merge 8 commits into
Gurupreet:masterfrom
dipenpradhan:issue-187-pull-to-refresh
Open

Add Pull-to-Refresh demo using Material3 PullToRefreshBox#209
dipenpradhan wants to merge 8 commits into
Gurupreet:masterfrom
dipenpradhan:issue-187-pull-to-refresh

Conversation

@dipenpradhan

@dipenpradhan dipenpradhan commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

📚 Stacked PR — 8 of 18

Depends on #208 · Blocks #210

This PR's own diff (2 commits)

The diff shown below by GitHub also includes the ancestor commits, because
every PR in this stack targets master (base branches can only point at
branches that exist in this repository). Use the compare link above to review
just this PR's real change. Merge order is documented in the stack.

Summary

Implements the Pull-to-Refresh demo with Material3's first-party PullToRefreshBox, as proposed in #187.

The home screen already had a "Pull Refresh" entry (HomeScreenItems.PullRefreshDynamicUIActivityPullRefreshList), but PullRefreshList was a stub of fully commented-out code marked TODO revisit pull refresh. This PR replaces the stub with a working implementation:

  • PullToRefreshBox (stable in Material3 1.3, available via the Compose BOM from earlier in this series) wrapping a LazyColumn of Spotify-style album rows
  • Pulling triggers a simulated network reload (delay(1500)) so the indicator is visible, then prepends a new item and scrolls to top
  • Light/dark theme support comes from the existing DynamicUIActivity theme plumbing
  • README "Coming Soon" no longer lists Pull Refresh

Acceptance criteria from #187

  • Composable screen demonstrating PullToRefreshBox
  • Simulates a network delay (1.5s) to show the indicator
  • Light and dark theme support
  • Registered in the home screen list (was already wired — now functional)
  • README updated

Closes #187

Verification

  • PullRefreshListTest (3 tests) — Robolectric Compose UI tests covering the refresh gesture, the indicator, and list content.
  • ./gradlew ktfmtCheck assembleDebug testDebugUnitTest passes locally (JDK 17, SDK 35)
  • CI ./gradlew build on this PR

cc @Gurupreet for review

- Replace compose/material3 version constants with composeBom
- Strip explicit versions from BOM-managed artifacts
- Import the BOM platform on every configuration that receives
  Compose artifacts (implementation, debugImplementation,
  androidTestImplementation, :data)
- Migrate API removals that come with Compose 1.7 / Material3 1.3:
  SmallTopAppBar -> TopAppBar, rememberRipple -> material3 ripple
- Update the outdated README Compose badge to the BOM version

Fixes Gurupreet#186
All lifecycle artifacts (viewmodel-compose, viewmodel-ktx,
livedata-ktx, runtime-ktx, viewmodel-savedstate) move together
via the shared androidLifecycleGrouped version.

Fixes Gurupreet#192
- navCompose 2.7.7 -> 2.8.9; add kotlinx-serialization-json 1.8.0
- Apply the Kotlin serialization plugin in gmail and tiktok demos
- Gmail: string routes -> @serializable route objects
- TikTok: TikTokScreen becomes a serializable sealed interface;
  the profile route carries a typed userId argument read via
  toRoute(), bottom bar selection uses NavDestination.hasRoute

Fixes Gurupreet#193
- Replace com.google.android.exoplayer:exoplayer with
  androidx.media3:media3-exoplayer and media3-ui
- Rewrite TikTokPlayer against the Media3 API (SimpleExoPlayer was
  removed; default media source factory handles asset URIs)
- Removes the last Jetifier warning produced by ExoPlayer 2.x

Fixes Gurupreet#183
- Move to the io.coil-kt.coil3 artifact group
- Add coil-network-okhttp (network fetching is a separate artifact
  in Coil 3, self-registered via ServiceLoader)
- Migrate call sites: rememberImagePainter(data=) ->
  rememberAsyncImagePainter(model=), coil.* -> coil3.* imports

Fixes Gurupreet#191
PullRefreshList was a fully commented-out stub (TODO revisit pull
refresh). It now demonstrates the first-party PullToRefreshBox with
a simulated 1.5s reload that prepends an item to the list.

Fixes Gurupreet#187
Covers the new composables added here so the feature ships with its own
verification rather than relying on a later change in the stack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Pull-to-Refresh demo

2 participants