Navigate to channel on click in channel groups sheet

This commit is contained in:
Bnyro 2023-05-08 18:04:07 +02:00
parent 8cf4f76d4e
commit 01b98a0f77
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import com.github.libretube.databinding.SubscriptionGroupChannelRowBinding
import com.github.libretube.db.obj.SubscriptionGroup import com.github.libretube.db.obj.SubscriptionGroup
import com.github.libretube.extensions.toID import com.github.libretube.extensions.toID
import com.github.libretube.helpers.ImageHelper import com.github.libretube.helpers.ImageHelper
import com.github.libretube.helpers.NavigationHelper
import com.github.libretube.ui.viewholders.SubscriptionGroupChannelRowViewHolder import com.github.libretube.ui.viewholders.SubscriptionGroupChannelRowViewHolder
class SubscriptionGroupChannelsAdapter( class SubscriptionGroupChannelsAdapter(
@ -30,6 +31,9 @@ class SubscriptionGroupChannelsAdapter(
val channel = channels[position] val channel = channels[position]
val channelId = channel.url.toID() val channelId = channel.url.toID()
holder.binding.apply { holder.binding.apply {
root.setOnClickListener {
NavigationHelper.navigateChannel(root.context, channelId)
}
subscriptionChannelName.text = channel.name subscriptionChannelName.text = channel.name
ImageHelper.loadImage(channel.avatar, subscriptionChannelImage) ImageHelper.loadImage(channel.avatar, subscriptionChannelImage)
channelIncluded.setOnCheckedChangeListener(null) channelIncluded.setOnCheckedChangeListener(null)

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground" android:background="@drawable/rounded_ripple"
android:paddingHorizontal="10dp" > android:paddingHorizontal="10dp" >
<com.google.android.material.imageview.ShapeableImageView <com.google.android.material.imageview.ShapeableImageView