mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Playlists ui tweaks
This commit is contained in:
parent
5285eae01d
commit
22146a6bdc
4 changed files with 13 additions and 5 deletions
|
@ -20,6 +20,10 @@ class Thumbnails {
|
|||
fun getLQThumbnail() : String? {
|
||||
return sources.firstOrNull()?.url;
|
||||
}
|
||||
fun getMinimumThumbnail(quality: Int): String? {
|
||||
return sources.firstOrNull { it.quality >= quality }?.url ?: getHQThumbnail();
|
||||
}
|
||||
|
||||
fun hasMultiple() = sources.size > 1;
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class PlaylistsViewHolder : ViewHolder {
|
|||
fun bind(p: Playlist) {
|
||||
if (p.videos.isNotEmpty()) {
|
||||
Glide.with(_imageThumbnail)
|
||||
.load(p.videos[0].thumbnails.getLQThumbnail())
|
||||
.load(p.videos[0].thumbnails.getMinimumThumbnail(380))
|
||||
.placeholder(R.drawable.placeholder_video_thumbnail)
|
||||
.crossfade()
|
||||
.into(_imageThumbnail);
|
||||
|
|
|
@ -11,6 +11,8 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.RequestBuilder
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.futo.platformplayer.R
|
||||
import com.futo.platformplayer.api.media.models.video.IPlatformVideo
|
||||
import com.futo.platformplayer.constructs.Event1
|
||||
|
@ -76,7 +78,7 @@ class VideoListEditorViewHolder : ViewHolder {
|
|||
|
||||
fun bind(v: IPlatformVideo, canEdit: Boolean) {
|
||||
Glide.with(_imageThumbnail)
|
||||
.load(v.thumbnails.getLQThumbnail())
|
||||
.load(v.thumbnails.getHQThumbnail())
|
||||
.placeholder(R.drawable.placeholder_video_thumbnail)
|
||||
.crossfade()
|
||||
.into(_imageThumbnail);
|
||||
|
|
|
@ -13,12 +13,13 @@
|
|||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/image_video_thumbnail"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="50dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:shapeAppearanceOverlay="@style/roundedCorners_4dp"
|
||||
app:srcCompat="@drawable/placeholder_video_thumbnail"
|
||||
android:background="@drawable/video_thumbnail_outline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
|
@ -48,9 +49,10 @@
|
|||
android:fontFamily="@font/inter_extra_light"
|
||||
tools:text="3 videos"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintLeft_toRightOf="@id/image_video_thumbnail"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_name"
|
||||
app:layout_constraintLeft_toRightOf="@id/image_video_thumbnail"
|
||||
app:layout_constraintRight_toLeftOf="@id/button_trash"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="10dp" />
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Add table
Reference in a new issue