Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b7becff authored by Keyan Mobli's avatar Keyan Mobli
Browse files

Fix nonhiding album art

* The album art was not being hidden if the URI for it did not exist and as a result, this could lead to mismatched songs and album art if the second-infinity song in the playlist did not have album art.
* Also cleaned up the way the now playing text is displayed.  It is set to "" in the function that gets called, and as a result can just be set at the beginning of the function.

Change-Id: I8e5670403b4ad63a212f148d95038597c31625ec
parent 0e6175ff
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -762,19 +762,20 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
    }
    private void refreshPlayingTitle() {
        String nowPlaying = KeyguardViewMediator.NowPlaying();
        if (am.isMusicActive() && !nowPlaying.equals("") && mLockMusicControls && mNowPlayingScreen) {
        mNowPlaying.setText(nowPlaying);
        if (am.isMusicActive() && !nowPlaying.equals("") && mLockMusicControls && mNowPlayingScreen) {
            mNowPlaying.setVisibility(View.VISIBLE);
            // Set album art
            Uri uri = getArtworkUri(getContext(), KeyguardViewMediator.SongId(), KeyguardViewMediator.AlbumId());
            if (uri != null) {
                mAlbumArt.setImageURI(uri);
                mAlbumArt.setVisibility(View.VISIBLE);
            } else {
                mAlbumArt.setVisibility(View.GONE);
            }
        } else {
            mNowPlaying.setVisibility(View.GONE);
            mAlbumArt.setVisibility(View.GONE);
            mNowPlaying.setText(nowPlaying);
        }
    }