Fix ToastBar empty space above text when positioned at TOP#4721
Merged
shai-almog merged 7 commits intomasterfrom Apr 8, 2026
Merged
Fix ToastBar empty space above text when positioned at TOP#4721shai-almog merged 7 commits intomasterfrom
shai-almog merged 7 commits intomasterfrom
Conversation
The safe area top padding was unconditionally set to safeArea.getY(), but the layered pane (which wraps the content pane) is already positioned below the toolbar that accounts for the safe area inset. This caused double-counting of the inset, creating empty space above the ToastBar text. Now computes the needed padding as the difference between the safe area top inset and the parent container's absolute Y position, so padding is only added when the ToastBar actually extends into the unsafe area. Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/c374fa90-ccba-426b-b2d3-5e2f430bf1fe Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…culation Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/c374fa90-ccba-426b-b2d3-5e2f430bf1fe Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Add five regression tests to ToastBarTest covering: - TOP position with safe area inset when parent is below safe area (the original bug: should not double-count the inset) - TOP position without safe area inset (no extra padding) - BOTTOM position with safe area bottom inset (correct padding) - BOTTOM position without safe area inset (no extra padding) - TOP position with parent at Y=0 using FormLayeredPane (full safe area padding needed) Also adds setDisplaySafeArea/getDisplaySafeArea to TestCodenameOneImplementation to simulate devices with notches. Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/d40eb36c-4528-4297-97d4-4f8144175502 Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…ber with constant Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/d40eb36c-4528-4297-97d4-4f8144175502 Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
shai-almog
April 8, 2026 01:11
View session
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
|
Compared 36 screenshots: 36 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Add ToastBarTopPositionScreenshotTest that shows a ToastBar message at the TOP position to visually verify no spurious empty space appears above the toast text. Register it in Cn1ssDeviceRunner. Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/eaa2d20f-fd1b-44cd-b3b8-fda8d8155d7a Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Signed-off-by: Shai Almog <67850168+shai-almog@users.noreply.github.com>
Signed-off-by: Shai Almog <67850168+shai-almog@users.noreply.github.com>
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.

scripts/hellocodenameoneToastBarTopPositionScreenshotTest.javascreenshot test inscripts/hellocodenameoneCn1ssDeviceRunner.java