Package-level declarations

The content types the catalogue is made of, and the wrappers they arrive in. Each entity comes in a full form (Article) and a light one (ArticleShort) — lists give you the light form, get gives you the full one. Publications and issues also come in a reference form (PublicationReference, IssueReference): the few fields another item carries about the one it belongs to, such as IssueShort.publication.

Types

Link copied to clipboard
class Article

Represents an article with full detail.

Link copied to clipboard
sealed interface ArticleElement

Represents a single element within an article's body. Elements are ordered and typed — the type property determines which concrete subtype to expect. Elements are either text-based subtypes each carrying a value string, or image-based (ArticleImage).

Link copied to clipboard
value class ArticleId(val value: String) : Parcelable

An identifier for article data

Link copied to clipboard

An image in an article's body, or the article's own lead image.

Link copied to clipboard

Represents a lightweight form of an article item: the minimal content lists return, enough to display lists of articles. For more detail, get the full Article from Articles.get.

Link copied to clipboard
sealed interface CgsResult<out T>

The outcome of a one-shot call that can fail: either Success with a value, or Failure with a CgsError saying why.

Link copied to clipboard
sealed interface CgsStreamState<out T>

The state of an observed value: what the SDK currently holds, and what it is doing about it.

Link copied to clipboard

What kind of thing a Publication is. Editorial rather than technical — it says how a publication should be presented and grouped, not how its content is read (that is ContentType).

Link copied to clipboard

What a Publication publishes, which decides how its content is read.

Link copied to clipboard
data class DateRange(val from: Instant, val to: Instant)

A date window used to narrow a content search down to what was released inside it — see co.cafeyn.cgs.api.content.Issues.all.

Link copied to clipboard
class Edition

One edition of a MultiEdition group.

Link copied to clipboard
sealed class Enrichment

Represents an issue enrichment.

Link copied to clipboard
value class ExternalId(val value: String) : Parcelable

An identifier for video external id

Link copied to clipboard

Builds domain models for the previews and tests of lib/ui.

Link copied to clipboard
class Issue

Represents an issue with full detail.

Link copied to clipboard
value class IssueId(val value: String) : Parcelable

An identifier for issue data

Link copied to clipboard

Represents a lightweight form of an issue item: the few fields an ArticleShort carries about the issue it belongs to.

Link copied to clipboard

Represents a lightweight form of an issue item: the minimal content lists return, enough to display lists of issues. For more detail, get the full Issue from Issues.get.

Link copied to clipboard
value class LanguageId(val value: String) : Parcelable

An identifier for language data

Link copied to clipboard
sealed interface LoadState

Where one of a list's two loads stands.

Link copied to clipboard
class Media

Represents a media with full detail.

Link copied to clipboard
value class MediaId(val value: String) : Parcelable

An identifier for media data

Link copied to clipboard

Represents a lightweight form of a media item: the minimal content lists return, enough to display lists of media. For more detail, get the full Media from Medias.get.

Link copied to clipboard
value class MediaTrackId(val value: String) : Parcelable

An identifier for media track data

Link copied to clipboard

The editions of a multi-edition publication group (a regional daily, typically).

Link copied to clipboard
class Page<T>

Represents a paginated result of a listing.

Link copied to clipboard
data class PaginatedLoadStates(val refresh: LoadState, val append: LoadState)

The two loads a paginated list runs, tracked apart because they mean different things on screen: a first load owns the whole screen, a next-page load owns a footer.

Link copied to clipboard
interface PaginatedResource<out T>

A list that arrives one page at a time.

Link copied to clipboard
data class PaginatedState<out T>(val items: List<T>, val loadStates: PaginatedLoadStates)

Everything a paginated list needs to draw itself: the items loaded so far, and what the loading is doing.

Link copied to clipboard
value class ProfileId(val value: String) : Parcelable

An identifier for a profile

Link copied to clipboard

Represents a publication with full detail.

Link copied to clipboard
value class PublicationId(val value: String) : Parcelable

An identifier for publication data

Link copied to clipboard

Represents a lightweight form of a publication item: the few fields another item carries about a publication, as in IssueShort.publication or Media.publications.

Link copied to clipboard

Represents a lightweight form of a publication item: the minimal content lists return, enough to display lists of publications. For more detail, get the full Publication from Publications.get.

Link copied to clipboard
value class ReleaseFrequencyId(val value: String) : Parcelable

An identifier for release frequency data

Link copied to clipboard
value class TemplateId(val value: Int) : Parcelable

An identifier for template data

Link copied to clipboard
value class TopicId(val value: String) : Parcelable

An identifier for topic data

Link copied to clipboard
class Video

Represents a video with full detail.

Link copied to clipboard
value class VideoId(val value: String) : Parcelable

An identifier for video data

Link copied to clipboard

Represents a lightweight form of a video item: the minimal content lists return, enough to display lists of videos. For more detail, get the full Video from Videos.get.

Properties

Link copied to clipboard

There is another page to fetch. Drive PaginatedResource.loadNextPage off this as the user nears the end of the list; it is false while the next page is in flight, so it will not ask twice. It also reads true while the first page is loading, a call PaginatedResource.loadNextPage ignores.

Link copied to clipboard

The error to show over the whole screen: set only when the list failed with nothing to display. A failure that still has items behind it stays null here — surface that one in place, without taking the list away.

Link copied to clipboard

The list came back with nothing — show an empty state, not an error. false while the first page is still loading and while it is in error, so it never flashes before the real answer.

Link copied to clipboard

The list has nothing yet and is fetching its first page — show a skeleton or a spinner over the whole screen.