@@ -38,13 +38,13 @@ import androidx.compose.foundation.lazy.LazyRow
38
38
import androidx.compose.foundation.lazy.items
39
39
import androidx.compose.foundation.lazy.rememberLazyListState
40
40
import androidx.compose.foundation.shape.RoundedCornerShape
41
- import androidx.compose.material.AmbientContentAlpha
42
41
import androidx.compose.material.ContentAlpha
43
42
import androidx.compose.material.Divider
44
43
import androidx.compose.material.ExperimentalMaterialApi
45
44
import androidx.compose.material.FractionalThreshold
46
45
import androidx.compose.material.Icon
47
46
import androidx.compose.material.IconButton
47
+ import androidx.compose.material.LocalContentAlpha
48
48
import androidx.compose.material.MaterialTheme
49
49
import androidx.compose.material.Surface
50
50
import androidx.compose.material.Text
@@ -67,9 +67,9 @@ import androidx.compose.ui.Modifier
67
67
import androidx.compose.ui.gesture.scrollorientationlocking.Orientation
68
68
import androidx.compose.ui.graphics.Color
69
69
import androidx.compose.ui.graphics.graphicsLayer
70
- import androidx.compose.ui.platform.AmbientDensity
70
+ import androidx.compose.ui.platform.LocalDensity
71
+ import androidx.compose.ui.res.painterResource
71
72
import androidx.compose.ui.res.stringResource
72
- import androidx.compose.ui.res.vectorResource
73
73
import androidx.compose.ui.text.style.TextAlign
74
74
import androidx.compose.ui.text.style.TextOverflow
75
75
import androidx.compose.ui.tooling.preview.Preview
@@ -89,7 +89,7 @@ import com.example.owl.ui.utils.NetworkImage
89
89
import com.example.owl.ui.utils.backHandler
90
90
import com.example.owl.ui.utils.lerp
91
91
import com.example.owl.ui.utils.scrim
92
- import dev.chrisbanes.accompanist.insets.AmbientWindowInsets
92
+ import dev.chrisbanes.accompanist.insets.LocalWindowInsets
93
93
import dev.chrisbanes.accompanist.insets.navigationBarsPadding
94
94
import dev.chrisbanes.accompanist.insets.statusBarsPadding
95
95
import dev.chrisbanes.accompanist.insets.toPaddingValues
@@ -119,7 +119,7 @@ fun CourseDetails(
119
119
PinkTheme {
120
120
BoxWithConstraints {
121
121
val sheetState = rememberSwipeableState(SheetState .Closed )
122
- val fabSize = with (AmbientDensity .current) { FabSize .toPx() }
122
+ val fabSize = with (LocalDensity .current) { FabSize .toPx() }
123
123
val dragRange = constraints.maxHeight - fabSize
124
124
125
125
backHandler(
@@ -201,7 +201,7 @@ private fun CourseDescriptionHeader(
201
201
)
202
202
}
203
203
Image (
204
- imageVector = vectorResource (id = R .drawable.ic_logo),
204
+ painter = painterResource (id = R .drawable.ic_logo),
205
205
contentDescription = null ,
206
206
modifier = Modifier
207
207
.padding(bottom = 4 .dp)
@@ -245,7 +245,7 @@ private fun CourseDescriptionBody(course: Course) {
245
245
.padding(horizontal = 16 .dp)
246
246
)
247
247
Spacer (modifier = Modifier .preferredHeight(16 .dp))
248
- Providers (AmbientContentAlpha provides ContentAlpha .medium) {
248
+ Providers (LocalContentAlpha provides ContentAlpha .medium) {
249
249
Text (
250
250
text = stringResource(id = R .string.course_desc),
251
251
style = MaterialTheme .typography.body1,
@@ -264,7 +264,7 @@ private fun CourseDescriptionBody(course: Course) {
264
264
.fillMaxWidth()
265
265
.padding(16 .dp)
266
266
)
267
- Providers (AmbientContentAlpha provides ContentAlpha .medium) {
267
+ Providers (LocalContentAlpha provides ContentAlpha .medium) {
268
268
Text (
269
269
text = stringResource(id = R .string.needs),
270
270
style = MaterialTheme .typography.body1,
@@ -337,8 +337,8 @@ private fun LessonsSheet(
337
337
updateSheet : (SheetState ) -> Unit
338
338
) {
339
339
// Use the fraction that the sheet is open to drive the transformation from FAB -> Sheet
340
- val fabSize = with (AmbientDensity .current) { FabSize .toPx() }
341
- val fabSheetHeight = fabSize + AmbientWindowInsets .current.systemBars.bottom
340
+ val fabSize = with (LocalDensity .current) { FabSize .toPx() }
341
+ val fabSheetHeight = fabSize + LocalWindowInsets .current.systemBars.bottom
342
342
val offsetX = lerp(width - fabSize, 0f , 0f , 0.15f , openFraction)
343
343
val offsetY = lerp(height - fabSheetHeight, 0f , openFraction)
344
344
val tlCorner = lerp(fabSize, 0f , 0f , 0.15f , openFraction)
@@ -351,8 +351,8 @@ private fun LessonsSheet(
351
351
)
352
352
Surface (
353
353
color = surfaceColor,
354
- contentColor = contentColorFor(color = MaterialTheme .colors.primarySurface),
355
- shape = RoundedCornerShape (topLeft = tlCorner),
354
+ contentColor = contentColorFor(backgroundColor = MaterialTheme .colors.primarySurface),
355
+ shape = RoundedCornerShape (topStart = tlCorner),
356
356
modifier = Modifier .graphicsLayer {
357
357
translationX = offsetX
358
358
translationY = offsetY
@@ -409,7 +409,7 @@ private fun Lessons(
409
409
}
410
410
LazyColumn (
411
411
state = scroll,
412
- contentPadding = AmbientWindowInsets .current.systemBars.toPaddingValues(
412
+ contentPadding = LocalWindowInsets .current.systemBars.toPaddingValues(
413
413
top = false
414
414
)
415
415
) {
@@ -465,7 +465,7 @@ private fun Lesson(lesson: Lesson) {
465
465
maxLines = 2 ,
466
466
overflow = TextOverflow .Ellipsis
467
467
)
468
- Providers (AmbientContentAlpha provides ContentAlpha .medium) {
468
+ Providers (LocalContentAlpha provides ContentAlpha .medium) {
469
469
Row (
470
470
modifier = Modifier .padding(top = 4 .dp),
471
471
verticalAlignment = Alignment .CenterVertically
0 commit comments