mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-06-05 21:59:19 +02:00
add a toggle for forcing portrait mode, enabled by default
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.simplemobiletools.flashlight.activities
|
||||
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.WindowManager
|
||||
@ -34,6 +35,10 @@ class BrightDisplayActivity : SimpleActivity() {
|
||||
super.onResume()
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
toggleBrightness(true)
|
||||
|
||||
if (config.forcePortrait) {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
Reference in New Issue
Block a user