How to use Material Symbols in Android, Jetpack Compose and Kotlin
A step by step guide on using Google Font's Material Symbols in an Android app using Jetpack Compose and Kotlin.
What are Material Symbols ?
Tutorial
Step One: Add the Dependency
In your App Level build.gradle.kts file, add the following dependency
implementation("androidx.compose.material:material-icons-extended:1.4.3")
Please note that 1.4.3 may not be the latest version, please update the code above to the latest version in your Android Studio project.
Step Two: Sync the Gradles
Press Sync Now in the bar above the Gradle to update the project dependencies.
Step Three: Create a Composable
Create a composable in the project.
Follow our tutorial linked below to learn how to create a ConstraintLayout Composable.
Step Four: Implement a Symbol
Implement a symbol using code similar to the one below
Please note that the Check (default) is a symbol that's available. Consult the link below to learn about all the Material Symbols that are available.
Step Five: Test
Run the code and confirm that everything looks right.
Looking to apply Grade, Weight or Optical Size?
Unfortunately, the dependency that's available for the Material Icons does not yet provide this functionality. To integrate custom icons download the custom icon and add it to your project.