Add Material You themed launcher icon#142
Conversation
Previously the adaptive-icon XMLs declared only background + foreground, so on Android 13+ devices with Themed icons enabled, the launcher rendered an unbranded white blob (the full 108dp foreground tile tinted with the dynamic color). Wire up a proper monochrome layer so themed icons keep the Hackers' Pub cat silhouette. The stock @mipmap/ic_launcher_foreground raster can't be reused as the monochrome source because its background is opaque white rather than transparent — tinting it produces a solid colored square. Instead, add a dedicated @mipmap/ic_launcher_monochrome PNG at every density, derived from the foreground via ffmpeg: alpha = min(original_alpha, threshold curve on luma) with RGB = white. Black cat pixels become fully opaque; white-background and pre-existing transparent pixels become fully transparent. The system tints the alpha-masked silhouette at runtime. The .dev build gets its own monochrome asset so the themed icon preserves the DEV badge that distinguishes the debug installation — the same luma threshold works for the pink badge since it maps to mid-luma well below the threshold. The existing foreground rasters and background drawable are untouched, so rendering with Themed icons disabled is unchanged on every device (including pre-Android 13). While here, drop the redundant -v26 qualifier from the adaptive-icon folder: minSdk is already 26. Folder is now mipmap-anydpi/ for both variants, and debug now has its own adaptive-icon XML (previously it only had raster fallbacks and therefore didn't participate in themed icons at all). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (10)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis change adds Android adaptive icon resources for both regular and rounded icon variants. New adaptive icon XML files are created in the main resource directory, while debug variants are updated to include monochrome layer references for enhanced icon rendering support. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Actions performedReview triggered.
|

Summary
<monochrome>layer on the adaptive launcher icon so the app participates in Android 13+ Themed icons with a branded silhouette instead of a solid tinted blob..devdebug variant (cat + DEV badge).-v26resource qualifier sinceminSdk = 26makes it a no-op.Before / after
With Themed icons enabled on Android 13+:
.devWith Themed icons disabled (default on Android 12 and below, and most 13+ devices): unchanged on every variant — the existing foreground raster and background drawable are not modified.
Why the raster approach
The stock
@mipmap/ic_launcher_foregroundcan't be reused as the monochrome source because its background is opaque white rather than transparent — tinting it produces a solid colored square. Instead, I derived a dedicated@mipmap/ic_launcher_monochromeat every density from the foreground with ffmpeg:Black cat pixels (luma ≈ 0) become fully opaque; white-background and already-transparent pixels become fully transparent. The pink DEV badge in the debug foreground (luma ≈ 120) sits well below the threshold and is preserved fully opaque.
Files
app/src/main/res/mipmap-{mdpi..xxxhdpi}/ic_launcher_monochrome.png(new, 5 densities)app/src/debug/res/mipmap-{mdpi..xxxhdpi}/ic_launcher_monochrome.png(new, 5 densities — debug-specific so the DEV badge survives)app/src/main/res/mipmap-anydpi/ic_launcher{,_round}.xml(moved frommipmap-anydpi-v26, added<monochrome>line)app/src/debug/res/mipmap-anydpi/ic_launcher{,_round}.xml(new — debug previously had no adaptive XML at all)No existing icon file is modified (
git diffagainst the foreground rasters,ic_launcher_background.xml,ic_launcher_foreground.xml, and raster fallbacks is empty).Test plan
./gradlew :app:clean :app:assembleDebug— succeeds./gradlew :app:lintDebug— succeeds, no new warningsic_launcher_monochrome.pngpackaged at all 5 densities for both variants, existingic_launcher*.pngbyte-identical to main branch.devbuild shows tinted cat + DEV badge🤖 Generated with Claude Code