July 2018
Intermediate to advanced
266 pages
7h 11m
English
As mentioned previously, we want to display a convenient set of information about each of the articles: feed, title, and summary. So let's create a data class that will hold that information. We can create it right below Feed:
package co.starcarr.rssreader.modeldata class Feed( val name: String, val url: String)data class Article( val feed: String, val title: String, val summary: String)
Instead of having the function asyncFetchHeadlines(), which returns only the title, we want the function to now be named asyncFetchArticles() and return a Deferred<List<Article>> corresponding to the articles of that feed:
private fun asyncFetchArticles(feed: Feed, dispatcher: CoroutineDispatcher ...
Read now
Unlock full access