r/androiddev • u/bonfiglioalessio • 35m ago
Open Source Lessons from building a ~1.8 MB Jetpack Compose Android launcher: avoiding 150 MB FBO spikes, clean stroked outline text with Path.Op.UNION, and edge Back gestures
I recently open-sourced OpenLauncher (GitHub, GPL-3.0, forked from yLauncher) after refactoring and profiling it heavily on Android 17 (compileSdk 37 / targetSdk 36, Compose BOM 2026.08.00, Kotlin 2.4.10). Thought I'd share a few Compose / Android platform gotchas we hit and how we solved them:
1. Full-screen CompositingStrategy.Offscreen FBOs silently blew up Graphics RAM
For a soft top/bottom fade on the A–Z LazyColumn, the obvious Compose pattern is Modifier.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen } + BlendMode.DstIn gradient mask. Profiling dumpsys meminfo showed Vulkan Graphics memory jumping from ~7.5 MB to >150 MB.
- Fix: Dropped the offscreen FBO completely and computed per-row edge alpha (
computeRowEdgeAlpha) directly inside each item'sgraphicsLayer { alpha = ... }lambda. Zero extra render target allocations.
2. Zero-recomposition scrubbing & WindowManager IPC stalls
Scrubbing an alphabet edge rail shouldn't trigger Compose recompositions or WindowInsetsControllerCompat Binder calls on every letter change:
- Fix: Passed state snapshots (
State<Float>/State<RailEntry>) that are only read insidegraphicsLayer { }draw-phase lambdas, kept one persistentLazyColumnacross scrubbing and browsing with synchronousSideEffect { listState.requestScrollToItem(...) }(zero jump when lifting your thumb), and keyed the system-barsDisposableEffectstrictly onuiMode is Searchrather than the fulluiModesealed class.
3. Clean outlined clock typography (Path.Op.UNION)
Stroked Compose TextStyle(drawStyle = Stroke(...)) renders ugly internal crossing lines on fonts whose glyphs have overlapping sub-contours (e.g., 9, 4 in Josefin Sans).
- Fix: Extracted glyph outlines via
Paint.getTextPath(...)and ranandroid.graphics.Path.op(rawPath, Path(), Path.Op.UNION)before stroking onCanvas. Result is crisp hollow digits with zero interior seams.
4. Right-edge alphabet rail vs. Android's predictive Back gesture
Putting a touchable alphabet rail on the right screen edge fights Android's system Back gesture if systemGestureExclusion stays active blindly or intercepts immediately on ACTION_DOWN.
- Fix: Attached
Modifier.systemGestureExclusiondynamically only when the rail is dormant or actively scrubbing (detached while browsing the drawer), and waited for6.dpslop (or clean finger-up tap, ignoringACTION_CANCEL) before claiming the gesture when visible.
5. Keeping the R8 release APK at ~1.8 MB & RAM tight
- Avoided
material-icons-extendedcompletely (small XML vector drawables instead). - Zero
Drawable/Bitmapreferences insideAppInfoor repositories (@Immutablemetadata only); icons are rasterized strictly at targetsizePxinside a3 MBbyte-bounded LRU cache with single-IPC background pre-warming. - Full Work Profile / Private Space isolation keying favorites and search history by
"$packageName|$userSerialNumber"and launching App Info / uninstall viaLauncherApps.startAppDetailsActivity&Intent.EXTRA_USER.
All code is open-source (GPL-3.0) in the repo (70 unit tests across Robolectric + MockK, zero INTERNET permission in the manifest). Curious how others handle custom glyph stroking or edge-rail gesture arbitration in Compose launchers!



