ui

Ready-made Jetpack Compose screens, and the design system that themes them.

Every screen is self-contained: give it an identifier and a callback, and it fetches, paginates and renders on its own. It never navigates — it reports what the user did through a sealed event type and leaves the destination to you.

CgsTheme(colorScheme = cgsColorScheme(isSystemInDarkTheme())) {
PublicationScreen(publicationId = id) { event ->
when (event) {
is PublicationEvent.ClickOnIssue -> navigateToReader(event.issue, event.page)
is PublicationEvent.ClickOnArticle -> navigateToArticles(event.articles, event.index)
is PublicationEvent.ClickOnSeeAllArticles -> navigateToArticleList(id)
is PublicationEvent.ClickOnSeeAllArchives -> navigateToArchives(event.publication.id)
}
}
}
PublicationScreenA publication: its latest issue, its articles, a preview of its archives.
ArticleListScreenEvery article of a publication, paginated.
ArchivesScreenEvery archived issue of a publication, year by year.
LibraryScreenThe issues downloaded on this device.
CorporateMediaScreenA corporate media's documents.
VideoMediaScreenVideos across a set of publications.

Theming

Wrap anything from this module in CgsTheme. Out of the box it uses the SDK's own palette; two levels of customisation are available above that:

Screens that accept a colors parameter can also be re-coloured one at a time, without touching the theme.

Packages

Link copied to clipboard

Individual pieces — an article card, a document row, a video grid — for building a screen the SDK does not already provide. Unlike the screens, these are stateless: you pass the data in and handle the clicks yourself.

Link copied to clipboard

The color sets each component accepts. Every one comes with a …Default object that reads the current CgsTheme — start there and override only what you need.

Link copied to clipboard

What the stateless components render. Map your own data into these before handing it over.

Link copied to clipboard

The library screen: every issue the download manager holds for the current profile, and the selection mode that deletes them.

The corporate media screen, listing a media's documents.

Link copied to clipboard

The video screen, listing videos across a set of publications.

Link copied to clipboard

The three publication screens — the publication itself, its full article list, and its archives — with the events they emit and the colors they accept.

Link copied to clipboard

The design system: CgsTheme, the color palette, and the type scale. This is what you touch to make the SDK's screens look like your app.

Link copied to clipboard

Stable test tags on the SDK's own composables, so your UI tests can address them without depending on text that translates or layout that moves.