mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Added song duration in queue's adapter
This commit is contained in:
parent
e23075e4a8
commit
7adeac1e01
3 changed files with 41 additions and 8 deletions
|
|
@ -14,6 +14,7 @@ import com.cappielloantonio.play.glide.CustomGlideRequest;
|
|||
import com.cappielloantonio.play.helper.MusicPlayerRemote;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.ui.fragment.PlayerBottomSheetFragment;
|
||||
import com.cappielloantonio.play.util.MusicUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -48,6 +49,7 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
|||
|
||||
holder.songTitle.setText(song.getTitle());
|
||||
holder.songArtist.setText(song.getArtistName());
|
||||
holder.songDuration.setText(MusicUtil.getReadableDurationString(song.getDuration()));
|
||||
|
||||
CustomGlideRequest.Builder
|
||||
.from(context, song.getPrimary(), song.getBlurHash(), CustomGlideRequest.PRIMARY, CustomGlideRequest.TOP_QUALITY, CustomGlideRequest.SONG_PIC)
|
||||
|
|
@ -63,6 +65,7 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
|||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
TextView songTitle;
|
||||
TextView songArtist;
|
||||
TextView songDuration;
|
||||
ImageView cover;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
|
|
@ -70,6 +73,7 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
|||
|
||||
songTitle = itemView.findViewById(R.id.queue_song_title_text_view);
|
||||
songArtist = itemView.findViewById(R.id.queue_song_artist_text_view);
|
||||
songDuration = itemView.findViewById(R.id.queue_song_duration_text_view);
|
||||
cover = itemView.findViewById(R.id.queue_song_cover_image_view);
|
||||
|
||||
itemView.setOnClickListener(this);
|
||||
|
|
|
|||
|
|
@ -43,18 +43,46 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_song_artist_text_view"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/open_sans_font_family"
|
||||
android:paddingStart="12dp"
|
||||
android:text="@string/label_placeholder"
|
||||
android:textColor="@color/subtitleTextColor"
|
||||
android:textSize="12sp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/queue_song_title_text_view"
|
||||
app:layout_constraintStart_toEndOf="@+id/queue_song_cover_image_view"
|
||||
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image"/>
|
||||
app:layout_constraintEnd_toStartOf="@+id/queue_song_holder_image">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_song_artist_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/open_sans_font_family"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
android:textColor="@color/subtitleTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_separator_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/open_sans_font_family"
|
||||
android:text="@string/label_dot_separator"
|
||||
android:textColor="@color/subtitleTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/queue_song_duration_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/open_sans_font_family"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/label_placeholder"
|
||||
android:textColor="@color/subtitleTextColor"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/queue_song_holder_image"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<string name="home_menu_label">Home</string>
|
||||
<string name="search_menu_label">Search</string>
|
||||
<string name="label_placeholder">--</string>
|
||||
<string name="label_dot_separator">•</string>
|
||||
<string name="save_filters">Save filters between sessions</string>
|
||||
|
||||
<string name="sync_header">Synchronization</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue