라이브방 - 라이브 후원랭킹 리스트

- 방장은 일반후원 / 비밀후원 캔을 나눠서 보이도록 수정
This commit is contained in:
klaus 2024-10-28 17:17:59 +09:00
parent 960dda8d40
commit a556378ffe
8 changed files with 207 additions and 45 deletions

View File

@ -2123,9 +2123,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
)
)
invalidateChat()
lifecycleScope.launch {
viewModel.addDonationCan(message.can)
}
if (message.signature != null) {
addSignature(message.signature)

View File

@ -7,7 +7,8 @@ import com.google.gson.annotations.SerializedName
data class GetLiveRoomDonationStatusResponse(
@SerializedName("donationList") val donationList: List<GetLiveRoomDonationItem>,
@SerializedName("totalCount") val totalCount: Int,
@SerializedName("totalCan") val totalCan: Int
@SerializedName("totalCan") val totalCan: Int,
@SerializedName("totalSecretCan") val totalSecretCan: Int
)
@Keep
@ -15,5 +16,6 @@ data class GetLiveRoomDonationItem(
@SerializedName("profileImage") val profileImage: String,
@SerializedName("nickname") val nickname: String,
@SerializedName("userId") val userId: Long,
@SerializedName("can") val can: Int
@SerializedName("can") val can: Int,
@SerializedName("secretCan") val secretCan: Int
)

View File

@ -50,6 +50,12 @@ class LiveRoomDonationRankingAdapter :
}
binding.tvDonationCan.text = item.can.moneyFormat()
binding.tvDonationSecretCan.text = item.secretCan.moneyFormat()
binding.llDonationSecret.visibility = if (item.secretCan > 0) {
View.VISIBLE
} else {
View.GONE
}
val lp = binding.rlDonationRanking.layoutParams as FrameLayout.LayoutParams

View File

@ -37,6 +37,17 @@ class LiveRoomDonationRankingDialog(
adapter.notifyDataSetChanged()
dialogView.tvTotalCan.text = it.totalCan.moneyFormat()
dialogView.tvTotalCount.text = it.totalCount.moneyFormat()
dialogView.tvTotalSecretCan.text = it.totalSecretCan.moneyFormat()
if (it.totalSecretCan > 0) {
dialogView.llTotalCanSubTitle.visibility = View.VISIBLE
dialogView.tvTotalSecretCan.visibility = View.VISIBLE
dialogView.tvTotalCanSlash.visibility = View.VISIBLE
} else {
dialogView.llTotalCanSubTitle.visibility = View.GONE
dialogView.tvTotalSecretCan.visibility = View.GONE
dialogView.tvTotalCanSlash.visibility = View.GONE
}
}
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_fedc00" />
<corners android:radius="2.7dp" />
<stroke
android:width="1dp"
android:color="@color/color_fedc00" />
</shape>

View File

@ -41,30 +41,112 @@
android:paddingHorizontal="18.7dp"
android:paddingVertical="10.7dp">
<TextView
android:id="@+id/tv_total_can_title"
<LinearLayout
android:id="@+id/ll_total_can_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:fontFamily="@font/gmarket_sans_bold"
android:text="합계"
android:textColor="@color/color_d2d2d2"
android:textSize="13.3sp" />
android:orientation="horizontal">
<TextView
android:id="@+id/tv_total_can"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_bold"
android:text="합계"
android:textColor="@color/color_d2d2d2"
android:textSize="13.3sp" />
<LinearLayout
android:id="@+id/ll_total_can_sub_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_bold"
android:text=" ("
android:textColor="@color/color_d2d2d2"
android:textSize="13.3sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:text="일반"
android:textColor="@color/color_3bb9f1"
android:textSize="13.3sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:text="/"
android:textColor="@color/color_d2d2d2"
android:textSize="13.3sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:text="비밀"
android:textColor="@color/color_fedc00"
android:textSize="13.3sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_bold"
android:text=")"
android:textColor="@color/color_d2d2d2"
android:textSize="13.3sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="2.7dp"
android:layout_toStartOf="@+id/tv_total_can_unit"
android:layout_toEndOf="@+id/tv_total_can_title"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_80d8ff"
android:textSize="16sp"
tools:text="1,999,999" />
android:layout_toEndOf="@+id/ll_total_can_title"
android:gravity="end">
<TextView
android:id="@+id/tv_total_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_80d8ff"
android:textSize="14sp"
tools:text="1,999,999" />
<TextView
android:id="@+id/tv_total_can_slash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:text="/"
android:textColor="@color/white"
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_total_secret_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_fedc00"
android:textSize="14sp"
android:visibility="gone"
tools:text="1,999,999" />
</LinearLayout>
<TextView
android:id="@+id/tv_total_can_unit"
@ -110,7 +192,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:text="명"
android:text=" 명"
android:textColor="@color/color_777777"
android:textSize="12sp" />
</LinearLayout>

View File

@ -2,7 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:background="@color/black">
<RelativeLayout
android:id="@+id/rl_donation_ranking"
@ -69,32 +70,86 @@
android:textSize="13.3sp"
tools:text="Remix" />
<TextView
android:id="@+id/tv_donation_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="4dp"
android:layout_toStartOf="@+id/tv_donation_can_unit"
android:layout_toEndOf="@+id/tv_nickname"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_3bb9f1"
android:textSize="13.3sp"
tools:text="1000" />
<TextView
android:id="@+id/tv_donation_can_unit"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="13.3dp"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:text="캔"
android:textColor="@color/color_eeeeee"
android:textSize="10.7sp"
tools:ignore="SmallSp" />
android:layout_marginHorizontal="13.3dp"
android:layout_toEndOf="@+id/tv_nickname"
android:gravity="end|center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_donation_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_3bb9f1"
android:textSize="13.3sp"
tools:text="1000" />
<TextView
android:id="@+id/tv_donation_can_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:text="캔"
android:textColor="@color/color_eeeeee"
android:textSize="10.7sp"
tools:ignore="SmallSp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_donation_secret"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_2_7_fedc00"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:paddingHorizontal="3.33dp"
android:paddingVertical="2.67dp"
android:text="비밀"
android:textColor="@color/color_111111"
android:textSize="12sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/tv_donation_secret_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:textColor="@color/color_fedc00"
android:textSize="13.3sp"
tools:text="1000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="end"
android:text="캔"
android:textColor="@color/color_eeeeee"
android:textSize="10.7sp"
tools:ignore="SmallSp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</FrameLayout>

View File

@ -33,6 +33,7 @@
<color name="color_a285eb">#A285EB</color>
<color name="color_3d2a6c">#3D2A6C</color>
<color name="color_ffdc00">#FFDC00</color>
<color name="color_fedc00">#FEDC00</color>
<color name="color_4999e3">#4999E3</color>
<color name="color_35c2ff">#35C2FF</color>
<color name="color_97aeff">#97AEFF</color>