Commit f23ec9ee authored by jyx's avatar jyx

代码优化

parent 4776f27b
......@@ -87,12 +87,21 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
val adBtn = holder.getView<View>(R.id.unlock)
vedioBean?.let {
try {
val unlockText = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
val unlockText = if (it.adGiveVedioNum > 1) {
String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
} else {
String.format(
"解锁%s·第%d集",
it.title,
it.unlockIndex + 1
)
}
AppConfig.detailDialogUnlockText = unlockText
} catch (e: Exception) {
......
......@@ -59,12 +59,20 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
val adBtn = holder.getView<View>(R.id.unlock)
vedioBean?.let {
try {
val unlockText = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
val unlockText = if (it.adGiveVedioNum > 1) {
String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
} else {
String.format(
"解锁%s·第%d集",
it.title,
it.unlockIndex + 1
)
}
AppConfig.detailDialogUnlockText = unlockText
} catch (e: Exception) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment