fix:社区新增关注页面—0529测试—客户端 https://jira.shanqu.cc/browse/GHZSCY-5521
This commit is contained in:
@ -5,6 +5,7 @@ import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.utils.formatTime
|
||||
import com.gh.gamecenter.common.utils.toBinding
|
||||
import com.gh.gamecenter.databinding.ItemArchiveLimitBinding
|
||||
import com.gh.gamecenter.entity.ArchiveEntity
|
||||
@ -29,10 +30,7 @@ class ArchiveLimitAdapter(context: Context) : ListAdapter<ArchiveLimitAdapter.Ar
|
||||
if (holder is ArchiveLimitViewHolder) {
|
||||
val item = mEntityList[position]
|
||||
holder.binding.tvTitle.text = item.data.name
|
||||
val timeLong = item.data.time.create
|
||||
val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA)
|
||||
val date = Date(timeLong)
|
||||
holder.binding.tvTime.text = sdf.format(date)
|
||||
holder.binding.tvTime.text = item.data.time.create.formatTime("yyyy-MM-dd HH:mm")
|
||||
|
||||
val resId = if (item.isChecked) R.drawable.ic_selector_selected else R.drawable.ic_selector_default
|
||||
holder.binding.ivSelector.setImageResource(resId)
|
||||
@ -53,10 +51,10 @@ class ArchiveLimitAdapter(context: Context) : ListAdapter<ArchiveLimitAdapter.Ar
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int, payloads: MutableList<Any?>) {
|
||||
if(holder is ArchiveLimitViewHolder){
|
||||
if(payloads.isEmpty()){
|
||||
if (holder is ArchiveLimitViewHolder) {
|
||||
if (payloads.isEmpty()) {
|
||||
onBindViewHolder(holder, position)
|
||||
}else{
|
||||
} else {
|
||||
val item = mEntityList[position]
|
||||
val resId = if (item.isChecked) R.drawable.ic_selector_selected else R.drawable.ic_selector_default
|
||||
holder.binding.ivSelector.setImageResource(resId)
|
||||
|
||||
@ -75,9 +75,11 @@ class FollowRecommendListAdapter(
|
||||
|
||||
fun updateFollowed(change: EBUserFollow) {
|
||||
val position = resetDataChangeHelper.dataList.indexOfFirst { it.id == change.userId }
|
||||
val item = resetDataChangeHelper.dataList[position]
|
||||
item.isFollowed = change.isFollow
|
||||
notifyItemChanged(position)
|
||||
if (position != -1) {
|
||||
val item = resetDataChangeHelper.dataList[position]
|
||||
item.isFollowed = change.isFollow
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user