From b0b51c4347cf3cbc419fb09435b5374226e852a7 Mon Sep 17 00:00:00 2001
From: rebelonion <87634197+rebelonion@users.noreply.github.com>
Date: Mon, 13 May 2024 06:38:12 -0500
Subject: [PATCH] feat: reply count in story
---
.../java/ani/dantotsu/home/status/Stories.kt | 8 +++-
app/src/main/res/layout/fragment_status.xml | 38 +++++++++++++++----
2 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/ani/dantotsu/home/status/Stories.kt b/app/src/main/java/ani/dantotsu/home/status/Stories.kt
index d7731562f46..815960b0a4c 100644
--- a/app/src/main/java/ani/dantotsu/home/status/Stories.kt
+++ b/app/src/main/java/ani/dantotsu/home/status/Stories.kt
@@ -443,9 +443,15 @@ class Stories @JvmOverloads constructor(
}
val likeColor = ContextCompat.getColor(context, R.color.yt_red)
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
- binding.activityReplies.setOnClickListener {
+ binding.activityRepliesContainer.setOnClickListener {
RepliesBottomDialog.newInstance(story.id).show(activity.supportFragmentManager, "replies")
}
+ if (story.replyCount > 0) {
+ binding.replyCount.text = story.replyCount.toString()
+ binding.replyCount.visibility = View.VISIBLE
+ } else {
+ binding.replyCount.visibility = View.GONE
+ }
binding.activityLikeCount.text = story.likeCount.toString()
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
binding.activityLikeContainer.setOnClickListener {
diff --git a/app/src/main/res/layout/fragment_status.xml b/app/src/main/res/layout/fragment_status.xml
index 6c8cc185625..cd843c25f5f 100644
--- a/app/src/main/res/layout/fragment_status.xml
+++ b/app/src/main/res/layout/fragment_status.xml
@@ -32,8 +32,8 @@
android:id="@+id/textActivityContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="horizontal"
- android:gravity="center">
+ android:gravity="center"
+ android:orientation="horizontal">
-
+ app:layout_constraintEnd_toEndOf="@+id/linearLayout">
+
+
+
+
+
+