You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In which task and step of the codelab can this issue be found?
Step 7: Adding padding
Describe the problem
When adding the new code: modifier = Modifier.padding(24.dp), the codelab should instruct the learner that dp must be imported or else the code won't work. This is probably the first time the learner has to import something so it's crucial to teach how to do this.
import androidx.compose.ui.unit.dp
How to improve it
Here's an example:
"Notice that when you add a padding modifier to the text with a size of 24.dp, the dp text is red. This is happening because you need to import dp first in order for your code to compile. Fixing this error is simple thanks to Android Studio. Simply highlight the text and press Alt+Enter in PC/Linux or Option+Enter in Mac. Import should be highlighted by default so just press Enter.
If you don't do this and try Build & Refresh, you will get an "Unresolved reference: dp" error."
The text was updated successfully, but these errors were encountered:
michaelssim
changed the title
First Android app: Android Basics in Compose
First Android app: Android Basics in Compose - Step 7 does not teach the learner how to import dpMay 19, 2022
Comment
As mentioned in the original issue, this should be taught earlier because the discussion of dp happens before the learner reaches Pathway 3. So this is being taught a step late.
@michaelssim
The issue that you presented to us is extremely important, and I thank you for bringing it to our attention. The content of the codelab was updated and published:
URL of codelab
In which task and step of the codelab can this issue be found?
Step 7: Adding padding
Describe the problem
When adding the new code:
modifier = Modifier.padding(24.dp)
, the codelab should instruct the learner thatdp
must be imported or else the code won't work. This is probably the first time the learner has to import something so it's crucial to teach how to do this.import androidx.compose.ui.unit.dp
How to improve it
Here's an example:
"Notice that when you add a padding modifier to the text with a size of 24.dp, the
dp
text is red. This is happening because you need to importdp
first in order for your code to compile. Fixing this error is simple thanks to Android Studio. Simply highlight the text and press Alt+Enter in PC/Linux or Option+Enter in Mac. Import should be highlighted by default so just press Enter.If you don't do this and try Build & Refresh, you will get an "Unresolved reference: dp" error."
The text was updated successfully, but these errors were encountered: