fix: 修复游戏详情页偶发空指针闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/443716/?project=22
This commit is contained in:
@ -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(
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user