优化已采集数据名包括换行符时显示不全的问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.sw.inbound.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Html
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.graphics.toColorInt
|
||||
@@ -24,8 +25,12 @@ class CollectSearchAdapter(var list: MutableList<SearchGoodsInfo.Record>) :
|
||||
|
||||
override fun onBindViewHolder(holder: VH, position: Int, item: SearchGoodsInfo.Record?) {
|
||||
holder.binding.let {
|
||||
var goodsName = item!!.goodsName?.split("WP")?.get(0)
|
||||
// if (goodsName?.contains("\n") == true) {
|
||||
// goodsName = goodsName?.split("\n")?.get(0)
|
||||
// }
|
||||
it.tvGoodsName.run {
|
||||
text = item!!.goodsName
|
||||
text = Html.fromHtml(goodsName)
|
||||
setTextColor(if (item!!.isSelected) "#FF0032C8".toColorInt() else "#FF666666".toColorInt())
|
||||
//setTextColor("#FF666666".toColorInt())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user