【光环助手V5.9.0】新社区7期-论坛详情页优化(增加标签字体颜色字段)https://git.shanqu.cc/pm/halo-app-issues/-/issues/1789#note_146539
This commit is contained in:
@ -31,7 +31,11 @@ data class ForumDetailEntity(
|
||||
var style: Style = Style()
|
||||
)
|
||||
|
||||
data class Style(var color: String = "")
|
||||
data class Style(
|
||||
var color: String = "",
|
||||
@SerializedName("font_color")
|
||||
var fontColor: String = ""
|
||||
)
|
||||
|
||||
fun convertForumDetailEntityToForumEntity(): ForumEntity {
|
||||
val forumEntity = ForumEntity()
|
||||
|
||||
@ -31,11 +31,15 @@ class ForumTopLinkAdapter(
|
||||
linkNameTv.text = linkEntity.title
|
||||
linkEntity.category?.run {
|
||||
tagView.visibility = View.VISIBLE
|
||||
tagView.text = linkEntity.category!!.title
|
||||
if (linkEntity.category!!.style.color.isNotBlank()) {
|
||||
tagView.text = title
|
||||
tagView.setTextColor(
|
||||
if (style.fontColor.isNotBlank()) Color.parseColor(style.fontColor)
|
||||
else Color.WHITE
|
||||
)
|
||||
if (style.color.isNotBlank()) {
|
||||
tagView.background = DrawableView.getCornerGradientDrawable(
|
||||
Color.parseColor(linkEntity.category!!.style.color),
|
||||
Color.parseColor(linkEntity.category!!.style.color),
|
||||
Color.parseColor(style.color),
|
||||
Color.parseColor(style.color),
|
||||
3F
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user