mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
fix: null checking
This commit is contained in:
parent
6c6d56f451
commit
67e4079732
2 changed files with 6 additions and 3 deletions
|
|
@ -95,7 +95,10 @@ public class SongHorizontalAdapter extends RecyclerView.Adapter<SongHorizontalAd
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
holder.item.differentDiskDividerSector.setVisibility(View.VISIBLE);
|
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) {
|
if (album.getDiscTitles() != null) {
|
||||||
Optional<DiscTitle> discTitle = album.getDiscTitles().stream().filter(title -> Objects.equals(title.getDisc(), songs.get(position).getDiscNumber())).findFirst();
|
Optional<DiscTitle> discTitle = album.getDiscTitles().stream().filter(title -> Objects.equals(title.getDisc(), songs.get(position).getDiscNumber())).findFirst();
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:layout_marginEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/label_placeholder"
|
tools:text="@string/label_placeholder"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/different_disk_divider"
|
app:layout_constraintEnd_toStartOf="@+id/different_disk_divider"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue