Skip to content

fix: proper icon sizing in drawables - #318

Merged
jeiel85 merged 2 commits into
jeiel85:mainfrom
ThatOneCalculator:fix/icon-foreground-size
Aug 15, 2026
Merged

fix: proper icon sizing in drawables#318
jeiel85 merged 2 commits into
jeiel85:mainfrom
ThatOneCalculator:fix/icon-foreground-size

Conversation

@ThatOneCalculator

Copy link
Copy Markdown
Contributor

Left is before, right is after. Also adds .debug suffix to debug builds.

image image

ThatOneCalculator and others added 2 commits August 14, 2026 15:22
Scaling the artwork into the adaptive-icon safe zone is right -- the leaf
reached 34dp from centre against a 33dp safe radius, so launchers clipped it.
Two things came along with that change:

The '#' veins were not scaled with the geometry. Everything else went through
the 512/108 = 4.7407 factor, but the foreground stroke landed on 8 instead of
11.852, leaving the foreground drawing the mark at 1.27dp while the monochrome
layer draws the same mark at 1.875dp. The two layers are the same icon to the
user -- turning themed icons on should not change the stroke weight. Scaled it
faithfully and raised the group scale to 0.85, which still clears the safe
circle (28.9dp of 33dp) but does not leave the icon looking undersized next to
its neighbours.

Reverted the build.gradle.kts hunk. `applicationIdSuffix = ".debug"` is worth
having, but .github/scripts/launch-smoke.sh hardcodes `com.markleaf.notes` in
its `pm path` poll and its `am start` component, so the suffix turns that job
permanently red -- a non-required check that always fails is worse than no
check. Tracked separately so it can land with the script fix. (`isDebuggable`
is also the debug build type's default.)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jeiel85

jeiel85 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Thanks — you're right, and the screenshots understate it: on a Pixel emulator the current icon's leaf is cut flat along the bottom of the mask. I measured both revisions against the adaptive-icon canvas (108dp, with the 66dp guaranteed-safe circle):

leaf bounds max radius from centre # stroke
main 48 × 68 dp 34.0 dp — outside the 33 dp safe radius 2.50 dp
your commit 36 × 51 dp 25.5 dp 1.27 dp
merged 40.8 × 57.8 dp 28.9 dp 2.13 dp

I pushed one commit onto your branch rather than sending you back and forth. Two changes:

1. The # veins didn't scale with the geometry. Everything else went through the 512/108 = 4.7407 factor faithfully — the vein path coordinates, the crossbar extents, and every bar width in ic_launcher_monochrome.xml. Only strokeWidth came out at 8 instead of 11.852, so the foreground drew the veins at 1.27dp while the monochrome layer drew the same mark at 1.875dp. Those two layers are one icon to the user; switching themed icons on shouldn't change the stroke weight. Scaled it faithfully, and took the group scale from 0.75 to 0.85 while I was there — 28.9dp still clears the safe circle comfortably, and it keeps the icon from reading as undersized next to its neighbours in the drawer.

2. Reverted the build.gradle.kts hunk. applicationIdSuffix = ".debug" is a good idea and I want it — sharing an application id with the production build is why installing a debug APK over the real app fails with INSTALL_FAILED_UPDATE_INCOMPATIBLE. But .github/scripts/launch-smoke.sh hardcodes com.markleaf.notes in both its pm path poll and its am start component, so with the suffix that job fails on every run. It's non-required because it's flaky, but a check that always fails is worse than no check. Filed #319 to land it together with the script fix. (isDebuggable = true is the debug build type's default, so it isn't needed either way.)

Also dropped the editor-export leftovers — the android:name attributes and a strokeAlpha="0.8" on a fill-only path, which does nothing without a strokeColor — and restored the XML prolog and trailing newline to match the rest of res/.

Verified by building both revisions and installing them side by side on a Pixel emulator (API 36), which is what turned up the vein-weight difference. Merging once CI is green — thanks for catching this.

@jeiel85
jeiel85 merged commit 3bdb770 into jeiel85:main Aug 15, 2026
5 checks passed
@jeiel85

jeiel85 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Merged, and CI is green across the board — including launch-smoke, which is the job the application id suffix would have broken.

Thank you for this. It's a small diff, but it's the kind of thing that only gets found from outside: the leaf had been running past the safe zone since the day the icon was drawn, so every launcher had been clipping it, and it sat on my own home screen for months without me registering it. You opened your app drawer and decided it was worth a pull request, which is a good deal more effort than not doing that.

Credited in THANKS.md#320. The .debug suffix idea is tracked in #319 and I do want it; it just needs launch-smoke.sh to stop hardcoding the package name first. If you'd like to take that one too, it's yours.

jeiel85 added a commit that referenced this pull request Aug 15, 2026
#298 was reported, fixed in #299 and #300, and then not credited. Audited the
whole table against every externally-filed issue while adding #318; that was the
only gap.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jeiel85

jeiel85 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Heads-up so you don't start on it: #319 has landed as #324, within a day of me offering it to you. Sorry for the fake invitation — the release went out and it was easier to finish it while the context was fresh than to leave a known-broken interaction sitting in the tracker.

Your version was right about the destination. The part that needed the extra step was the activity, not just the package:

com.markleaf.notes.debug/com.markleaf.notes.MainActivity

The launchable activity keeps its original package, so the -n <pkg>/.MainActivity shorthand the smoke script used would have resolved to com.markleaf.notes.debug.MainActivity and failed even after the package name was parameterised. The script now reads both halves out of the APK with aapt2 dump badging, which is also why it cannot drift from the build again.

So the suffix is in, debug and production installs coexist, and the smoke job is green against a suffixed APK. Thanks again for both halves of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants