1717package com.rayfantasy.icode.ui.adapter
1818
1919import android.app.Activity
20- import android.graphics.Color
2120import android.support.v7.widget.RecyclerView
2221import android.view.View
2322import android.view.ViewGroup
@@ -50,12 +49,13 @@ class CodeListAdapter(val activity: Activity, var codeGoods: MutableList<CodeGoo
5049 holder.pic.onClick {
5150 activity.startActivity<UserActivity >(" username" to codeGood.username.toString())
5251 }
53- if (codeGood.highlight ? : false ) {
52+ holder.binding.highlight = codeGood.highlight ? : false
53+ /* if (codeGood.highlight ?: false) {
5454 holder.title.setTextColor(Color.RED)
5555 holder.username.setTextColor(Color.RED)
5656 holder.subTitle.setTextColor(Color.RED)
5757 holder.username.append("被管理员临时高亮!")
58- }
58+ }*/
5959
6060 holder.bg.onClick {
6161 activity.startActivity<BlocksActivity >(" codeGood" to codeGood)
@@ -72,9 +72,11 @@ class CodeListAdapter(val activity: Activity, var codeGoods: MutableList<CodeGoo
7272 val title = itemView.title
7373 val subTitle = itemView.sub_title
7474 val bg = itemView.element_bg
75+ val binding: ItemRecyclerCodeListBinding
7576
7677 init {
77- ItemRecyclerCodeListBinding .bind(itemView).theme = ICodeTheme
78+ binding = ItemRecyclerCodeListBinding .bind(itemView)
79+ binding.theme = ICodeTheme
7880 }
7981 }
8082}
0 commit comments