Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material Theming: Android Basics with Compose #102

Open
goetzl opened this issue Aug 15, 2024 · 0 comments
Open

Material Theming: Android Basics with Compose #102

goetzl opened this issue Aug 15, 2024 · 0 comments

Comments

@goetzl
Copy link

goetzl commented Aug 15, 2024

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

In which task and step of the codelab can this issue be found?
Add typography, step 6

Describe the problem
This provided code does not build:
MaterialTheme(
colors = colors,
typography = Typography,
shapes = Shapes,
content = content
)
because
Type mismatch: inferred type is kotlin.text.Typography but androidx.compose.material3.Typography was expected

The solution is use to qualify the class:
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)

Steps to reproduce?

  1. build

. See error above

Versions
Android Studio version: Android Studio Koala | 2024.1.1 Patch 1
Build #AI-241.18034.62.2411.12071903, built on July 10, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4074M
Cores: 16

API version of the emulator: not needed to reproduce

Additional information
The solution is to qualify the type of typography
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant