fix(edit): keep editor toolbar below the status bar after activity recreation#3264
fix(edit): keep editor toolbar below the status bar after activity recreation#3264MiMoHo 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.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
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.