mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a1cd2d897a
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="./favicon.ico"><title>legado_web_source_editor</title><script defer="defer" src="./js/chunk-vendors.973d2b1d.js"></script><script defer="defer" src="./js/app.90e7caad.js"></script><link href="./css/app.177fcd98.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but legado_web_source_editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="./favicon.ico"><title>legado_web_source_editor</title><script defer="defer" src="./js/chunk-vendors.dd84caa9.js"></script><script defer="defer" src="./js/app.48715b66.js"></script><link href="./css/app.83214410.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but legado_web_source_editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
1
app/src/main/assets/web/source/js/app.48715b66.js
Normal file
1
app/src/main/assets/web/source/js/app.48715b66.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
13
app/src/main/assets/web/source/js/chunk-vendors.dd84caa9.js
Normal file
13
app/src/main/assets/web/source/js/chunk-vendors.dd84caa9.js
Normal file
File diff suppressed because one or more lines are too long
@ -8,6 +8,7 @@ import androidx.media.AudioAttributesCompat
|
|||||||
import androidx.media.AudioFocusRequestCompat
|
import androidx.media.AudioFocusRequestCompat
|
||||||
import androidx.media.AudioManagerCompat
|
import androidx.media.AudioManagerCompat
|
||||||
import io.legado.app.R
|
import io.legado.app.R
|
||||||
|
import splitties.systemservices.audioManager
|
||||||
|
|
||||||
object MediaHelp {
|
object MediaHelp {
|
||||||
|
|
||||||
@ -50,13 +51,8 @@ object MediaHelp {
|
|||||||
/**
|
/**
|
||||||
* @return 音频焦点
|
* @return 音频焦点
|
||||||
*/
|
*/
|
||||||
fun requestFocus(
|
fun requestFocus(focusRequest: AudioFocusRequestCompat): Boolean {
|
||||||
audioManager: AudioManager,
|
val request = AudioManagerCompat.requestAudioFocus(audioManager, focusRequest)
|
||||||
focusRequest: AudioFocusRequestCompat?
|
|
||||||
): Boolean {
|
|
||||||
val request = focusRequest?.let {
|
|
||||||
AudioManagerCompat.requestAudioFocus(audioManager, focusRequest)
|
|
||||||
} ?: AudioManager.AUDIOFOCUS_REQUEST_GRANTED
|
|
||||||
return request == AudioManager.AUDIOFOCUS_REQUEST_GRANTED
|
return request == AudioManager.AUDIOFOCUS_REQUEST_GRANTED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ class AudioPlayService : BaseService(),
|
|||||||
if (AppConfig.ignoreAudioFocus) {
|
if (AppConfig.ignoreAudioFocus) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return MediaHelp.requestFocus(audioManager, mFocusRequest)
|
return MediaHelp.requestFocus(mFocusRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -239,7 +239,7 @@ abstract class BaseReadAloudService : BaseService(),
|
|||||||
if (AppConfig.ignoreAudioFocus) {
|
if (AppConfig.ignoreAudioFocus) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
val requestFocus = MediaHelp.requestFocus(audioManager, mFocusRequest)
|
val requestFocus = MediaHelp.requestFocus(mFocusRequest)
|
||||||
if (!requestFocus) {
|
if (!requestFocus) {
|
||||||
toastOnUi("未获取到音频焦点")
|
toastOnUi("未获取到音频焦点")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user