Merge pull request #1579 from Bnyro/master

Show the comment reply count
This commit is contained in:
Bnyro 2022-10-17 16:27:32 +00:00 committed by GitHub
commit 7efcb55950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View File

@ -11,8 +11,9 @@ data class Comment(
val commentorUrl: String? = null,
val repliesPage: String? = null,
val hearted: Boolean? = null,
val likeCount: Int? = null,
val likeCount: Long? = null,
val pinned: Boolean? = null,
val thumbnail: String? = null,
val verified: Boolean? = null
val verified: Boolean? = null,
val replyCount: Long? = null
)

View File

@ -64,12 +64,13 @@ class CommentsAdapter(
commentText.text = comment.commentText.toString()
ImageHelper.loadImage(comment.thumbnail, commentorImage)
likesTextView.text = comment.likeCount?.toLong().formatShort()
likesTextView.text = comment.likeCount.formatShort()
if (comment.verified == true) verifiedImageView.visibility = View.VISIBLE
if (comment.pinned == true) pinnedImageView.visibility = View.VISIBLE
if (comment.hearted == true) heartedImageView.visibility = View.VISIBLE
if (comment.repliesPage != null) commentsAvailable.visibility = View.VISIBLE
if (comment.repliesPage != null) repliesAvailable.visibility = View.VISIBLE
if ((comment.replyCount ?: -1L) > 0L) repliesCount.text = comment.replyCount?.formatShort()
commentorImage.setOnClickListener {
NavigationHelper.navigateChannel(root.context, comment.commentorUrl)

View File

@ -87,13 +87,13 @@
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="6dp"
app:srcCompat="@drawable/ic_thumb_up" />
<TextView
android:id="@+id/likes_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
tools:text="LikeCount" />
<ImageView
@ -106,7 +106,7 @@
app:srcCompat="@drawable/ic_hearted" />
<ImageView
android:id="@+id/comments_available"
android:id="@+id/replies_available"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="8dp"
@ -114,6 +114,13 @@
android:visibility="gone"
app:srcCompat="@drawable/ic_comment" />
<TextView
android:id="@+id/replies_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
tools:text="LikeCount" />
</LinearLayout>
</LinearLayout>
@ -128,7 +135,6 @@
android:nestedScrollingEnabled="false" />
<com.google.android.material.button.MaterialButton
android:visibility="gone"
android:id="@+id/show_more"
style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="wrap_content"
@ -139,6 +145,7 @@
android:text="@string/show_more"
android:textColor="?android:attr/textColorPrimary"
android:textSize="12sp"
android:visibility="gone"
app:cornerRadius="20dp" />
</LinearLayout>