Repository navigation
Conversation
From Android 15 on the app draws edge to edge, so the system bars lie over the layout. The guess move screen only kept its board clear of them; the "New game" button at the bottom ended up under the navigation bar. With three-button navigation (reported on a Samsung S21) it could not be tapped - only switching to gesture navigation, with its thin bar, made it reachable. The whole screen is now padded by the system bars, through a small SystemBars.keepClear() helper. A new test inflates the layout with a status and a navigation bar and checks the button lies between them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM
The same edge-to-edge problem as on the guess move screen: the main screen also only kept its board clear of the system bars, so the buttons below it (back to the start, undo, redo, rotate) lay under the navigation bar with three-button navigation - at the bottom in portrait, at the side in landscape. The settings list ran under both bars, so the first and last settings were partly covered. The main screen now pads its whole frame like the guess move screen; the settings list keeps scrolling under the bars but is padded so that it ends clear of them. SystemBars.keepClear() adds to a view's own padding instead of replacing it. SystemBarsTest replaces GuessMoveLayoutTest: both layouts, in portrait and landscape, with the navigation bar where three-button navigation puts it, plus the settings list's padding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM
On Android before 11 (the CI emulator) androidx caps the navigation bar inset a view in a window gets at the window's real navigation bar - 0 for an app that isn't drawn edge to edge - so the settings list on its real screen can't show the bottom padding in a test. It now checks the top there (the list is wired up and scrolls under the bars), and the padding on every side on a list outside a window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM
In landscape a punch-hole camera (the S21 has one) sits at the side of the screen, where no system bar covers it; drawn edge to edge, a corner of the board could end up under it. SystemBars.keepClear() now pads by the display cutout as well, and SystemBarsTest lays both screens out with a cutout at the side in landscape. The emulator CI runs Android 10, where the app isn't drawn edge to edge, so the layout tests could only simulate the bars. A new job runs the screen-edge tests on an Android 15 emulator switched to three-button navigation - the user's setup - and the new ScreenEdgeTest checks the main screen's buttons and the settings list against the device's real bars and cutouts (on both emulators). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM
"overlay enable" turned the three-button overlay on but left gesture navigation on as well, so which one the tests ran against was unclear. "enable-exclusive" turns the others in the category off. The screen-edge test now also logs the bars it checked against, and CI prints that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM
This branch has not been deployed
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.
A user on a Samsung S21 couldn't reach the New game button in Guess the best move. Switching the phone to gesture navigation worked around it. Checking the other screens turned up the same problem on two more.
Cause: From Android 15 on, the app draws edge to edge (enforced for
targetSdk35+), so the status and navigation bars lie over the layout. With three-button navigation, anything under the navigation bar can't be tapped; the thin gesture bar leaves it reachable.The analysis drawer already kept itself clear. The dialogs are positioned by the system.
How: A small
SystemBars.keepClear(view)helper adds the system bars' size to a view's own padding. On Android versions that don't draw edge to edge the insets are 0 and nothing changes. The board's position is unchanged: the top and side padding replace the margins it had.Test:
SystemBarsTestlays out both screen layouts, in portrait and landscape, on a phone-sized screen. It places the navigation bar where three-button navigation puts it and checks that the buttons lie between the bars. It also checks the settings list's padding. The layout checks don't start the activities, because that would occupy the engine for the following tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01V5G4cWSLBkiNNK4KC3zvXM