This commit is contained in:
叶子维
2025-03-31 11:27:16 +08:00
parent 3825315f65
commit ebcfd9c85d
5 changed files with 6 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class GameDetailBriefItemViewHolder(
highlightedTextClickListener = TextHelper.CopyToClipboardHighlightedTextClick()
)
briefTv.post {
expandTv.isVisible = briefTv.lineCount == 3 && briefTv.layout.getEllipsisCount(2) > 0
expandTv.isVisible = briefTv.lineCount == 3 && (briefTv.layout?.getEllipsisCount(2) ?: 0) > 0
}
expandTv.setOnClickListener {
SensorsBridge.trackGameDetailModuleClick(

View File

@ -194,6 +194,8 @@ class GameDetailComprehensivePanelItemViewHolder(
maxLines = if (parentViewHolder.showPart && !parentViewHolder.isExpand) 1 else Int.MAX_VALUE
text = data.text
post {
if (layout == null) return@post
val hasEllipsize = layout.getEllipsisCount(0) > 0
if (parentViewHolder.showPart && hasEllipsize && !parentViewHolder.binding.expandTv.isVisible) {
parentViewHolder.binding.expandTv.isVisible = true

View File

@ -27,7 +27,7 @@ class GameDetailDeveloperWordItemViewHolder(
.fromHtmlCompat(PicassoImageGetter(contentTv), ExtraTagHandler())
)
contentTv.post {
expandTv.isVisible = (contentTv.lineCount == 3 && contentTv.layout.getEllipsisCount(2) > 0) || contentTv.lineCount > 3
expandTv.isVisible = (contentTv.lineCount == 3 && (contentTv.layout?.getEllipsisCount(2) ?: 0) > 0) || contentTv.lineCount > 3
}
expandTv.background = R.drawable.bg_ui_surface_expand_gradient.toDrawable(context)
expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))

View File

@ -36,7 +36,7 @@ class GameDetailUpdateItemViewHolder(
}
contentTv.text = entity.updateDes
contentTv.post {
expandTv.isVisible = contentTv.lineCount == 3 && contentTv.layout.getEllipsisCount(2) > 0
expandTv.isVisible = contentTv.lineCount == 3 && (contentTv.layout?.getEllipsisCount(2) ?: 0) > 0
}
expandTv.background = R.drawable.bg_ui_surface_expand_gradient.toDrawable(context)
expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))

View File

@ -63,7 +63,7 @@ class HistoryApkListAdapter(
holder.binding.expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(mContext))
holder.binding.updateDescTv.text = apkEntity.updateDesc
holder.binding.updateDescTv.post {
holder.binding.expandTv.isVisible = holder.binding.updateDescTv.lineCount == 3 && holder.binding.updateDescTv.layout.getEllipsisCount(2) > 0
holder.binding.expandTv.isVisible = holder.binding.updateDescTv.lineCount == 3 && (holder.binding.updateDescTv.layout?.getEllipsisCount(2) ?: 0) > 0
}
holder.binding.versionTv.text = "版本${apkEntity.version}"
holder.binding.releaseDateTv.text = TimeUtils.getFormatTime(apkEntity.updateTime)