DylanCaiCoding / LoadingStateView

Decoupling the code of toolbar or loading status view. (深度解耦标题栏,解耦加载中、加载失败、无数据等缺省页,支持两行代码集成到基类)
Apache License 2.0
676 stars 53 forks source link

errorAdapter.errorText = "服务器繁忙,请稍后重试"; 请问errorText 这个view如何在外部调用呢 #10

Closed NeVaDaAAA closed 3 years ago

DylanCaiCoding commented 3 years ago

个人还是推荐用参数来控制,如果想这么用也可以,Adapter 把 view 暴露了。

  lateinit var tvError: TextView

  override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): LoadingHelper.ViewHolder {
    val view = inflater.inflate(R.layout.layout_error, parent, false)
    tvError = view.findViewById(R.id.tv_error)
    return LoadingHelper.ViewHolder(view)
  }
errorAdapter.tvError.text = "服务器繁忙"