fix:修复已解锁后文案展示问题
This commit is contained in:
@@ -68,20 +68,7 @@ class GiftUnLockInfoAdapter(list: List<UnlockItem>) :
|
|||||||
} else {
|
} else {
|
||||||
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
|
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
|
||||||
}
|
}
|
||||||
var unlockItem: UnLockGiftInfo? = null
|
|
||||||
if (item is UnLockGiftInfo) {
|
|
||||||
unlockItem = item
|
|
||||||
}
|
|
||||||
val total = unlockItem?.condition ?: 0
|
|
||||||
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
|
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
|
||||||
val nameView = helper.getView<TextView>(R.id.tv_name)
|
|
||||||
SpannableTextBuilder(nameView)
|
|
||||||
.appendText("送出")
|
|
||||||
.appendText(
|
|
||||||
" ${total}个 ",
|
|
||||||
textColor = nameView.context.getColorById(R.color.color_FFDA24)
|
|
||||||
)
|
|
||||||
.appendText("${baseGiftName ?: ""}可解锁").apply()
|
|
||||||
convertChildState(helper, item)
|
convertChildState(helper, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,13 +87,24 @@ class GiftUnLockInfoAdapter(list: List<UnlockItem>) :
|
|||||||
helper.setText(R.id.tv_count, "$progress/$total")
|
helper.setText(R.id.tv_count, "$progress/$total")
|
||||||
val lockIconView = helper.getView<View>(R.id.iv_lock)
|
val lockIconView = helper.getView<View>(R.id.iv_lock)
|
||||||
val alpha: Float
|
val alpha: Float
|
||||||
|
val lockText: String
|
||||||
if (unlockItem?.unlocked == true) {
|
if (unlockItem?.unlocked == true) {
|
||||||
alpha = 1f
|
alpha = 1f
|
||||||
lockIconView.isVisible = false
|
lockIconView.isVisible = false
|
||||||
|
lockText = "已解锁"
|
||||||
} else {
|
} else {
|
||||||
alpha = 0.5f
|
alpha = 0.5f
|
||||||
lockIconView.isVisible = true
|
lockIconView.isVisible = true
|
||||||
|
lockText = "可解锁"
|
||||||
}
|
}
|
||||||
|
val nameView = helper.getView<TextView>(R.id.tv_name)
|
||||||
|
SpannableTextBuilder(nameView)
|
||||||
|
.appendText("送出")
|
||||||
|
.appendText(
|
||||||
|
" ${total}个 ",
|
||||||
|
textColor = nameView.context.getColorById(R.color.color_FFDA24)
|
||||||
|
)
|
||||||
|
.appendText("${baseGiftName ?: ""}${lockText}").apply()
|
||||||
helper.setAlpha(R.id.tv_name, alpha)
|
helper.setAlpha(R.id.tv_name, alpha)
|
||||||
helper.setAlpha(R.id.iv_cover, alpha)
|
helper.setAlpha(R.id.iv_cover, alpha)
|
||||||
helper.setAlpha(R.id.tv_count, alpha)
|
helper.setAlpha(R.id.tv_count, alpha)
|
||||||
|
Reference in New Issue
Block a user