Skip to content

Commit

Permalink
second batch of updates for android content card ui documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rymorale committed Nov 11, 2024
1 parent 9fdc134 commit 56a75b6
Show file tree
Hide file tree
Showing 33 changed files with 451 additions and 91 deletions.
16 changes: 8 additions & 8 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ module.exports = {
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/observers/aepuieventobserver",
pages: [
{
title: "AepUIContentProvider",
title: "AepUIEventObserver",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/observers/aepuieventobserver",
},
{
title: "ContentCardUIProvider",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/observers/aepuieventobserver",
title: "ContentCardEventObserver",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/observers/contentcardeventobserver",
}
]
},
Expand Down Expand Up @@ -456,7 +456,7 @@ module.exports = {
},
{
title: "UI Models",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepbutton",
pages: [
{
title: "AEPButton",
Expand All @@ -475,12 +475,12 @@ module.exports = {
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aeptext"
},
{
title: "AEPTemplate",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aeptemplate"
title: "AEPUITemplate",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepuitemplate"
},
{
title: "AEPTemplateType",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aeptemplatetype"
title: "AEPUITemplateType",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepuitemplatetype"
},
{
title: "SmallImageTemplate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ keywords:

# API Reference

This document lists the public APIs available in the Messaging extension for implementing content card with UI.
This document provides information on how to use the Messaging APIs to receive content card views in your application.

### getContentCardUI

The `getContentCardUI` method retrieves a flow of [AepUI](./public-classes/aepui.md) objects for the provided surface. These `AepUI` objects represent templated content cards whose UI can be rendered using provided card composables.

<InlineAlert variant="info" slots="text"/>

Calling this API will not download content cards from Adobe Journey Optimizer; it will only retrieve the content cards that are already downloaded and cached by the Messaging extension. You **must** call [`updatePropositionsForSurfaces`](../api-usage.md#updatePropositionsForSurfaces) API from the AEPMessaging extension with the desired surfaces prior to calling this API.
Calling this API will not download content cards from Adobe Journey Optimizer; it will only retrieve the content cards that are already downloaded and cached by the Messaging extension. You **must** call [`updatePropositionsForSurfaces`](../../code-based/api-reference.md#updatePropositionsForSurfaces) API from the AEPMessaging extension with the desired surfaces prior to calling this API.

#### Syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ The `AepUI` interface represents a UI component that can be rendered using the A

## Interface Definition

<CodeBlock slots="code" repeat="1" languages="Kotlin" />
<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
sealed interface AepUI<T : AepUITemplate, S : AepCardUIState> {
Expand Down Expand Up @@ -91,11 +93,13 @@ fun updateState(newState: S)

## SmallImageUI

Implementation of the [AepUI](./aepui.md#Sealed Interface - AepUI) interface used in rendering a UI for a [SmallImageTemplate](./UIModels/smallimagetemplate.md).
Implementation of the [AepUI](#AepUI) interface used in rendering a UI for a [SmallImageTemplate](./ui-models/smallimagetemplate.md).

## Class Definition

<CodeBlock slots="code" repeat="1" languages="Kotlin" />
<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
class SmallImageUI(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
# Interface - AepUIContentProvider
---
title: AepUIContentProvider
description: This document contains information on the AepUIContentProvider interface.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# AepUIContentProvider

Responsible for retrieving and refreshing data as required by the UI.

Classes implementing this interface will define a strategy to provide content for rendering the UI.

## Interface Definition

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
interface AepUIContentProvider {
suspend fun getContent(): Flow<List<AepUITemplate>>
Expand All @@ -21,20 +40,28 @@ Retrieves the content for the UI.

#### Returns

The content for the UI as a flow of [AepUITemplate](../UIModels/aepuitemplate.md)s.
The content for the UI as a flow of [AepUITemplate](../ui-models/aepuitemplate.md)s.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
suspend fun getContent(): Flow<List<AepUITemplate>>
```

### refreshContent

Refreshes the content for the UI. Implementations should update the data into the flow returned by [getContent](./aepuicontentprovider.md#getContent).
Refreshes the content for the UI. Implementations should update the data into the flow returned by [getContent](#getContent).

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
suspend fun refreshContent()
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Class - ContentCardUIProvider
---
title: ContentCardUIProvider
description: This document contains information on the ContentCardUIProvider interface.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# ContentCardUIProvider

Messaging extension implementation of [AepUIContentProvider](./aepuicontentprovider.md). ContentCardUiProvider is responsible for fetching and managing the content for a given surface. It uses Adobe Messaging APIs to retrieve propositions and transform them into UI templates for display.

Expand All @@ -10,24 +25,32 @@ Retrieves a flow of AepUITemplate lists for the given surface. The flow emits up

#### Returns

A flow that emits lists of [AepUITemplate](../UIModels/aepuitemplate.md)s.
A flow that emits lists of [AepUITemplate](../ui-models/aepuitemplate.md)s.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
override suspend fun getContent(): Flow<List<AepUITemplate>>
```

### getContentCardUI

Retrieves a flow of AepUI instances for the given surface. This function initiates the content fetch using [getContent](./contentcarduiprovider.md#getcontent) and then returns a flow of AepUI instances that represent the UI templates. The flow emits updates whenever new content is fetched or any changes occur.
Retrieves a flow of AepUI instances for the given surface. This function initiates the content fetch using [getContent](#getcontent) and then returns a flow of AepUI instances that represent the UI templates. The flow emits updates whenever new content is fetched or any changes occur.

#### Returns

A [Flow](https://developer.android.com/kotlin/flow) that emits a list of AepUI instances.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
suspend fun getContentCardUI(): Flow<List<AepUI<*, *>>>
```
Expand All @@ -38,6 +61,10 @@ Updates the flow returned by [getContent](#getContent) with the latest cached co

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
override suspend fun refreshContent()
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ keywords:

# ContentCardMapper

Singleton class used to store a mapping between valid [ContentCardSchemaData](../../../public-classes/content-card-schema-data.md) and unique proposition id's. The schema data is used when sending proposition track requests to AJO.
Singleton class used to store a mapping between valid [ContentCardSchemaData](../../../public-classes/content-card-schema-data.md#android-interface) and unique proposition id's. The schema data is used when sending proposition track requests to AJO.

## Class Definition

<CodeBlock slots="code" repeat="1" languages="Kotlin" />
<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
class ContentCardMapper private constructor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: ContentCardUIEventListener
description: This document contains information regarding the ContentCardUIEventListener and its callback functions.
description: This document contains information on implementing the ContentCardUIEventListener.
keywords:
- Adobe Journey Optimizer
- Guide
Expand All @@ -19,7 +19,9 @@ Interface to handle different callback events which can occur for a displayed co

## Interface Definition

<CodeBlock slots="code" repeat="1" languages="Kotlin" />
<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
interface ContentCardUIEventListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Interface - AepUIEventObserver
---
title: AepUIEventObserver
description: This document contains information on the AepUIEventObserver interface.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# AepUIEventObserver

Interface for observing events related to AEP UI components. This interface defines a mechanism for handling various types of events triggered by lifecycle changes or user interactions with UI elements, such as display, dismiss, or user interaction events.
## Interface Definition

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
interface AepUIEventObserver {
fun onEvent(event: UIEvent<*, *>)
Expand All @@ -21,6 +40,10 @@ Called when an event related to a UI template occurs.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
fun onEvent(event: UIEvent<*, *>)
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Class - ContentCardEventObserver
---
title: ContentCardEventObserver
description: This document contains information on the ContentCardEventObserver class.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# ContentCardEventObserver

Messaging implementation of [AepUIEventObserver](./aepuieventobserver.md) for handling content card events.

Expand All @@ -14,6 +29,10 @@ Called when an event related to a Content Card UI template occurs.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
override fun onEvent(event: UIEvent<*, *>)
```
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Open Class - AepCardUIState
---
title: AepCardUIState
description: This document contains information on the AepCardUIState.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

Class representing the state of an AEP card. This class includes the common properties `dismissed` and `displayed` which are common across different card states.
# AepCardUIState

Class representing the state of an AEP card. This class includes the properties `dismissed` and `displayed` which are common across different card states.
## Class Definition

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
open class AepCardUIState(
open val dismissed: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Data Class - SmallImageCardUIState
---
title: SmallImageCardUIState
description: This document contains information on the SmallImageCardUIState.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

Class representing the UI state of a Small Image template card.
# SmallImageCardUIState

Class which implements [AepCardUIState](./aepcarduistate.md) and represents the UI state of a Small Image template card.
## Class Definition

<CodeBlock slots="heading, code" repeat="1" languages="Kotlin" />

#### Kotlin

```kotlin
data class SmallImageCardUIState(
override val dismissed: Boolean = false,
Expand Down

This file was deleted.

Loading

0 comments on commit 56a75b6

Please sign in to comment.