Skip to content

Instantly share code, notes, and snippets.

@davidelp68
Last active August 19, 2019 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidelp68/4e89f08ac20c25e98c818ec534be80ae to your computer and use it in GitHub Desktop.
Save davidelp68/4e89f08ac20c25e98c818ec534be80ae to your computer and use it in GitHub Desktop.
Andorid Studio - FullScreen funzione: screenOrientation
private fun screenOrientation() {
if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
{
//Per abilitare il full screen:
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
}
else if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT)
{
//Per disabilitare il full screen:
window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment