@@ -21,7 +21,7 @@ import androidx.compose.foundation.Image
21
21
import androidx.compose.foundation.layout.Column
22
22
import androidx.compose.foundation.layout.fillMaxSize
23
23
import androidx.compose.foundation.layout.fillMaxWidth
24
- import androidx.compose.foundation.layout.offsetPx
24
+ import androidx.compose.foundation.layout.offset
25
25
import androidx.compose.foundation.layout.padding
26
26
import androidx.compose.foundation.layout.preferredHeight
27
27
import androidx.compose.foundation.layout.wrapContentHeight
@@ -42,14 +42,14 @@ import androidx.compose.ui.Modifier
42
42
import androidx.compose.ui.layout.boundsInParent
43
43
import androidx.compose.ui.layout.onGloballyPositioned
44
44
import androidx.compose.ui.layout.onSizeChanged
45
- import androidx.compose.ui.platform.DensityAmbient
45
+ import androidx.compose.ui.platform.AmbientDensity
46
46
import androidx.compose.ui.res.stringResource
47
47
import androidx.compose.ui.res.vectorResource
48
48
import androidx.compose.ui.text.input.ImeAction
49
49
import androidx.compose.ui.text.style.TextAlign
50
+ import androidx.compose.ui.tooling.preview.Preview
50
51
import androidx.compose.ui.unit.Dp
51
52
import androidx.compose.ui.unit.dp
52
- import androidx.ui.tooling.preview.Preview
53
53
import com.example.compose.jetsurvey.R
54
54
import com.example.compose.jetsurvey.theme.JetsurveyTheme
55
55
@@ -68,12 +68,12 @@ fun WelcomeScreen(onEvent: (WelcomeEvent) -> Unit) {
68
68
currentOffsetHolder.value = animate(
69
69
if (showBranding) 0f else - brandingBottom
70
70
)
71
- val heightDp = with (DensityAmbient .current) { heightWithBranding.toDp() }
71
+ val heightDp = with (AmbientDensity .current) { heightWithBranding.toDp() }
72
72
Surface (modifier = Modifier .fillMaxSize()) {
73
73
Column (
74
74
modifier = Modifier .fillMaxWidth()
75
75
.brandingPreferredHeight(showBranding, heightDp)
76
- .offsetPx (y = currentOffsetHolder)
76
+ .offset (y = { currentOffsetHolder.value } )
77
77
.onSizeChanged {
78
78
if (showBranding) {
79
79
heightWithBranding = it.height
@@ -125,16 +125,16 @@ private fun Branding(modifier: Modifier = Modifier) {
125
125
126
126
@Composable
127
127
private fun Logo (
128
- lightTheme : Boolean = MaterialTheme .colors.isLight ,
129
- modifier : Modifier = Modifier
128
+ modifier : Modifier = Modifier ,
129
+ lightTheme : Boolean = MaterialTheme .colors.isLight
130
130
) {
131
131
val assetId = if (lightTheme) {
132
132
R .drawable.ic_logo_light
133
133
} else {
134
134
R .drawable.ic_logo_dark
135
135
}
136
136
Image (
137
- asset = vectorResource(id = assetId),
137
+ imageVector = vectorResource(id = assetId),
138
138
modifier = modifier
139
139
)
140
140
}
0 commit comments