From 9fb961b5f55698ebb349e951d9fff79f6e2ea3bd Mon Sep 17 00:00:00 2001 From: Saidu Ernest Kamara Date: Fri, 22 Sep 2023 12:03:32 +0100 Subject: [PATCH] Add example of usage to README.md --- docs/compose/GraphicPromo/README.md | 33 ++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/compose/GraphicPromo/README.md b/docs/compose/GraphicPromo/README.md index b5872f0486..57ca9639f8 100644 --- a/docs/compose/GraphicPromo/README.md +++ b/docs/compose/GraphicPromo/README.md @@ -19,9 +19,40 @@ Backpack Compose is available through [Maven Central](https://search.maven.org/a Example of a GraphicPromo: ```Kotlin +import android.util.Log import net.skyscanner.backpack.compose.graphicpromotion.BpkGraphicPromo +import net.skyscanner.backpack.compose.graphicpromotion.Sponsor +import net.skyscanner.backpack.compose.graphicpromotion.VerticalAlignment +import net.skyscanner.backpack.compose.overlay.BpkOverlayType + BpkGraphicPromo( - // TODO + kicker = "Travel tips", + headline = "Three Parks Challenge", + subHeadline = "How to complete the climb in 3 days", + verticalAlignment = VerticalAlignment.Bottom, + overlayType = BpkOverlayType.SolidHigh, + sponsor = Sponsor( + accessibilityLabel = "Sponsored", + logo = "https://images.kiwi.com/airlines/64/FR.png", + title = "Sponsored", + ), + image = { + Image( + modifier = Modifier.matchParentSize(), + painter = painterResource(id = R.drawable.graphic_promo), + contentDescription = "Image", + contentScale = ContentScale.Crop, + ) + }, sponsorLogo = { + Image( + painter = painterResource(id = R.drawable.skyland,), + contentDescription = "Image", + contentScale = ContentScale.Fit, + ) + }, + tapAction = { + Log.d("TAG", "Tap on graphic promo") + }, ) ```