Describe the problem
There is a typo on the code shown on this codelab. Instead of using Modifier, it uses modifier, which is wrong because it causes an additional padding of 32.dp under the switch by inheriting the parent's modifier.
Note that the code provided on the GitHub repo (https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator.git) uses in fact Modifier instead of modifier, which is right.
Solution
Change this:
In the Switch composable, add this modifier to align the Switch composable to the end of the screen:
URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-calculate-tip?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-calculate-tip#8
Describe the problem There is a typo on the code shown on this codelab. Instead of using Modifier, it uses modifier, which is wrong because it causes an additional padding of 32.dp under the switch by inheriting the parent's modifier. Note that the code provided on the GitHub repo (https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator.git) uses in fact Modifier instead of modifier, which is right.
Solution Change this:
into this: