16
16
17
17
package com.example.compose.jetsurvey.signinsignup
18
18
19
- import androidx.compose.foundation.AmbientTextStyle
20
19
import androidx.compose.foundation.ScrollableColumn
21
- import androidx.compose.foundation.Text
22
20
import androidx.compose.foundation.layout.Box
23
21
import androidx.compose.foundation.layout.Column
24
22
import androidx.compose.foundation.layout.Row
@@ -29,20 +27,24 @@ import androidx.compose.foundation.layout.padding
29
27
import androidx.compose.foundation.layout.preferredHeight
30
28
import androidx.compose.foundation.layout.preferredWidth
31
29
import androidx.compose.foundation.layout.wrapContentSize
32
- import androidx.compose.material.AmbientEmphasisLevels
30
+ import androidx.compose.foundation.text.KeyboardOptions
31
+ import androidx.compose.material.AmbientContentAlpha
32
+ import androidx.compose.material.AmbientTextStyle
33
+ import androidx.compose.material.ContentAlpha
33
34
import androidx.compose.material.Icon
34
35
import androidx.compose.material.IconButton
35
36
import androidx.compose.material.MaterialTheme
36
37
import androidx.compose.material.OutlinedButton
37
38
import androidx.compose.material.OutlinedTextField
38
- import androidx.compose.material.ProvideEmphasis
39
39
import androidx.compose.material.Surface
40
+ import androidx.compose.material.Text
40
41
import androidx.compose.material.TopAppBar
41
42
import androidx.compose.material.icons.Icons
42
43
import androidx.compose.material.icons.filled.ChevronLeft
43
44
import androidx.compose.material.icons.filled.Visibility
44
45
import androidx.compose.material.icons.filled.VisibilityOff
45
46
import androidx.compose.runtime.Composable
47
+ import androidx.compose.runtime.Providers
46
48
import androidx.compose.runtime.mutableStateOf
47
49
import androidx.compose.runtime.remember
48
50
import androidx.compose.ui.Alignment
@@ -117,7 +119,7 @@ fun Email(
117
119
emailState.text = it
118
120
},
119
121
label = {
120
- ProvideEmphasis (emphasis = AmbientEmphasisLevels .current .medium) {
122
+ Providers ( AmbientContentAlpha provides ContentAlpha .medium) {
121
123
Text (
122
124
text = stringResource(id = R .string.email),
123
125
style = MaterialTheme .typography.body2
@@ -133,7 +135,7 @@ fun Email(
133
135
},
134
136
textStyle = MaterialTheme .typography.body2,
135
137
isErrorValue = emailState.showErrors(),
136
- imeAction = imeAction,
138
+ keyboardOptions = KeyboardOptions . Default .copy( imeAction = imeAction) ,
137
139
onImeActionPerformed = { action, softKeyboardController ->
138
140
if (action == ImeAction .Done ) {
139
141
softKeyboardController?.hideSoftwareKeyboard()
@@ -170,7 +172,7 @@ fun Password(
170
172
},
171
173
textStyle = MaterialTheme .typography.body2,
172
174
label = {
173
- ProvideEmphasis (emphasis = AmbientEmphasisLevels .current .medium) {
175
+ Providers ( AmbientContentAlpha provides ContentAlpha .medium) {
174
176
Text (
175
177
text = label,
176
178
style = MaterialTheme .typography.body2
@@ -194,7 +196,7 @@ fun Password(
194
196
PasswordVisualTransformation ()
195
197
},
196
198
isErrorValue = passwordState.showErrors(),
197
- imeAction = imeAction,
199
+ keyboardOptions = KeyboardOptions . Default .copy( imeAction = imeAction) ,
198
200
onImeActionPerformed = { action, softKeyboardController ->
199
201
if (action == ImeAction .Done ) {
200
202
softKeyboardController?.hideSoftwareKeyboard()
@@ -231,7 +233,7 @@ fun OrSignInAsGuest(
231
233
horizontalAlignment = Alignment .CenterHorizontally
232
234
) {
233
235
Surface {
234
- ProvideEmphasis (emphasis = AmbientEmphasisLevels .current .medium) {
236
+ Providers ( AmbientContentAlpha provides ContentAlpha .medium) {
235
237
Text (
236
238
text = stringResource(id = R .string.or ),
237
239
style = MaterialTheme .typography.subtitle2
0 commit comments