Howdy! I just released a new version of “Compose ...
# feed
j
Howdy! I just released a new version of “Compose Resources Kit” (best name I could come up with). It’s an Intellij plugin for working with Compose Multiplatform Resources. As much as I love the CMP resources, there are a few pain points I encounter daily. This plugin attempts to alleviate some of those issues. It includes some features like: • Automatic running of
:<module>:generateResourceAccessors<source-set>
whenever a change to the resource folder is detected ◦ This means that when you add a new string for example, the Kotlin accessor will be generated without you needing to intervene ◦ It also attempts to trigger a Compose Preview refresh, but it doesn’t always work as intended. If anyone knows of a better way of tricking the preview to reload, let me knowSeveral resource related inspections Inspections: • Unused String resources • Resource navigation ◦ Supports Strings (plurals and string-array), Drawables, and Fonts. ◦ This means you can CMD+Click on a resource and it will navigate you to it. ◦ This also works in XML files for Strings, allowing you to CMD+Click and list the usages of it. • Unnecessary escapes ◦ On Android strings you need to escape characters like
'
,
"
, etc. That’s not required on Compose Multiplatform, but old habits die hard 😅 • Argument validation ◦ If a
StringResource
is defined with an argument like:
<string name="sample">Hello %1$s</string>
the inspection will warn you when you are attempting to use that string without passing in a value for that argument. You can check it out on the marketplace or the source on GitHub.
K 4
🔥 6