Skip to content

fix(android): dragging the status overlay crashed on phones (empty coerceIn range) - #113

Merged
tranvuongquocdat merged 1 commit into
mainfrom
fix/overlay-drag-crash
Nov 7, 2026
Merged

tranvuongquocdat merged 1 commit into
mainfrom
fix/overlay-drag-crash

Conversation

@tranvuongquocdat

Copy link
Copy Markdown
Owner

Play Console crash on 1.0.2 (Galaxy S22 Ultra, Android 14), still present in 1.1.0:

java.lang.IllegalArgumentException
  at v1.F4.a (coerceIn)
  at H2.s.onTouch (MainActivity.setupDraggableOverlay, line 609 in 1.0.2)

When the status overlay is wider than its parent (phones in portrait), parent.width - view.width is negative and coerceIn(0f, maxX) throws on the first drag.

Fix: the clamp moves into OverlayBounds.clamp, which floors the upper bound at 0 so the overlay pins to the leading edge instead of crashing. Same for the vertical axis.

Tests: OverlayBoundsTest covers the normal case, overlay larger than parent (the crash), and parent not laid out yet. testDebugUnitTest 37/37, ktlint clean.

…erceIn range)

On a Galaxy S22 Ultra in portrait the status bar overlay is wider than its
parent, so parent.width - view.width is negative and coerceIn(0f, maxX)
throws IllegalArgumentException (Play Console crash on 1.0.2, still in 1.1.0).

Move the clamp into OverlayBounds.clamp, floor the upper bound at 0 so the
overlay pins to the edge instead of crashing, and unit test the three cases
(normal, overlay larger than parent, parent not laid out).
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
side-screen Ready Ready Preview Nov 7, 2026 4:09am UTC

@tranvuongquocdat
tranvuongquocdat merged commit f49f7f6 into main Nov 7, 2026
4 checks passed
@tranvuongquocdat
tranvuongquocdat deleted the fix/overlay-drag-crash branch November 7, 2026 04:18
SirRiddle added a commit to SirRiddle/SideScreen that referenced this pull request Nov 11, 2026
- Upstream 0.11.3..1.1.1 (synced through 73b8067): tranvuongquocdat#102 adb reverse per
  device, tranvuongquocdat#103/tranvuongquocdat#113/tranvuongquocdat#98 Android crash fixes, tranvuongquocdat#112 exact panel size + encoder
  freeze + bitrate overflow, tranvuongquocdat#88 per-rate decoder table (type 14), tranvuongquocdat#92
  per-tablet profiles (type 18), tranvuongquocdat#81 build scripts, tranvuongquocdat#93 CameraX/ML Kit,
  tranvuongquocdat#106 logo, Sparkle (fork feed/key), SDK 36 + R8. Skipped items are listed
  in CLAUDE.md.
- Fork fixes for bugs open upstream: tranvuongquocdat#69 admission before swap, tranvuongquocdat#70 USB
  checklist lifecycle, tranvuongquocdat#72 dead-link watchdog, tranvuongquocdat#73, tranvuongquocdat#74, tranvuongquocdat#118 port,
  tranvuongquocdat#89 backup exclusions, tranvuongquocdat#91/tranvuongquocdat#100 adb discovery + path setting, tranvuongquocdat#108
  stable display identity, tranvuongquocdat#76 non-blocking reachability, tranvuongquocdat#80 device
  parsing/hints.
- Low latency at 120 Hz (default on), bitrate Max = 2147 Mbps.
- Stable signing: self-signed Mac identity (permissions survive updates),
  Sparkle on the fork feed, Android release key; signed test DMG per CI run.
- VERSION 1.2.0.

This branch was successfully deployed

1 active deployment
Preview — d67a305e Deployed Nov 7, 2026 by vercel[bot]
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.

1 participant