Layouts codelab; "Compose also comes with some pr...
# compose
c
Layouts codelab; "Compose also comes with some predefined Material icons you can use, for example the closefavorite and menu icons." Does this mean my apk automatically includes all material icons? Or do they only get packaged in if I reference them in a composable?
l
androidx.compose.material:material
includes ~50 (the most commonly used) icons out of the box, so if you have the Material dependency these will be included. There's also the separate
androidx.compose.material:material-icons-extended
dependency that includes every icon, but these aren't included by default
s
I guess if you use R8, it will remove the not usage icons. Material Icons is code generated and not resource files if I recall.
l
Yup, the icons are just functions - so R8 will remove anything that isn't referenced
🎉 1