Fix crash on screen rotation change
This commit is contained in:
parent
ecdc9bb870
commit
56ede6c725
1 changed files with 6 additions and 0 deletions
|
|
@ -187,10 +187,13 @@ public class PlayerAlbumCoverFragment extends AbsMusicServiceFragment implements
|
|||
public void setLyrics(Lyrics l) {
|
||||
lyrics = l;
|
||||
|
||||
if (lyricsLayout == null || lyricsLine1 == null || lyricsLine2 == null) return;
|
||||
|
||||
if (!PreferenceUtil.getInstance(getActivity()).synchronizedLyricsShow() || l == null || !l.isSynchronized() || !l.isValid()) {
|
||||
lyricsLayout.animate().alpha(0f).setDuration(PlayerAlbumCoverFragment.LYRICS_ANIM_DURATION).withEndAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (lyricsLayout == null || lyricsLine1 == null || lyricsLine2 == null) return;
|
||||
lyricsLayout.setVisibility(View.GONE);
|
||||
lyricsLine1.setText(null);
|
||||
lyricsLine2.setText(null);
|
||||
|
|
@ -216,10 +219,13 @@ public class PlayerAlbumCoverFragment extends AbsMusicServiceFragment implements
|
|||
|
||||
@Override
|
||||
public void onUpdateProgressViews(int progress, int total) {
|
||||
if (lyricsLayout == null || lyricsLine1 == null || lyricsLine2 == null) return;
|
||||
|
||||
if (!PreferenceUtil.getInstance(getActivity()).synchronizedLyricsShow() || lyrics == null || !lyrics.isSynchronized() || !lyrics.isValid()) {
|
||||
lyricsLayout.animate().alpha(0f).setDuration(PlayerAlbumCoverFragment.LYRICS_ANIM_DURATION).withEndAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (lyricsLayout == null || lyricsLine1 == null || lyricsLine2 == null) return;
|
||||
lyricsLayout.setVisibility(View.GONE);
|
||||
lyricsLine1.setText(null);
|
||||
lyricsLine2.setText(null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue