Skip to content

Instantly share code, notes, and snippets.

@yccheok
Created August 6, 2025 13:56
Show Gist options
  • Select an option

  • Save yccheok/05e64afb087ec9956381cb6b71f94603 to your computer and use it in GitHub Desktop.

Select an option

Save yccheok/05e64afb087ec9956381cb6b71f94603 to your computer and use it in GitHub Desktop.
private void edgeToEdgeIfPossible(boolean windowLightStatusBar) {
if (windowLightStatusBar) {
EdgeToEdge.enable(
this,
SystemBarStyle.light(
ContextCompat.getColor(this, android.R.color.transparent),
ContextCompat.getColor(this, android.R.color.transparent)
)
);
} else {
EdgeToEdge.enable(
this,
SystemBarStyle.dark(
ContextCompat.getColor(this, android.R.color.transparent)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment