Fix oversized dialogs in iOS Modern and Android Material themes#4856
Merged
shai-almog merged 2 commits intomasterfrom May 3, 2026
Merged
Fix oversized dialogs in iOS Modern and Android Material themes#4856shai-almog merged 2 commits intomasterfrom
shai-almog merged 2 commits intomasterfrom
Conversation
Dialog.show() was producing ~60%x70% screen-sized dialogs even when empty. Without dialogPosition, Dialog.showImpl falls through to Form.showDialog which applies hard-coded 20%/10%/20% screen-edge margins regardless of content. Setting dialogPosition: Center routes through showPacked so the dialog sizes to its content's preferred size. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 86 screenshots: 86 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
4 tasks
The instrumentation test runner already retries decode-only failures (logcat occasionally drops a chunk line, breaking PNG reassembly) by restarting the app and re-emitting from the on-device suite. The retry itself was failing in two ways: 1. After `adb install -r`, `am start -W -a MAIN -c LAUNCHER -p <pkg>` returned "Activity not started, unable to resolve Intent" because PackageManager hadn't finished indexing the freshly-installed APK. The script gave up immediately and skipped the 10-minute retry wait, so the failed test never got a second chance. 2. The original logcat capture used the device's default ring buffer (256K-1M), which can wrap mid-suite when 90+ tests each emit ~70 chunk lines. That's the root cause of the decode flakes the retry was supposed to recover from. Changes: - Bump the device-side logcat ring buffer to 16M with `adb logcat -G` before clearing it. Mitigates buffer wrap during long suites. - After `adb install`, poll `cmd package resolve-activity --brief` (max 30s) until pm reports the launcher activity is registered. - Retry `am start` up to 3 times with a 2s backoff to absorb residual indexing race. - Fall back to `monkey -p <pkg> -c LAUNCHER 1` if `am start` still refuses to resolve the Intent. `pidof` after launch remains the source of truth for whether the app actually came up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 86 screenshots: 86 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dialog.show()in the iOS Modern and Android Material native themes produced a ~60%×70% screen-sized dialog even when empty, becausedialogPositionwas unset.dialogPosition,Dialog.showImplfalls through toForm.showDialogwhich applies hard-coded 20%/10%/20% screen-edge margins regardless of content (Form.java:2705-2712). SettingdialogPosition: Centerroutes throughshowPackedso the dialog sizes to its content's preferred size.hideEmptyTitleBool,dialogButtonCommandsBool,dlgCommandGridBool,shrinkPopupTitleBool), but those only tune button-area rendering and don't affect outer sizing.Test plan
iOSModernTheme.res; callDialog.show("Title", "Body", "OK", null)and confirm the dialog hugs its content instead of filling most of the screen.AndroidMaterialTheme.res.new Dialog().show()is small.🤖 Generated with Claude Code