Last active
May 1, 2020 15:04
-
-
Save Diolor/0fcbbe624c4ec652122df958c4fe3bb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ListAdapter is a superclass of RecyclerView.Adapter. | |
* Check the d.android.com for more. | |
*/ | |
class JobsAdapter : ListAdapter<JobListItem, JobViewHolder>() { | |
} | |
// items of 2 types | |
sealed class JobListItem { | |
object Header : JobListItem() | |
data class JobItem(val payload: Payload) : JobListItem() | |
} | |
// a ViewHolder per item | |
sealed class JobViewHolder(...) : RecyclerView.ViewHolder(...) { | |
class HeaderViewHolder(...) : JobViewHolder(..) | |
class JobViewHolder(...) : JobViewHolder(..) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment