fix: don't show empty genre TextView if album has no genre

This commit is contained in:
Jaime García 2025-08-07 02:46:57 +02:00
parent 44f8160e21
commit 1f347209b5
No known key found for this signature in database
GPG key ID: BC4E5F71A71BDA5B
2 changed files with 7 additions and 2 deletions

View file

@ -146,7 +146,10 @@ public class AlbumPageFragment extends Fragment implements ClickCallback {
bind.albumArtistLabel.setText(album.getArtist());
bind.albumReleaseYearLabel.setText(album.getYear() != 0 ? String.valueOf(album.getYear()) : "");
bind.albumSongCountDurationTextview.setText(getString(R.string.album_page_tracks_count_and_duration, album.getSongCount(), album.getDuration() != null ? album.getDuration() / 60 : 0));
if (album.getGenre() != null && !album.getGenre().isEmpty()) {
bind.albumGenresTextview.setText(album.getGenre());
bind.albumGenresTextview.setVisibility(View.VISIBLE);
}
if (album.getReleaseDate() != null && album.getOriginalReleaseDate() != null) {
if (album.getReleaseDate().getFormattedDate() != null || album.getOriginalReleaseDate().getFormattedDate() != null)

View file

@ -126,9 +126,11 @@
android:layout_marginEnd="18dp"
android:text="@string/label_placeholder"
android:textAlignment="center"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<TextView
android:id="@+id/album_song_count_duration_textview"