On the Compose icons, I can only find the “filled”...
# compose
d
On the Compose icons, I can only find the “filled” Star icon
Icons.Default.Star
but not the “empty” one. Anyone knows if it’s available?
d
yes, but I can’t find it on Compose icons
a
They have the same names, just pascal cased.
Copy code
Icons.Filled.StarBorder
Icons.Rounded.StarOutline
k
Some icons are available in the extended icons, so it is worth checking it if you haven't done so already.
implementation "androidx.compose.material:material-icons-extended:$compose_version"
d
@Andrew Neal @Kari Kähkönen thanks! you were both right! I had to include “material-icons-extended” and then all the other icons also showed up. This page says: https://developer.android.com/reference/kotlin/androidx/compose/material/icons/Icons “You can add a dependency on androidx.compose.material:material-icons-extended to access every icon, but note that due to the very large size of this dependency you should make sure to use R8 / ProGuard to remove unused icons from your application.” Do I need to manually specify something in ProGuard, or it does that automatically?
c
You need to enable proguard/r8 on your release builds via the
minifyEnabled
flag https://developer.android.com/studio/build/shrink-code#enable
d
@Colton Idle thanks!
c
note that proguard/r8 has nothing to do with compose. proguard is just a way to optimize/oobfuscate java code, and then r8 came just a few years ago as an android specific thing for the same purpose, but it uses the same proguard rule syntax. also proguard adds some time to generating a release build so be ready for that. also your crash reports could be obfuscated in production if you don't upload proguard mappings to crashlytics (or whatever service you use)
👍 1
a
@Colton Idle Actually R8 is not an Android specific tool. In this article, R8 is used to shrink the jar binary.
R8 is the code optimizer and obfuscator for Android builds. While it’s normally used to optimize and obfuscate Java classfiles during conversion to the Dalvik executable format, it also supports outputting Java classfiles.
c
Nice. TIL