mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Added a separator for albums consisting of more than one disc
This commit is contained in:
parent
68502ef1ba
commit
1eb445df0c
2 changed files with 21 additions and 6 deletions
|
|
@ -77,6 +77,10 @@ public class SongHorizontalAdapter extends RecyclerView.Adapter<SongHorizontalAd
|
||||||
if (isCoverVisible) holder.trackNumber.setVisibility(View.INVISIBLE);
|
if (isCoverVisible) holder.trackNumber.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
if (!isCoverVisible) holder.cover.setVisibility(View.INVISIBLE);
|
if (!isCoverVisible) holder.cover.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
if (!isCoverVisible && (position > 0 && songs.get(position - 1) != null && songs.get(position - 1).getDiscNumber() < songs.get(position).getDiscNumber())) {
|
||||||
|
holder.differentDiscDivider.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -98,6 +102,7 @@ public class SongHorizontalAdapter extends RecyclerView.Adapter<SongHorizontalAd
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
View differentDiscDivider;
|
||||||
TextView songTitle;
|
TextView songTitle;
|
||||||
TextView songSubtitle;
|
TextView songSubtitle;
|
||||||
TextView trackNumber;
|
TextView trackNumber;
|
||||||
|
|
@ -109,6 +114,7 @@ public class SongHorizontalAdapter extends RecyclerView.Adapter<SongHorizontalAd
|
||||||
ViewHolder(View itemView) {
|
ViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
|
differentDiscDivider = itemView.findViewById(R.id.different_disk_divider);
|
||||||
songTitle = itemView.findViewById(R.id.search_result_song_title_text_view);
|
songTitle = itemView.findViewById(R.id.search_result_song_title_text_view);
|
||||||
songSubtitle = itemView.findViewById(R.id.search_result_song_subtitle_text_view);
|
songSubtitle = itemView.findViewById(R.id.search_result_song_subtitle_text_view);
|
||||||
trackNumber = itemView.findViewById(R.id.track_number_text_view);
|
trackNumber = itemView.findViewById(R.id.track_number_text_view);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,15 @@
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
android:paddingBottom="3dp">
|
android:paddingBottom="3dp">
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/Divider"
|
||||||
|
android:id="@+id/different_disk_divider"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/song_cover_image_view"
|
android:id="@+id/song_cover_image_view"
|
||||||
android:layout_width="52dp"
|
android:layout_width="52dp"
|
||||||
|
|
@ -17,7 +26,7 @@
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="2dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/track_number_text_view"
|
android:id="@+id/track_number_text_view"
|
||||||
|
|
@ -29,7 +38,7 @@
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/cover_image_separator"
|
android:id="@+id/cover_image_separator"
|
||||||
|
|
@ -37,7 +46,7 @@
|
||||||
android:layout_height="52dp"
|
android:layout_height="52dp"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/search_result_song_title_text_view"
|
app:layout_constraintEnd_toStartOf="@+id/search_result_song_title_text_view"
|
||||||
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
app:layout_constraintStart_toEndOf="@+id/song_cover_image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/search_result_song_title_text_view"
|
android:id="@+id/search_result_song_title_text_view"
|
||||||
|
|
@ -51,7 +60,7 @@
|
||||||
android:text="@string/label_placeholder"
|
android:text="@string/label_placeholder"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/search_result_dowanload_indicator_image_view"
|
app:layout_constraintEnd_toStartOf="@+id/search_result_dowanload_indicator_image_view"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cover_image_separator"
|
app:layout_constraintStart_toEndOf="@+id/cover_image_separator"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/search_result_song_subtitle_text_view"
|
android:id="@+id/search_result_song_subtitle_text_view"
|
||||||
|
|
@ -75,7 +84,7 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/search_result_song_more_button"
|
app:layout_constraintEnd_toStartOf="@+id/search_result_song_more_button"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/search_result_song_more_button"
|
android:id="@+id/search_result_song_more_button"
|
||||||
|
|
@ -87,5 +96,5 @@
|
||||||
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toBottomOf="@+id/different_disk_divider" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue