feat: reply count in story
This commit is contained in:
parent
001c384d11
commit
b0b51c4347
2 changed files with 38 additions and 8 deletions
|
@ -443,9 +443,15 @@ class Stories @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
val likeColor = ContextCompat.getColor(context, R.color.yt_red)
|
val likeColor = ContextCompat.getColor(context, R.color.yt_red)
|
||||||
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
|
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
|
||||||
binding.activityReplies.setOnClickListener {
|
binding.activityRepliesContainer.setOnClickListener {
|
||||||
RepliesBottomDialog.newInstance(story.id).show(activity.supportFragmentManager, "replies")
|
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.activityLikeCount.text = story.likeCount.toString()
|
||||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||||
binding.activityLikeContainer.setOnClickListener {
|
binding.activityLikeContainer.setOnClickListener {
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
android:id="@+id/textActivityContainer"
|
android:id="@+id/textActivityContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal"
|
android:gravity="center"
|
||||||
android:gravity="center">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textActivity"
|
android:id="@+id/textActivity"
|
||||||
|
@ -176,15 +176,39 @@
|
||||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:id="@+id/activityReplies"
|
android:id="@+id/activityRepliesContainer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="-8dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:src="@drawable/ic_round_comment_24"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
|
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/linearLayout"
|
app:layout_constraintEnd_toEndOf="@+id/linearLayout">
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/activityReplies"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:src="@drawable/ic_round_comment_24"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/replyCount"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
android:background="@drawable/notification_circle"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#F3F3F3"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="SmallSp"
|
||||||
|
tools:text="1"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout"
|
android:id="@+id/linearLayout"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue