fix: fixed incorrect album release date, hid release date TextView when there is no data

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

View file

@ -149,13 +149,16 @@ public class AlbumPageFragment extends Fragment implements ClickCallback {
bind.albumGenresTextview.setText(album.getGenre());
if (album.getReleaseDate() != null && album.getOriginalReleaseDate() != null) {
bind.albumReleaseYearsTextview.setVisibility(View.VISIBLE);
if (album.getReleaseDate().getFormattedDate() != null || album.getOriginalReleaseDate().getFormattedDate() != null)
bind.albumReleaseYearsTextview.setVisibility(View.VISIBLE);
else
bind.albumReleaseYearsTextview.setVisibility(View.GONE);
if (album.getReleaseDate() == null || album.getOriginalReleaseDate() == null) {
if (album.getReleaseDate().getFormattedDate() == null || album.getOriginalReleaseDate().getFormattedDate() == null) {
bind.albumReleaseYearsTextview.setText(getString(R.string.album_page_release_date_label, album.getReleaseDate() != null ? album.getReleaseDate().getFormattedDate() : album.getOriginalReleaseDate().getFormattedDate()));
}
if (album.getReleaseDate() != null && album.getOriginalReleaseDate() != null) {
if (album.getReleaseDate().getFormattedDate() != null && album.getOriginalReleaseDate().getFormattedDate() != null) {
if (Objects.equals(album.getReleaseDate().getYear(), album.getOriginalReleaseDate().getYear()) && Objects.equals(album.getReleaseDate().getMonth(), album.getOriginalReleaseDate().getMonth()) && Objects.equals(album.getReleaseDate().getDay(), album.getOriginalReleaseDate().getDay())) {
bind.albumReleaseYearsTextview.setText(getString(R.string.album_page_release_date_label, album.getReleaseDate().getFormattedDate()));
} else {