-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump androidx.compose:compose-bom from 2024.08.00 to 2024.09.01 #2089
Changes from 4 commits
19dbe3f
a2e8e3f
55b219c
dd9b813
acf8d1e
eb71255
dd3ee5b
b3c51a6
d845075
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,18 +51,6 @@ class BpkBottomSheetState internal constructor( | |
internal val delegate: SheetState, | ||
) { | ||
|
||
constructor( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we only ever use this with the remember function. there was a breaking change with a new density param, but as we're only using it with the remember function anyways might as well remove it instead |
||
initialValue: BpkBottomSheetValue = BpkBottomSheetValue.Collapsed, | ||
confirmValueChange: (BpkBottomSheetValue) -> Boolean = { true }, | ||
) : this( | ||
SheetState( | ||
skipPartiallyExpanded = false, | ||
skipHiddenState = true, | ||
initialValue = initialValue.toBottomSheetValue(), | ||
confirmValueChange = { confirmValueChange(it.toBpkBottomSheetValue()) }, | ||
), | ||
) | ||
|
||
val currentValue: BpkBottomSheetValue | ||
get() = delegate.currentValue.toBpkBottomSheetValue() | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,18 +53,6 @@ class BpkModalBottomSheetState internal constructor( | |
internal val delegate: SheetState, | ||
) { | ||
|
||
constructor( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
initialValue: BpkModalBottomSheetValue = BpkModalBottomSheetValue.Hidden, | ||
confirmValueChange: (BpkModalBottomSheetValue) -> Boolean = { true }, | ||
) : this( | ||
SheetState( | ||
skipPartiallyExpanded = false, | ||
skipHiddenState = false, | ||
initialValue = initialValue.toBottomSheetValue(), | ||
confirmValueChange = { confirmValueChange(it.toBpkBottomSheetValue()) }, | ||
), | ||
) | ||
|
||
val currentValue: BpkModalBottomSheetValue | ||
get() = delegate.currentValue.toBpkBottomSheetValue() | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,17 +29,16 @@ import androidx.compose.foundation.layout.defaultMinSize | |
import androidx.compose.foundation.layout.requiredHeight | ||
import androidx.compose.foundation.layout.requiredSize | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.ripple.LocalRippleTheme | ||
import androidx.compose.material.ripple.RippleAlpha | ||
import androidx.compose.material.ripple.RippleTheme | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.LocalRippleConfiguration | ||
import androidx.compose.material3.RippleConfiguration | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.painter.Painter | ||
import androidx.compose.ui.semantics.Role | ||
import androidx.compose.ui.semantics.clearAndSetSemantics | ||
|
@@ -59,7 +58,9 @@ import net.skyscanner.backpack.compose.tokens.BpkBorderRadius | |
import net.skyscanner.backpack.compose.tokens.BpkSpacing | ||
import net.skyscanner.backpack.compose.utils.applyIf | ||
import net.skyscanner.backpack.compose.utils.hideContentIf | ||
import net.skyscanner.backpack.compose.utils.toRippleAlpha | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
internal fun BpkButtonImpl( | ||
onClick: () -> Unit, | ||
|
@@ -74,7 +75,12 @@ internal fun BpkButtonImpl( | |
) { | ||
val clickable = enabled && !loading | ||
|
||
CompositionLocalProvider(LocalRippleTheme provides ButtonRippleTheme(type.rippleColor())) { | ||
CompositionLocalProvider( | ||
LocalRippleConfiguration provides RippleConfiguration( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ripple theme is gone - there's now |
||
type.rippleColor(), | ||
type.rippleColor().toRippleAlpha(), | ||
), | ||
) { | ||
Button( | ||
onClick = onClick, | ||
enabled = clickable, | ||
|
@@ -168,21 +174,6 @@ internal fun ButtonDrawable( | |
) | ||
} | ||
|
||
private class ButtonRippleTheme( | ||
private val color: Color = Color.Black, | ||
) : RippleTheme { | ||
|
||
private val alpha = RippleAlpha(color.alpha, color.alpha, color.alpha, color.alpha) | ||
|
||
@Composable | ||
override fun defaultColor(): Color = | ||
color | ||
|
||
@Composable | ||
override fun rippleAlpha(): RippleAlpha = | ||
alpha | ||
} | ||
|
||
private val ButtonShape = RoundedCornerShape(BpkBorderRadius.Sm) | ||
|
||
private fun Modifier.defaultIconSize(size: BpkIconSize): Modifier = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.selection.triStateToggleable | ||
import androidx.compose.material3.CheckboxDefaults | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.LocalMinimumTouchTargetEnforcement | ||
import androidx.compose.material3.LocalMinimumInteractiveComponentSize | ||
import androidx.compose.material3.TriStateCheckbox | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
|
@@ -38,6 +38,7 @@ import androidx.compose.ui.semantics.Role | |
import androidx.compose.ui.semantics.invisibleToUser | ||
import androidx.compose.ui.semantics.semantics | ||
import androidx.compose.ui.state.ToggleableState | ||
import androidx.compose.ui.unit.Dp | ||
import net.skyscanner.backpack.compose.text.BpkText | ||
import net.skyscanner.backpack.compose.theme.BpkTheme | ||
import net.skyscanner.backpack.compose.tokens.BpkSpacing | ||
|
@@ -153,7 +154,7 @@ private fun BpkCheckboxImpl( | |
) { | ||
// our design system isn't designed with the minimum touch target in mind at the moment. | ||
// Disable the enforcement to avoid the extra padding | ||
CompositionLocalProvider(LocalMinimumTouchTargetEnforcement provides false) { | ||
CompositionLocalProvider(LocalMinimumInteractiveComponentSize provides Dp.Unspecified) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this has also been changed |
||
TriStateCheckbox( | ||
state = state, | ||
onClick = onClick, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.selection.selectable | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.ripple.rememberRipple | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
|
@@ -49,6 +48,7 @@ import net.skyscanner.backpack.compose.icon.BpkIcon | |
import net.skyscanner.backpack.compose.icon.BpkIconSize | ||
import net.skyscanner.backpack.compose.text.BpkText | ||
import net.skyscanner.backpack.compose.theme.BpkTheme | ||
import net.skyscanner.backpack.compose.theme.bpkRipple | ||
import net.skyscanner.backpack.compose.tokens.BpkBorderRadius | ||
import net.skyscanner.backpack.compose.tokens.BpkBorderSize | ||
import net.skyscanner.backpack.compose.tokens.BpkElevation | ||
|
@@ -85,7 +85,7 @@ internal fun BpkChipImpl( | |
selected = selected, | ||
enabled = enabled, | ||
interactionSource = interactionSource, | ||
indication = rememberRipple(), | ||
indication = bpkRipple(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added a new helper function for using the ripple directly |
||
) { onSelectedChange!!.invoke(!selected) } | ||
}, | ||
) | ||
|
@@ -112,7 +112,7 @@ internal fun BpkDismissibleChipImpl( | |
clip(ChipShape) | ||
.clickable( | ||
interactionSource = interactionSource, | ||
indication = rememberRipple(), | ||
indication = bpkRipple(), | ||
) { onClick!!.invoke() } | ||
}, | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed this function and made it public, so we don't need to maintain two versions (one in the app and one in backpack)