mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
修复启用桌面歌词时蓝牙歌词在锁屏后被暂停的问题
This commit is contained in:
parent
c21122a753
commit
6c6571e704
@ -30,6 +30,7 @@ public class Lyric extends LyricPlayer {
|
||||
boolean isShowRoma;
|
||||
boolean isShowLyricView = false;
|
||||
boolean isSendLyricTextEvent = false;
|
||||
boolean isScreenOff = false;
|
||||
String lyricText = "";
|
||||
String translationText = "";
|
||||
String romaLyricText = "";
|
||||
@ -102,22 +103,20 @@ public class Lyric extends LyricPlayer {
|
||||
// }
|
||||
// }
|
||||
|
||||
private void handleScreenOff() {
|
||||
if (!isRunPlayer || !isShowLyricView) return;
|
||||
setTempPause(true);
|
||||
|
||||
if (lyricView != null) {
|
||||
lyricView.runOnUiThread(() -> {
|
||||
lyricView.destroyView();
|
||||
});
|
||||
private boolean isDisableAutoPause() {
|
||||
return !isRunPlayer || isSendLyricTextEvent;
|
||||
}
|
||||
private void handleScreenOff() {
|
||||
isScreenOff = true;
|
||||
if (isDisableAutoPause()) return;
|
||||
setTempPause(true);
|
||||
}
|
||||
|
||||
private void handleScreenOn() {
|
||||
if (!isRunPlayer || !isShowLyricView) return;
|
||||
isScreenOff = false;
|
||||
if (isDisableAutoPause()) return;
|
||||
if (lyricView == null) lyricView = new LyricView(reactAppContext, lyricEvent);
|
||||
lyricView.runOnUiThread(() -> {
|
||||
lyricView.showLyricView();
|
||||
handleGetCurrentLyric(lastLine);
|
||||
setTempPause(false);
|
||||
});
|
||||
@ -130,7 +129,7 @@ public class Lyric extends LyricPlayer {
|
||||
}
|
||||
|
||||
private void setCurrentLyric(String lyric, ArrayList<String> extendedLyrics) {
|
||||
if (isShowLyricView && lyricView != null) {
|
||||
if (isShowLyricView && !isScreenOff && lyricView != null) {
|
||||
lyricView.setLyric(lyric, extendedLyrics);
|
||||
}
|
||||
if (isSendLyricTextEvent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user