Skip to content

fix(android): show only the requested system bar#8480

Open
fallintoplace wants to merge 2 commits into
ionic-team:mainfrom
fallintoplace:fix/systembars-statusbar-show
Open

fix(android): show only the requested system bar#8480
fallintoplace wants to merge 2 commits into
ionic-team:mainfrom
fallintoplace:fix/systembars-statusbar-show

Conversation

@fallintoplace
Copy link
Copy Markdown

Summary

  • show only the requested Android system bar when SystemBars.show({ bar }) is called
  • add a focused Android unit test covering the show() mapping for the empty, status-bar, and navigation-bar cases

Why

The Android hide() path already treats StatusBar and NavigationBar separately, but show(StatusBar) was calling WindowInsetsCompat.Type.systemBars(), which also reveals the navigation bar.

Fixes #8479.

Testing

  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 ANDROID_HOME=/Users/hoangvu/Library/Android/sdk ANDROID_SDK_ROOT=/Users/hoangvu/Library/Android/sdk PATH=/opt/homebrew/opt/openjdk@21/bin:$PATH ./gradlew -p capacitor testDebugUnitTest --tests com.getcapacitor.plugin.SystemBarsTest

@fallintoplace fallintoplace marked this pull request as ready for review May 25, 2026 22:45
@theproducer theproducer self-assigned this May 26, 2026
@theproducer theproducer requested a review from a team May 26, 2026 19:36
Copy link
Copy Markdown
Contributor

@theproducer theproducer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fallintoplace Thanks for the unit tests as well!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Android SystemBars.show({ bar: StatusBar }) also shows the navigation bar

2 participants