google-developer-training / basic-android-kotlin-compose-training-tip-calculator

Apache License 2.0
61 stars 97 forks source link

Intro to state in Compose: Android Basics with Compose #232

Open SaiTeja77949 opened 2 months ago

SaiTeja77949 commented 2 months ago

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-compose-using-state?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-using-state#2

In which task and step of the codelab can this issue be found? Intro to state of compose Step: 3

Describe the problem

fun EditNumberField(modifier: Modifier = Modifier) { TextField( value = "", onValueChange = {}, modifier = modifier ) }

EditNumberField(modifier = Modifier.padding(bottom = 32.dp).fillMaxWidth())

If we do this the TextField element will not align with the other texts (calculate tip and Tip amount) To solve this In text field we need to do : TextField( value = "", onValueChange = {}, modifier = Modifier.fillMaxWidth() )

Versions Android Studio version: iguana

image