[MUON-1865] Rename BpkGraphicPromo image param to background#2743
Conversation
The image parameter already accepted any composable content, so it was never limited to images the way iOS's BPKGraphicPromo was before backpack-ios#2593. Renaming to background aligns naming with iOS and makes it clear the slot can host BpkVideoPlayer, not just Image. Adds a demo story showing a sponsored GraphicPromo with a video background. Breaking: BpkGraphicPromo's image parameter is renamed to background.
Replace the full duplicated example with a minimal snippet showing background works with either Image or BpkVideoPlayer.
73bf034 to
c3e73a9
Compare
Generated by 🚫 Danger Kotlin against c3e73a9 |
Generated by 🚫 Danger Kotlin against c3e73a9 |
Generated by 🚫 Danger Kotlin against 9c685d1 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Renames the BpkGraphicPromo slot parameter from image to background to better reflect that it supports arbitrary composables (including BpkVideoPlayer), and updates docs + demo usage accordingly.
Changes:
- Renamed
BpkGraphicPromo/ internal impl parameter fromimagetobackground. - Added a demo story showcasing a sponsored graphic promo with a video background.
- Updated Compose docs to reflect the rename and document video backgrounds.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/compose/GraphicPromo/README.md | Updates API examples to use background and documents video background usage. |
| backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/graphicpromotion/internal/BpkGraphicPromoImpl.kt | Renames internal slot parameter and wires it through to existing layout branches. |
| backpack-compose/src/main/kotlin/net/skyscanner/backpack/compose/graphicpromotion/BpkGraphicPromo.kt | Renames the public API parameter and forwards it to the impl. |
| backpack-compose/src/androidTest/kotlin/net/skyscanner/backpack/compose/graphicpromotion/BpkGraphicPromoTest.kt | Updates tests to use the renamed parameter. |
| app/src/main/java/net/skyscanner/backpack/demo/compose/GraphicPromoStory.kt | Adds a new demo-only story using BpkVideoPlayer as the graphic promo background and updates the existing sample call site. |
| "https://content.skyscnr.com/media/68afbd83-d09a-48e8-9821-90c117b8f842/593d0fe4-5459-4c43-beb9-49f9ce79d365.m3u8" | ||
|
|
| painter = painterResource(id = R.drawable.skyland), | ||
| contentDescription = "Image", | ||
| contentScale = ContentScale.Fit, | ||
| ) | ||
| }, |
| Image( | ||
| modifier = Modifier.matchParentSize(), | ||
| painter = painterResource(id = R.drawable.graphic_promo), | ||
| contentDescription = "Image", | ||
| contentScale = ContentScale.Crop, | ||
| ) |
Summary
BpkGraphicPromo'simage: @Composable BoxScope.() -> Unitparameter tobackground. The parameter already accepted any composable, so it was never actually limited to images the way iOS'sBPKGraphicPromowas prior to backpack-ios#2593 — this rename aligns naming with iOS'sBackground: Viewgeneric and makes it explicit that the slot supportsBpkVideoPlayer(backpack-ios#2606 on iOS,BpkVideoPlayerfrommuon-1847-bpkvideoon Android).GraphicPromoStorySponsoredWithVideoBackground) showing a sponsoredBpkGraphicPromousingBpkVideoPlayeras its background, mirroring iOS's example app use case from OGM-4200: Fix BpkCellItem vertical padding #2606.docs/compose/GraphicPromo/README.mdwith the renamed parameter and a new "Sponsored with a video background" section.Breaking change
BpkGraphicPromo'simageparameter is renamed tobackground. Kotlin doesn't support two overloads that differ only by parameter name with identical types, so there's no backward-compatible way to keepimageworking — existing callers need a one-line rename (image = { ... }→background = { ... }).Base branch
Stacked on top of
muon-1847-bpkvideo(not yet merged) since it usesBpkVideoPlayerin the new demo story. Do not merge beforemuon-1847-bpkvideo.Test plan
:backpack-compose:compileDebugKotlin,:app:compileOssDebugKotlincompile cleanly:backpack-compose:compileDebugAndroidTestKotlin,:app:compileOssDebugUnitTestKotlincompile cleanly🤖 Generated with Claude Code