Added option to keep screen on when showing lyrics

This commit is contained in:
Prathamesh More 2022-01-17 18:14:55 +05:30
parent b349b8c4d1
commit c7f7f9d695
7 changed files with 37 additions and 2 deletions

View file

@ -22,6 +22,14 @@ fun AppCompatActivity.toggleScreenOn() {
}
}
fun AppCompatActivity.keepScreenOn(keepScreenOn: Boolean) {
if (keepScreenOn) {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}
fun AppCompatActivity.setEdgeToEdgeOrImmersive() {
if (PreferenceUtil.isFullScreenMode) {
setImmersiveFullscreen()