Fix actionbar insets by vardhan30016 · Pull Request #10960 · NativeScript/NativeScript · GitHub
Skip to content

Fix actionbar insets#10960

Open
vardhan30016 wants to merge 2 commits into
NativeScript:mainfrom
vardhan30016:fix-actionbar-insets
Open

Fix actionbar insets#10960
vardhan30016 wants to merge 2 commits into
NativeScript:mainfrom
vardhan30016:fix-actionbar-insets

Conversation

@vardhan30016

@vardhan30016 vardhan30016 commented Nov 24, 2025

Copy link
Copy Markdown

PR Checklist

What is the current behavior?

On newer Android versions (API 29+), especially Android 14–16 (edge-to-edge navigation),
the ActionBar is rendered under the status bar.
This causes the ActionBar title, menu items, and navigation button to overlap with the system status bar.

This is due to Toolbar not applying WindowInsets top padding on newer Android layouts.

Related issue: #10856

What is the new behavior?

During createNativeView() on Android:

  • The Toolbar now enables setFitsSystemWindows(true) for correct inset handling.
  • A OnApplyWindowInsetsListener is attached to read the top system inset.
  • The inset value is applied as top padding to the ActionBar.
  • Logic is wrapped in try/catch for safety and backward compatibility.

This ensures the ActionBar is correctly positioned below the status bar on all Android versions.

Fixes #10856.

BREAKING CHANGES

None.

This patch does not modify public APIs or change behavior for older Android versions.
It only resolves layout misalignment under edge-to-edge mode on Android 10+.

@CatchABus

Copy link
Copy Markdown
Contributor

@vardhan30016

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data not passed through route when using withComponentInputBinding()

3 participants