Skip to content

Commit

Permalink
[MUON-624] - Expose interactionSource to support custom animations (#…
Browse files Browse the repository at this point in the history
…2130)

Co-authored-by: Gabriel Ferreira <[email protected]>
  • Loading branch information
gabriellferreira and Gabriel Ferreira authored Nov 4, 2024
1 parent 34536c7 commit 30d9605
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

package net.skyscanner.backpack.compose.graphicpromotion

import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import net.skyscanner.backpack.compose.graphicpromotion.internal.BpkGraphicPromoImpl
import net.skyscanner.backpack.compose.overlay.BpkOverlayType
Expand All @@ -45,6 +47,7 @@ fun BpkGraphicPromo(
verticalAlignment: BpkGraphicPromoVerticalAlignment = BpkGraphicPromoVerticalAlignment.Top,
sponsor: BpkGraphicsPromoSponsor? = null,
sponsorLogo: (@Composable () -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
tapAction: () -> Unit = {},
) {
BpkGraphicPromoImpl(
Expand All @@ -58,6 +61,7 @@ fun BpkGraphicPromo(
sponsor = sponsor,
image = image,
sponsorLogo = sponsorLogo,
interactionSource = interactionSource,
tapAction = tapAction,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import net.skyscanner.backpack.compose.utils.isTablet
internal fun BpkGraphicPromoImpl(
headline: String,
image: @Composable BoxScope.() -> Unit,
interactionSource: MutableInteractionSource,
modifier: Modifier = Modifier,
kicker: String? = null,
subHeadline: String? = null,
Expand All @@ -86,7 +87,6 @@ internal fun BpkGraphicPromoImpl(
verticalAlignment: BpkGraphicPromoVerticalAlignment = BpkGraphicPromoVerticalAlignment.Top,
sponsor: BpkGraphicsPromoSponsor? = null,
sponsorLogo: (@Composable () -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
tapAction: () -> Unit = {},
) {
val (aspectRatio, maxHeight) = getDeviceConstrains()
Expand Down

0 comments on commit 30d9605

Please sign in to comment.