Generate Default ComponentViewBase classes
- Dominant language
- Kotlin
- Stars
- 21
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Since ComponentViewBase classes have so much auto generated functionality, it's now often not even necessary to override them.
Because of this, clients often wind up with code that looks like this:
`@(viewHolderClass = DetailedUsageLabelViewHolder::class)
class DetailedUsageLabel : DetailedUsageLabelBase()
@ComponentViewHolder(viewType = R.layout.detailed_usage_label)
class DetailedUsageLabelViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val label: TextView = itemView.findViewById(R.id.label) as TextView
}`
In this example, the DetailedUsageLabel class has to be written and annotated, even though it has no functionality.
Solution: When a ComponentViewHolder class is declared with no ComponentViewClass, annotate the create the ComponentViewBase class, name it as the ComponentView class, and annotate it as the ComponentViewClass for that ComponentViewHolder.
Contributor guide
Research direction
Start by locating the ComponentViewHolder, ComponentViewBase, and ComponentViewClass declarations and the code-generation entry point that connects them. Verify the behavior using the DetailedUsageLabelViewHolder example: a holder without an explicit view class should result in the matching generated base class and annotation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100