Last active
August 19, 2019 08:54
-
-
Save davidelp68/4e89f08ac20c25e98c818ec534be80ae to your computer and use it in GitHub Desktop.
Andorid Studio - FullScreen funzione: screenOrientation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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