google-developer-training / basic-android-kotlin-compose-training-courses

Apache License 2.0
27 stars 15 forks source link

Build a Grid: Android Basics with Compose #17

Open CorentinSol opened 2 months ago

CorentinSol commented 2 months ago

URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-practice-grid?hl=fr&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-2%3Fhl%3Dfr%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-practice-grid#3

In which task and step of the codelab can this issue be found? Step 4, when you have to copy two code samples

Describe the problem There are some missing lines of code in both code samples, so the app doesn't contain every topic data when copying the code.

Steps to reproduce? Not needed

Versions Not needed

Additional information There are fixed code samples I did based on screenshots:

for strings.xml

<resources>
    <string name="app_name">Topics</string>

    <string name="architecture">Architecture</string>
    <string name="crafts">Crafts</string>
    <string name="business">Business</string>
    <string name="culinary">Culinary</string>
    <string name="design">Design</string>
    <string name="fashion">Fashion</string>
    <string name="film">Film</string>
    <string name="gaming">Gaming</string>
    <string name="drawing">Drawing</string>
    <string name="lifestyle">Lifestyle</string>
    <string name="music">Music</string>
    <string name="painting">Painting</string>
    <string name="photography">Photography</string>
    <string name="tech">Tech</string>
    <string name="automotive">Automotive</string>
    <string name="biology">Biology</string>
    <string name="ecology">Ecology</string>
    <string name="engineering">Engineering</string>
    <string name="finance">Finance</string>
    <string name="geology">Geology</string>
    <string name="history">History</string>
    <string name="journalism">Journalism</string>
    <string name="law">Law</string>
    <string name="physics">Physics</string>
</resources>

for DataSource.kt

object DataSource {
    val topics = listOf(
        Topic(R.string.architecture, 58, R.drawable.architecture),
            Topic(R.string.architecture, 58, R.drawable.architecture),
            Topic(R.string.crafts, 121, R.drawable.crafts),
            Topic(R.string.business, 78, R.drawable.business),
            Topic(R.string.culinary, 118, R.drawable.culinary),
            Topic(R.string.design, 423, R.drawable.design),
            Topic(R.string.fashion, 92, R.drawable.fashion),
            Topic(R.string.film, 165, R.drawable.film),
            Topic(R.string.gaming, 164, R.drawable.gaming),
            Topic(R.string.drawing, 326, R.drawable.drawing),
            Topic(R.string.lifestyle, 305, R.drawable.lifestyle),
            Topic(R.string.music, 212, R.drawable.music),
            Topic(R.string.painting, 172, R.drawable.painting),
            Topic(R.string.photography, 321, R.drawable.photography),
            Topic(R.string.tech, 118, R.drawable.tech),
            Topic(R.string.automotive, 30, R.drawable.automotive),
            Topic(R.string.biology, 90, R.drawable.biology),
            Topic(R.string.ecology, 28, R.drawable.ecology),
            Topic(R.string.engineering, 67, R.drawable.engineering),
            Topic(R.string.finance, 100, R.drawable.finance),
            Topic(R.string.geology, 290, R.drawable.geology),
            Topic(R.string.history, 189, R.drawable.history),
            Topic(R.string.journalism, 96, R.drawable.journalism),
            Topic(R.string.law, 58, R.drawable.law),
            Topic(R.string.physics, 41, R.drawable.physics)
    )
}
rosie-i commented 2 months ago

+1, came here to report this!

And the currently provided code snippets don't have enough courses to require the grid to scroll on most devices, so it's quite noticeable.