How to make status bar to be transparent in android

Please I have a questions.

  1. Please is there anyway to make the status bar transparent in android
  2. Please is there anyway to hide the status bar on app startup not on device ready in android.

On Ionic 1 you need to:

Install Plugin:

`ionic plugin add https://github.com/ekuwang/cordova-plugin-statusbar.git`

Go to file MainActivity.java and paste:

import android.os.Build; import android.util.Log; import android.view.Window; import android.graphics.Color; import android.view.View;

In the same file BETWEEN “super.onCreate(savedInstanceState);” AND “loadUrl(launchUrl);”, paste this:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(
        View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
//Status bar color, set to whatever opacity/color you want

getWindow().setStatusBarColor(Color.TRANSPARENT); }

and finally, on App.js after first “if”, remove the following:

if(window.StatusBar)

and paste:

if (window.statusbarTransparent) { statusbarTransparent.enable(); }

that’s it ˆ-ˆ

ok i will try that now… thanks

Thank you so much, it worked perfectly…You just saved a life…:grinning:

1 Like

Full details on how it can be implemented with ion-header is on this link: