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.
CGS.reader().open(activity, issueId, page = lastPageRead)Every entry point is called open: what is being opened is said by the argument, not by the name, and anything the reader learns to open later joins them as another open overload rather than an openSomething. Each takes identifiers, so any of them can be called straight from a tap — the reader resolves what it needs behind its own loading state. An issue already on the device opens offline; one that is not is downloaded on the spot, and kept. Downloading ahead of time, and following a download, is what Download is for — reading never requires it.
Every entry point also takes a OneReaderTheme, the reader's palette. Its default is the engine's own; to match your brand, pass one built on a subclass of OneReaderColors that overrides only the colors you care about:
class BrandReaderColors : OneReaderColors() {
override val primary = OneReaderColor.parse("#E10E49")
}
CGS.reader().open(activity, issueId, theme = OneReaderTheme(colors = BrandReaderColors()))Functions
Opens one article in the native article reader — text and images, reflowable, without the issue it came from.
Opens an issue, downloading it first if it is not on the device.
Opens a list of articles at index, letting the reader swipe from one to the next without coming back out.