Skip to content

Commit 4ce2558

Browse files
authored
Updated dependencies, and made relevant code changes
1 parent 4e2613a commit 4ce2558

File tree

13 files changed

+51
-43
lines changed

13 files changed

+51
-43
lines changed

buildconvention/convention/src/main/kotlin/au/com/alfie/ecomm/buildconvention/AppConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package au.com.alfie.ecomm.buildconvention
22

33
object AppConfig {
44
const val applicationId = "au.com.alfie.ecomm"
5-
const val compileSdk = 34
5+
const val compileSdk = 35
66
const val minSdk = 29
77
const val targetSdk = 34
88
const val testRunnerPath = "androidx.test.runner.AndroidJUnitRunner"

debug/operational/src/main/java/au/com/alfie/ecomm/debug/operational/view/catalog/screen/DotsIndicatorScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private fun DotsIndicatorSection(
9595
val pagerState = rememberPagerState { PAGER_SIZE }
9696
HorizontalPager(
9797
state = pagerState,
98-
beyondBoundsPageCount = 2
98+
beyondViewportPageCount = 2
9999
) {
100100
Box(
101101
modifier = Modifier

debug/operational/src/main/java/au/com/alfie/ecomm/debug/operational/view/catalog/screen/SliderIndicatorScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private fun PagedSliderIndicator() {
155155
val pagerState = rememberPagerState { PAGER_SIZE }
156156
HorizontalPager(
157157
state = pagerState,
158-
beyondBoundsPageCount = 2
158+
beyondViewportPageCount = 2
159159
) {
160160
Box(
161161
modifier = Modifier

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/bottombar/BottomBar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import androidx.compose.foundation.layout.height
2222
import androidx.compose.foundation.layout.size
2323
import androidx.compose.foundation.layout.widthIn
2424
import androidx.compose.foundation.selection.selectableGroup
25-
import androidx.compose.material.ripple.rememberRipple
2625
import androidx.compose.material3.Icon
2726
import androidx.compose.material3.Surface
2827
import androidx.compose.material3.Text
28+
import androidx.compose.material3.ripple
2929
import androidx.compose.runtime.Composable
3030
import androidx.compose.runtime.getValue
3131
import androidx.compose.runtime.mutableIntStateOf
@@ -161,7 +161,7 @@ private fun BottomBarItem(
161161
onDoubleClick = onClick,
162162
role = Role.Tab,
163163
interactionSource = remember { MutableInteractionSource() },
164-
indication = rememberRipple(bounded = false)
164+
indication = ripple(bounded = false)
165165
)
166166
.defaultMinSize(minHeight = BOTTOM_BAR_HEIGHT)
167167
.widthIn(min = 86.dp)

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/gallery/EndlessGallery.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private fun NonZoomablePager(
173173
Box(contentAlignment = Alignment.TopEnd) {
174174
HorizontalPager(
175175
state = pagerState,
176-
beyondBoundsPageCount = 1,
176+
beyondViewportPageCount = 1,
177177
pageSpacing = Theme.spacing.spacing8,
178178
contentPadding = PaddingValues(horizontal = horizontalPadding)
179179
) { index ->

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/gallery/Gallery.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.Box
77
import androidx.compose.foundation.layout.BoxWithConstraints
88
import androidx.compose.foundation.layout.fillMaxSize
99
import androidx.compose.foundation.layout.offset
10-
import androidx.compose.material.ripple.rememberRipple
10+
import androidx.compose.material3.ripple
1111
import androidx.compose.runtime.Composable
1212
import androidx.compose.runtime.getValue
1313
import androidx.compose.runtime.mutableIntStateOf
@@ -95,7 +95,7 @@ fun Gallery(
9595
Box(
9696
modifier = Modifier
9797
.clickable(
98-
indication = rememberRipple(bounded = true),
98+
indication = ripple(bounded = false),
9999
interactionSource = remember { MutableInteractionSource() },
100100
onClick = {
101101
selectedIndex = index

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/input/TextField.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import androidx.compose.foundation.layout.width
1717
import androidx.compose.foundation.text.BasicTextField
1818
import androidx.compose.foundation.text.KeyboardActions
1919
import androidx.compose.foundation.text.KeyboardOptions
20-
import androidx.compose.material.ripple.rememberRipple
2120
import androidx.compose.material3.Icon
2221
import androidx.compose.material3.IconButton
2322
import androidx.compose.material3.Text
23+
import androidx.compose.material3.ripple
2424
import androidx.compose.runtime.Composable
2525
import androidx.compose.runtime.getValue
2626
import androidx.compose.runtime.mutableIntStateOf
@@ -259,7 +259,7 @@ private fun TextField(
259259
.padding(horizontal = Theme.spacing.spacing20)
260260
.indication(
261261
interactionSource = interactionSource,
262-
indication = rememberRipple(bounded = false)
262+
indication = ripple(bounded = false)
263263
),
264264
verticalAlignment = Alignment.CenterVertically
265265
) {

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/modal/BottomSheet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fun BottomSheet(
107107
bottomEnd = CornerSize(0.dp),
108108
bottomStart = CornerSize(0.dp)
109109
),
110-
windowInsets = WindowInsets(0.dp),
110+
contentWindowInsets = { WindowInsets(0.dp) },
111111
onDismissRequest = { onDismiss() },
112112
dragHandle = { }
113113
) {

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/searchbar/SearchTextField.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import androidx.compose.foundation.layout.width
1717
import androidx.compose.foundation.text.BasicTextField
1818
import androidx.compose.foundation.text.KeyboardActions
1919
import androidx.compose.foundation.text.KeyboardOptions
20-
import androidx.compose.material.ripple.rememberRipple
2120
import androidx.compose.material3.Icon
2221
import androidx.compose.material3.IconButton
2322
import androidx.compose.material3.Surface
2423
import androidx.compose.material3.Text
24+
import androidx.compose.material3.ripple
2525
import androidx.compose.runtime.Composable
2626
import androidx.compose.runtime.LaunchedEffect
2727
import androidx.compose.runtime.getValue
@@ -158,7 +158,7 @@ private fun DecorationBox(
158158
)
159159
.indication(
160160
interactionSource = interactionSource,
161-
indication = rememberRipple(bounded = false)
161+
indication = ripple(bounded = false)
162162
),
163163
verticalAlignment = Alignment.CenterVertically
164164
) {

designsystem/src/main/java/au/com/alfie/ecomm/designsystem/component/swipe/SwipeAnchored.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package au.com.alfie.ecomm.designsystem.component.swipe
22

33
import androidx.compose.animation.core.AnimationSpec
4+
import androidx.compose.animation.splineBasedDecay
45
import androidx.compose.foundation.ExperimentalFoundationApi
56
import androidx.compose.foundation.background
67
import androidx.compose.foundation.gestures.AnchoredDraggableState
@@ -37,24 +38,29 @@ fun SwipeAnchored(
3738
startOffset: (size: IntSize) -> Float = { 0f },
3839
partialOffset: (size: IntSize) -> Float = { it.height * FIFTY_PERCENT },
3940
positionalThreshold: (Float) -> Float = { it * FIFTY_PERCENT },
40-
animationSpec: () -> AnimationSpec<Float> = { standardAccelerate() },
41+
snapAnimationSpec: () -> AnimationSpec<Float> = { standardAccelerate() },
4142
allowNestedScroll: Boolean = true,
4243
onAnchorChange: suspend SwipeAnchoredScope.(SwipeAnchor) -> Unit = {},
4344
onOffset: (isInBetween: Boolean) -> Unit = { },
4445
content: @Composable SwipeAnchoredScope.() -> Unit
4546
) {
47+
val density = LocalDensity.current
48+
val decayAnimationSpec = remember(density) { splineBasedDecay<Float>(density) }
49+
4650
val anchoredDraggableState = rememberSaveable(
4751
saver = AnchoredDraggableState.Saver(
48-
animationSpec = animationSpec(),
52+
snapAnimationSpec = snapAnimationSpec(),
53+
decayAnimationSpec = decayAnimationSpec,
4954
positionalThreshold = positionalThreshold,
5055
velocityThreshold = velocityThreshold
5156
)
5257
) {
5358
AnchoredDraggableState(
5459
initialValue = initialAnchor,
60+
snapAnimationSpec = snapAnimationSpec(),
61+
decayAnimationSpec = decayAnimationSpec,
5562
positionalThreshold = positionalThreshold,
56-
velocityThreshold = velocityThreshold,
57-
animationSpec = animationSpec()
63+
velocityThreshold = velocityThreshold
5864
)
5965
}
6066
val scope = remember {

0 commit comments

Comments
 (0)