diff --git a/app/src/main/java/com/cappielloantonio/tempo/ui/adapter/SongHorizontalAdapter.java b/app/src/main/java/com/cappielloantonio/tempo/ui/adapter/SongHorizontalAdapter.java index 13b502b5..a080b1a6 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/ui/adapter/SongHorizontalAdapter.java +++ b/app/src/main/java/com/cappielloantonio/tempo/ui/adapter/SongHorizontalAdapter.java @@ -95,7 +95,10 @@ public void onBindViewHolder(ViewHolder holder, int position) { ) ) { holder.item.differentDiskDividerSector.setVisibility(View.VISIBLE); - holder.item.discTitleTextView.setText(holder.itemView.getContext().getString(R.string.disc_titleless, songs.get(position).getDiscNumber().toString())); + + if (songs.get(position).getDiscNumber() != null && !Objects.requireNonNull(songs.get(position).getDiscNumber()).toString().isBlank()) { + holder.item.discTitleTextView.setText(holder.itemView.getContext().getString(R.string.disc_titleless, songs.get(position).getDiscNumber().toString())); + } if (album.getDiscTitles() != null) { Optional discTitle = album.getDiscTitles().stream().filter(title -> Objects.equals(title.getDisc(), songs.get(position).getDiscNumber())).findFirst(); diff --git a/app/src/main/res/layout/item_horizontal_track.xml b/app/src/main/res/layout/item_horizontal_track.xml index a993a7ab..dfea07a9 100644 --- a/app/src/main/res/layout/item_horizontal_track.xml +++ b/app/src/main/res/layout/item_horizontal_track.xml @@ -27,9 +27,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" - android:layout_marginEnd="12dp" + android:paddingEnd="12dp" android:singleLine="true" - android:text="@string/label_placeholder" + tools:text="@string/label_placeholder" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/different_disk_divider" app:layout_constraintStart_toStartOf="parent"