Reader

interface Reader

The reading experience: an issue rendered page by page, or an article rendered as text.

Obtained from CGS.reader. Each entry point launches a full-screen Activity of its own and returns immediately — the reader owns the screen from there, and comes back to yours when the user leaves it.

val item = CGS.download().issue(issueId)
// once item.state is Download.Item.State.Downloaded
CGS.reader().open(activity, item, page = lastPageRead)

Reading an issue means downloading it first: open takes a Download.Item, not an id. Articles have no such requirement — openArticle and openArticles fetch what they need on the spot.

Reading progress is recorded as pages are turned; read it back through CGS.readings to offer a "resume where you left off".

Functions

Link copied to clipboard
abstract fun open(activity: Activity, item: Download.Item, page: Int = 1)

Opens a downloaded issue.

Link copied to clipboard
abstract fun openArticle(activity: Activity, article: Article)

Opens one article in the native article reader — text and images, reflowable, without the issue it came from.

Link copied to clipboard
abstract fun openArticles(activity: Activity, articleIds: List<ArticleId>, index: Int = 0)

Opens a list of articles at index, letting the reader swipe from one to the next without coming back out.