Skip to content

Commit

Permalink
Add example of usage to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Saidu Ernest Kamara committed Sep 22, 2023
1 parent 6a2b5dd commit 9fb961b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion docs/compose/GraphicPromo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
},
)
```

0 comments on commit 9fb961b

Please sign in to comment.