fix(edit): keep editor toolbar below the status bar after activity recreation#3264
Open
MiMoHo wants to merge 1 commit into
Open
fix(edit): keep editor toolbar below the status bar after activity recreation#3264MiMoHo wants to merge 1 commit into
MiMoHo wants to merge 1 commit into
Conversation
…creation EditNoteActivity registered its window insets listener on the DecorView. A listener set there replaces DecorView#onApplyWindowInsets during insets dispatch, so the platform's own system bar fitting silently depends on decor-internal state: after the activity is recreated (for example when the system switches between light and dark theme while a note is open), the new DecorView never applies the status bar offset and the toolbar - including the in-note search bar - is drawn behind the status bar. Register the listener on the activity's content view instead and apply the insets that actually arrive there. This leaves the platform's decor handling intact: when the platform already fits the system bars, the arriving insets are consumed and no extra padding is added; on a truly edge-to-edge window the content view now pads itself, including the display cutout. The bottom padding keeps the max(IME, system bar) logic from the fix for nextcloud#2700. Reproduced on an Android 15 emulator by toggling dark mode while a note was open (adb shell cmd uimode night yes). Assisted-by: Claude Code:claude-fable-5 AI-assistant: Claude Code 2.1.195 (Claude Fable 5) Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Fixes a UI glitch in the note editor: the toolbar (and the in-note search bar) is sometimes drawn behind the status bar, overlapping the clock.
Steps to reproduce (before this fix): open a note, then switch the system between light and dark theme (or trigger any other configuration change that recreates the activity), or have the editor restored after such a change. On an Android 15 emulator:
adb shell cmd uimode night yeswhile a note is open.Cause:
EditNoteActivityregistered its window insets listener (introduced in #2701 to fix #2700) on theDecorView. A listener set there replacesDecorView#onApplyWindowInsetsduring insets dispatch, so the platform's own system bar fitting silently depends on decor-internal state - after a recreation the newDecorViewnever applies the status bar offset.Fix: register the listener on the activity's own content view and apply the insets that actually arrive there. The platform's decor handling stays intact: if the platform already fits the system bars, the arriving insets are consumed and no extra padding is added; on a truly edge-to-edge window the content view pads itself (including display cutout). The bottom padding keeps the max(IME, system bars) logic from #2700, verified against the keyboard-overlap scenario.
Testing: manually verified on an Android 15 emulator (cold start light/dark, theme toggle recreation both directions, keyboard open/close, in-note search, landscape);
testFdroidDebugUnitTestandlintFdroidDebugpass.Screenshots:

Disclosure: this change was developed with the assistance of an AI coding agent (Claude Code, Claude Fable 5, xhigh); I reviewed and tested the change myself.