android-custom-icons
Original:🇺🇸 English
Translated
Use custom PNG icons in Android apps instead of library icons. Enforces placeholder usage, standard directory, and PROJECT_ICONS.md tracking. Applies to Jetpack Compose and XML layouts.
1installs
Added on
NPX Install
npx skill4agent add peterbamuhigire/skills-web-dev android-custom-iconsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Android Custom PNG Icons
Use custom PNG icons in Android apps instead of icon libraries. Whenever UI code includes an icon, the agent must use a PNG placeholder and update so the icon list is tracked for later upload.
PROJECT_ICONS.mdScope
Use for: All Android UI generation (Compose and XML).
Do not use: Material Icons, Font Awesome, or any bundled icon libraries unless the user explicitly asks for them.
Standard Icon Directory
- Primary location:
app/src/main/res/drawable/ - If you need 1:1 pixels (no scaling):
app/src/main/res/drawable-nodpi/
If multiple densities are provided later, place them in,drawable-hdpi,drawable-xhdpi,drawable-xxhdpiusing the same file name.drawable-xxxhdpi
File Naming Rules (Required)
- Lowercase letters, numbers, underscores only
- No hyphens, no spaces, no uppercase
- File name becomes
R.drawable.<name>
Examples:
- ->
cancel.pngR.drawable.cancel - ->
chart.pngR.drawable.chart - ->
filter.pngR.drawable.filter
Compose Usage (Required)
kotlin
Icon(
painter = painterResource(R.drawable.cancel),
contentDescription = "Cancel",
modifier = Modifier.size(24.dp)
)kotlin
Image(
painter = painterResource(R.drawable.chart),
contentDescription = null,
modifier = Modifier.size(48.dp)
)XML Usage (Required)
xml
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/cancel"
android:contentDescription="@string/cancel" />PROJECT_ICONS.md (Required)
Maintain a file at the project root. Every time code introduces a new icon placeholder, append a row.
PROJECT_ICONS.mdTemplate
markdown
# Project Icons
Standard path: app/src/main/res/drawable/
| Icon File | Usage | Screen/Component | Status | Notes |
| ---------- | ------------ | ----------------- | ----------- | ---------------- |
| cancel.png | Close action | EditProfileTopBar | placeholder | Provide 24dp PNG |Update Rules
- Add a row every time a new icon placeholder is referenced in code.
- Use the exact file name used in code (e.g., ).
cancel.png - Keep status as until the PNG is provided.
placeholder
Mandatory Checklist (Per UI Generation)
- Use PNG placeholders only (no icon libraries)
- Use or
painterResource(R.drawable.<name>)@drawable/<name> - Add or update
PROJECT_ICONS.md - Placeholders use valid Android resource naming