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)
}
}
}| PublicationScreen | A publication: its latest issue, its articles, a preview of its archives. |
| ArticleListScreen | Every article of a publication, paginated. |
| ArchivesScreen | Every archived issue of a publication, year by year. |
| LibraryScreen | The issues downloaded on this device. |
| CorporateMediaScreen | A corporate media's documents. |
| VideoMediaScreen | Videos 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:
Your brand color — cgsColorScheme(darkTheme, brand, accent) derives a complete, contrast-checked scheme from two colors.
Token by token — lightColorScheme and darkColorScheme take a replacement for any group of the palette.
Screens that accept a colors parameter can also be re-coloured one at a time, without touching the theme.
Packages
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.
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.