添加接口

This commit is contained in:
2025-11-28 14:39:57 +08:00
parent 784a67214d
commit 995d7c1e90
8 changed files with 196 additions and 36 deletions

View File

@@ -25,7 +25,7 @@ class RoomMentorShipWheatView : BaseWheatView {
private var iv_tag_type: ImageView? = null
private var hostTv:TextView? = null
private var hostTv: TextView? = null
override fun initPit(context: Context, attrs: AttributeSet) {
var typedArray: TypedArray? = null
@@ -57,27 +57,42 @@ class RoomMentorShipWheatView : BaseWheatView {
this.pitNumber = number
}
fun setHostTv(hostTv:TextView){
fun setHostTv(hostTv: TextView) {
this.hostTv = hostTv
}
public override fun setPitData(bean: RoomPitBean) {
pitBean = bean // 统一使用参数 bean
stopAndClearAnimation() // 清理之前的动画资源
if ((pitBean.pit_number == "9" || pitBean.pit_number == "1") && bean.user_id != "0") {
mCharmView.visibility = VISIBLE
if (pitBean.pit_number == "9") {
mTvName.visibility = GONE
hostTv?.visibility = VISIBLE
hostTv?.text = bean.nickname
mCharmView.setBg(0)
when (bean.pit_number) {
"9" -> {
if (bean.user_id != "0") {
mCharmView.visibility = VISIBLE
mTvName.visibility = GONE
hostTv?.visibility = VISIBLE
hostTv?.text = bean.nickname
} else {
mTvName.visibility = VISIBLE
mCharmView.visibility = INVISIBLE
hostTv?.visibility = GONE
}
}
"1" -> {
if (bean.user_id != "0") {
mCharmView.visibility = VISIBLE
} else {
mCharmView.visibility = INVISIBLE
}
}
else -> {
mCharmView.visibility = GONE
}
}else{
mTvName.visibility = VISIBLE
mCharmView.visibility = INVISIBLE
hostTv?.visibility = GONE
}
if (isOn) {
handleOnState(bean)
} else {