Skip to content

Instantly share code, notes, and snippets.

@fahimshahrierrasel
Last active June 18, 2019 10:04
Show Gist options
  • Select an option

  • Save fahimshahrierrasel/a4758eb2d4ac3ef700e7283d4808a3a5 to your computer and use it in GitHub Desktop.

Select an option

Save fahimshahrierrasel/a4758eb2d4ac3ef700e7283d4808a3a5 to your computer and use it in GitHub Desktop.
[Android Translucent Status Bar] Make android status bar transparent #android

Using Style in Theme

<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>

On activity layout add

android:fitsSystemWindows="true"

Using only Java

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
  Window w = getWindow(); // in Activity's onCreate() for instance
  w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment