暂停播放时自动隐藏桌面歌词

This commit is contained in:
lyswhut 2022-07-01 22:20:33 +08:00
parent 3f9d386664
commit c33cce7590
3 changed files with 10 additions and 0 deletions

View File

@ -150,6 +150,13 @@ public class Lyric extends LyricPlayer {
// Log.d("Lyric", lineNum + " " + text + " " + (String) line.get("translation")); // Log.d("Lyric", lineNum + " " + text + " " + (String) line.get("translation"));
} }
@Override
public void pause() {
super.pause();
if (!isShowLyric) return;
if (lyricView != null) lyricView.setLyric("", new ArrayList<>(0));
}
public void lockLyric() { public void lockLyric() {
if (lyricView == null) return; if (lyricView == null) return;
lyricView.lockView(); lyricView.lockView();

View File

@ -348,6 +348,7 @@ public class LyricView extends Activity implements View.OnTouchListener {
} }
public void setLyric(String text, ArrayList<String> extendedLyrics) { public void setLyric(String text, ArrayList<String> extendedLyrics) {
if (text.equals("") && text.equals(currentLyric) && extendedLyrics.size() == 0) return;
currentLyric = text; currentLyric = text;
currentExtendedLyrics = extendedLyrics; currentExtendedLyrics = extendedLyrics;
if (textView == null) return; if (textView == null) return;

View File

@ -1,3 +1,5 @@
### 优化 ### 优化
- 添加“弹出键盘时自动隐藏播放栏”设置,默认启用(原来的行为),若在某些设备上播放栏无法显示时则可以关闭此设置 - 添加“弹出键盘时自动隐藏播放栏”设置,默认启用(原来的行为),若在某些设备上播放栏无法显示时则可以关闭此设置
- 优化切歌时桌面歌词的切换动画显示
- 暂停播放时自动隐藏桌面歌词