CymChad / CymChad/BaseRecyclerViewAdapterHelper
BaseQuickAdapter能改成原来那种可以在参数里传递资源id的吗?
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 24.6k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
这是我之前重写3.x版本的BaseQuickAdapter的adapter基类,这样就只需要在子类重写convert方法设置item数据就行了,不需要onCreateViewHolder回调
abstract class BaseAdapter<T>(@LayoutRes private val layoutResId: Int, data: MutableList<T>? = null) :
BaseQuickAdapter<T, BaseViewHolder>(layoutResId, data)
class SimpleAdapter(dataList: MutableList<Response>) : BaseAdapter<Response>(R.layout.item_simple_list, dataList) {
override fun convert(holder: BaseViewHolder, item: Response) {
......
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the BaseQuickAdapter API and compare its current construction and onCreateViewHolder flow with the requested BaseAdapter example. The work is done when a subclass can pass an item layout resource ID and implement only convert, without needing an onCreateViewHolder callback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100