mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-02 06:09:39 +02:00
feat(lyrics): keep the screen awake while viewing lyrics
This commit is contained in:
1 parent
a1cec6de51
commit
8aa8d598d8
14 files changed
+276
No files matched your search
@@ -81,6 +81,7 @@ class MainActivity: FlutterFragmentActivity() {
|
||||
private var concertCalendarChannel: MethodChannel? = null
|
||||
internal val coreBackend: CoreBackend by lazy { createCoreBackend(applicationContext) }
|
||||
private val nativeBackendMethods = setOf(
|
||||
"setScreenAwake",
|
||||
"getBackendImplementations",
|
||||
"ensureInstallMarker",
|
||||
"prepareRuntimeState",
|
||||
@@ -1080,6 +1081,15 @@ class MainActivity: FlutterFragmentActivity() {
|
||||
return@launch
|
||||
}
|
||||
when (call.method) {
|
||||
"setScreenAwake" -> {
|
||||
val flag = android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||
if (call.argument<Boolean>("enabled") == true) {
|
||||
window.addFlags(flag)
|
||||
} else {
|
||||
window.clearFlags(flag)
|
||||
}
|
||||
result.success(null)
|
||||
}
|
||||
"consumeVerificationNotification" -> {
|
||||
val payload = pendingVerificationNotification
|
||||
pendingVerificationNotification = null
|
||||
|
||||
Reference in new issue
Block a user