From 47bd510aef4cbe496e2a5c3e58e99ba0d34d96f1 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 29 Oct 2023 15:32:00 +0100 Subject: [PATCH] fix: channel avatar placeholder visible for shorts of a channel --- .../com/github/libretube/ui/adapters/SearchAdapter.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt index 929c503ce..7cd682d75 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchAdapter.kt @@ -3,6 +3,7 @@ package com.github.libretube.ui.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.core.os.bundleOf +import androidx.core.view.isGone import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import com.github.libretube.R @@ -83,6 +84,7 @@ class SearchAdapter( ImageHelper.loadImage(item.thumbnail, thumbnail) thumbnailDuration.setFormattedDuration(item.duration, item.isShort) videoTitle.text = item.title + val viewsString = item.views.takeIf { it != -1L }?.formatShort().orEmpty() val uploadDate = item.uploaded.takeIf { it > 0 }?.let { " ${TextUtils.SEPARATOR} ${TextUtils.formatRelativeDate(root.context, it)}" @@ -92,16 +94,20 @@ class SearchAdapter( viewsString, uploadDate ) + // only display channel related info if not in a channel tab if (!isChannelAdapter) { channelName.text = item.uploaderName ImageHelper.loadImage(item.uploaderAvatar, channelImage) + } else { + channelContainer.isGone = true } + root.setOnClickListener { NavigationHelper.navigateVideo(root.context, item.url, timestamp = timeStamp) } - val videoId = item.url.toID() + val videoId = item.url.toID() val activity = (root.context as BaseActivity) val fragmentManager = activity.supportFragmentManager root.setOnLongClickListener {