Skip to content

Instantly share code, notes, and snippets.

@m4kvn
Created January 29, 2020 04:45
Show Gist options
  • Save m4kvn/1a1d8f045eb79d0710b1c953ec43376b to your computer and use it in GitHub Desktop.
Save m4kvn/1a1d8f045eb79d0710b1c953ec43376b to your computer and use it in GitHub Desktop.
画面をフルスクリーンにするExtension
fun FragmentActivity.fullscreen(flag: Boolean) {
val attrs = window.attributes
attrs.flags = if (flag)
attrs.flags or WindowManager.LayoutParams.FLAG_FULLSCREEN else
attrs.flags or WindowManager.LayoutParams.FLAG_FULLSCREEN
window.attributes = attrs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment