diff --git a/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/ui/atom/items/IconItems.kt b/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/ui/atom/items/IconItems.kt index 3938d185d..b241c8fef 100644 --- a/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/ui/atom/items/IconItems.kt +++ b/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/ui/atom/items/IconItems.kt @@ -24,19 +24,23 @@ fun LazyGridScope.iconItems() { } private inline fun LazyGridScope.getIconsFor(icons: T) { - for (field in T::class.java.declaredFields) { - if (field.name in exclusions) continue - item { - field.isAccessible = true - IconItem( - name = field.name.replaceFirstChar { it.uppercase() }, - imageVector = field.get(icons) as ImageVector, - ) + for (method in T::class.java.methods) { + if (exclusions.contains(method.name)) { + continue + } else if (method.name.startsWith("get")) { + item { + method.isAccessible = true + val imageVector = method.invoke(icons) as ImageVector + IconItem( + name = method.name.replaceFirst("get", ""), + imageVector = imageVector, + ) + } } } } -private val exclusions = listOf("\$stable", "INSTANCE") +private val exclusions = listOf("getClass") @Composable private fun IconItem(