feat(comments): added developer badge

This commit is contained in:
sneazy-ibo
2024-03-27 04:43:39 +01:00
parent 623f79fd5d
commit bdc7bc5878
4 changed files with 31 additions and 2 deletions

View File

@@ -505,6 +505,9 @@ data class Comment(
val username: String,
@SerialName("profile_picture_url")
val profilePictureUrl: String?,
@SerialName("is_dev")
@Serializable(with = NumericBooleanSerializer::class)
val isDev: Boolean? = null,
@SerialName("is_mod")
@Serializable(with = NumericBooleanSerializer::class)
val isMod: Boolean? = null,

View File

@@ -139,6 +139,12 @@ class CommentItem(val comment: Comment,
commentsFragment.replyTo(this, comment.username)
commentsFragment.replyCallback(this)
}
viewBinding.devBadge.apply {
visibility = if (comment.isDev == true) View.VISIBLE else View.GONE
setOnClickListener {
Toast.makeText(context, "App Developer", Toast.LENGTH_SHORT).show()
}
}
viewBinding.modBadge.apply {
visibility = if (comment.isMod == true) View.VISIBLE else View.GONE
setOnClickListener {

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#00C2FD"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M754,879q-8,0 -15,-2.5T726,868L522,664q-6,-6 -8.5,-13t-2.5,-15q0,-8 2.5,-15t8.5,-13l85,-85q6,-6 13,-8.5t15,-2.5q8,0 15,2.5t13,8.5l204,204q6,6 8.5,13t2.5,15q0,8 -2.5,15t-8.5,13l-85,85q-6,6 -13,8.5T754,879ZM754,784 L783,755 636,608 607,637 754,784ZM205,880q-8,0 -15.5,-3T176,868l-84,-84q-6,-6 -9,-13.5T80,755q0,-8 3,-15t9,-13l212,-212h85l34,-34 -165,-165h-57L80,195l113,-113 121,121v57l165,165 116,-116 -43,-43 56,-56L495,210l-28,-28 142,-142 28,28v113l56,-56 142,142q17,17 26,38.5t9,45.5q0,24 -9,46t-26,39l-85,-85 -56,56 -42,-42 -207,207v84L233,868q-6,6 -13,9t-15,3ZM205,784 L375,614v-29h-29L176,755l29,29ZM205,784 L176,755 191,769 205,784ZM754,784 L783,755 754,784Z"/>
</vector>

View File

@@ -126,7 +126,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginEnd="6dp"
android:layout_weight="0"
android:scaleX="0.9"
android:scaleY="0.9"
@@ -139,13 +138,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginEnd="6dp"
android:layout_weight="0"
android:scaleX="0.8"
android:scaleY="0.8"
android:src="@drawable/ic_shield"
android:visibility="visible"
tools:ignore="ContentDescription,RtlSymmetry" />
<ImageView
android:id="@+id/devBadge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_weight="0"
android:scaleX="0.75"
android:scaleY="0.75"
android:src="@drawable/ic_dev"
android:visibility="visible"
tools:ignore="ContentDescription,RtlSymmetry" />
</LinearLayout>
<TextView