File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
samples/compose-samples/src/main/java/com/squareup/sample/compose/textinput Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import androidx.compose.ui.unit.dp
19
19
import com.squareup.sample.compose.textinput.TextInputWorkflow.Rendering
20
20
import com.squareup.workflow1.ui.TextController
21
21
import com.squareup.workflow1.ui.compose.ScreenComposableFactory
22
- import com.squareup.workflow1.ui.compose.asMutableState
22
+ import com.squareup.workflow1.ui.compose.asMutableTextFieldValueState
23
23
import com.squareup.workflow1.ui.compose.tooling.Preview
24
24
25
25
val TextInputComposableFactory = ScreenComposableFactory <Rendering > { rendering ->
@@ -30,14 +30,14 @@ val TextInputComposableFactory = ScreenComposableFactory<Rendering> { rendering
30
30
.animateContentSize(),
31
31
horizontalAlignment = Alignment .CenterHorizontally
32
32
) {
33
- var text by rendering.textController.asMutableState ()
33
+ var textFieldValue by rendering.textController.asMutableTextFieldValueState ()
34
34
35
- Text (text = text)
35
+ Text (text = textFieldValue. text)
36
36
OutlinedTextField (
37
37
label = {},
38
38
placeholder = { Text (" Enter some text" ) },
39
- value = text ,
40
- onValueChange = { text = it }
39
+ value = textFieldValue ,
40
+ onValueChange = { textFieldValue = it }
41
41
)
42
42
Spacer (modifier = Modifier .height(8 .dp))
43
43
Button (onClick = rendering.onSwapText) {
You can’t perform that action at this time.
0 commit comments