Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Status Bar is Hiddes as if the app is in Fullscreen mode #227

Open
4 of 7 tasks
RebelRon opened this issue Nov 8, 2024 · 0 comments
Open
4 of 7 tasks

bug: Status Bar is Hiddes as if the app is in Fullscreen mode #227

RebelRon opened this issue Nov 8, 2024 · 0 comments

Comments

@RebelRon
Copy link

RebelRon commented Nov 8, 2024

Version

6.9.4

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

When launching InAppBrowser.openWebView with toolbarType: ToolBarType.BLANK on Android, the status bar becomes hidden and only appears when swiping down from the top.
Note: On the screenshot the top is black because of a punch hole camera.

Screenshot

Expected behavior

The global app setting should be respected, with the status bar remaining visible.

Expected Screenshot

Reproduction

No response

Steps to reproduce

  1. Call InAppBrowser.openWebView() with toolbarType: ToolBarType.BLANK on an Android Device (tested with Pixel 9 & 8)

our exact configuration:

    InAppBrowser.openWebView({
      url: this.url,
      disableGoBackOnNativeApplication: true,
      activeNativeNavigationForWebview: true,
      isAnimated: false,
      showReloadButton: false,
      visibleTitle: true,
      showArrow: false,
      toolbarType: ToolBarType.BLANK,
    });

Other information

I experimented a bit and found a possible solution:

In _ee/forgr/capacitor_inappbrowser/WebViewDialog.java on line 158, we can make the following change to fix the issue. This way, the status bar color will consistently be set to black. One could think about using toolbarColor or something like that to make this configurable. setAppearanceLightStatusBars needs then to be change accordingly.

  public void presentWebView() {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setCancelable(true);
    Objects.requireNonNull(getWindow()).setFlags(
      WindowManager.LayoutParams.FLAG_FULLSCREEN,
      WindowManager.LayoutParams.FLAG_FULLSCREEN
    );
    setContentView(R.layout.activity_browser);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
    WindowInsetsControllerCompat insetsController = new WindowInsetsControllerCompat(getWindow(), getWindow().getDecorView());
    insetsController.setAppearanceLightStatusBars(false);
    getWindow().getDecorView().post(() -> {
      getWindow().setStatusBarColor(Color.BLACK);
    });

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

[success] iOS looking great! 👌
[success] Android looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.

Fastest way to fix this issue

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

No branches or pull requests

1 participant