feat(comments): highlight creator comments

This commit is contained in:
FineFindus 2023-10-25 16:42:20 +02:00
parent 8964032bdf
commit eacd335c30
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
5 changed files with 35 additions and 4 deletions

View File

@ -19,5 +19,6 @@ data class Comment(
val thumbnail: String,
val verified: Boolean,
val replyCount: Long,
val creatorReplied: Boolean = false
val creatorReplied: Boolean = false,
val channelOwner: Boolean = false
) : Parcelable

View File

@ -72,7 +72,11 @@ class CommentsAdapter(
override fun onBindViewHolder(holder: CommentsViewHolder, position: Int) {
val comment = comments[position]
holder.binding.apply {
commentInfos.text = comment.author + TextUtils.SEPARATOR + comment.commentedTime
commentAuthor.text = comment.author
if (comment.channelOwner) {
commentAuthor.setBackgroundResource(R.drawable.comment_channel_owner_bg)
}
commentInfos.text = TextUtils.SEPARATOR + comment.commentedTime
commentText.movementMethod = LinkMovementMethodCompat.getInstance()
commentText.text = comment.commentText?.replace("</a>", "</a> ")

View File

@ -203,7 +203,12 @@ object PlayingQueue {
}
}
fun updateQueue(streamItem: StreamItem, playlistId: String?, channelId: String?, relatedStreams: List<StreamItem> = emptyList()) {
fun updateQueue(
streamItem: StreamItem,
playlistId: String?,
channelId: String?,
relatedStreams: List<StreamItem> = emptyList()
) {
if (playlistId != null) {
insertPlaylist(playlistId, streamItem)
} else if (channelId != null) {

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="?colorPrimaryContainer" />
<corners android:radius="12dp" />
<padding
android:bottom="2dp"
android:left="4dp"
android:right="4dp"
android:top="2dp" />
</shape>

View File

@ -36,6 +36,17 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/comment_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:text="Octacat" />
<TextView
android:id="@+id/comment_infos"
android:layout_width="wrap_content"
@ -45,7 +56,7 @@
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:text="Octacat • 10h" />
tools:text="• 10h" />
<ImageView
android:id="@+id/verified_imageView"