Skip to content

Commit

Permalink
修复潜在桌面歌词导致的崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Jul 24, 2024
1 parent 0e612ee commit 830c84f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public Animation outAnim(String str, float height) {
}

private void setAnima() {
if (textView == null) return;
if (isShowAnima) {
float size = textView.getTextSize();
setInAnimation(inAnim("top", size));
Expand All @@ -141,7 +142,9 @@ public CharSequence getText() {
}

public TextPaint getPaint() {
return ((TextView)this.getCurrentView()).getPaint();
TextView v = (TextView)this.getCurrentView();
if (v == null) return null;
return v.getPaint();
}

public void setWidth(int i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private boolean updateWH() {
}

private void setLayoutParamsHeight() {
if (textView == null) return;
int height = textView.getPaint().getFontMetricsInt(null) * maxLineNum;
if (height > maxHeight - 100) height = maxHeight - 100;
layoutParams.height = height;
Expand Down Expand Up @@ -166,7 +167,7 @@ private void updateViewPosition() {
int width = (int)(maxWidth * widthPercentage);
if (layoutParams.width != width) {
layoutParams.width = width;
textView.setWidth(width);
if (textView != null) textView.setWidth(width);
}

fixViewPosition();
Expand Down Expand Up @@ -382,6 +383,7 @@ public void setLyric(String text, ArrayList<String> extendedLyrics) {
}
text = textBuilder.toString();
}
if (textView == null) return;
textView.setText(text);
}

Expand Down
4 changes: 4 additions & 0 deletions publish/changeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- 新增重复歌曲列表,可以方便移除我的列表中的重复歌曲,此列表会列出目标列表里歌曲名相同的歌曲,可在“我的列表”里的列表名菜单中使用(注:该功能与PC端的区别是可以点击歌曲名多选删除)
- 新增打开当前歌曲详情页菜单,可以在歌曲菜单中使用

### 修复

- 修复潜在桌面歌词导致的崩溃问题

### 其他

- 更新 React native 到 v0.73.9

0 comments on commit 830c84f

Please sign in to comment.