Allowing the incremental addition of articles to the adapter

Currently, our adapter doesn't expose any function that will allow external clients to add articles to it. Let's add a simple function to allow groups of articles to be added:

fun add(articles: List<Article>) {
this.articles.addAll(articles)
notifyDataSetChanged()
}
notifyDataSetChanged() will let the adapter know that the contents have changed. This may cause items to be redrawn.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.126.211