Skip to content

Commit

Permalink
initial 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 8, 2024
1 parent 0e0c416 commit 9fdc134
Show file tree
Hide file tree
Showing 35 changed files with 1,496 additions and 0 deletions.
164 changes: 164 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,170 @@ module.exports = {
]
}
]
},
{
title: "Android",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android",
pages: [
{
title: "API Reference",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/api-usage.md"
},
{
title: "Public Classes and Interfaces",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/aepui",
pages: [
{
title: "AepUI",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/aepui",
},
{
title: "ContentCardMapper",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/contentcardmapper",
},
{
title: "ContentCardUIEventListener",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/contentcarduieventlistener",
},
{
title: "UIAction",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/uiaction",
},
{
title: "UIEvent",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/uievent",
}
]
},
{
title: "Content Provider",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/content-provider/aepuicontentprovider",
pages: [
{
title: "AepUIContentProvider",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/content-provider/aepuicontentprovider",
},
{
title: "ContentCardUIProvider",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/content-provider/contentcarduiprovider",
}
]
},
{
title: "Observers",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/observers/aepuieventobserver",
pages: [
{
title: "AepUIContentProvider",
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: "State",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/state/aepcarduistate",
pages: [
{
title: "AepCardUIState",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/state/aepcarduistate",
},
{
title: "SmallImageCardUIState",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/state/smallimagecarduistate",
}
]
},
{
title: "Styles",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepbuttonstyle",
pages: [
{
title: "AepButtonStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepbuttonstyle",
},
{
title: "AepCardStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepcardstyle",
},
{
title: "AepColumnStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepcolumnstyle",
},
{
title: "AepIconStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepiconstyle",
},
{
title: "AepImageStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aepimagestyle",
},
{
title: "AepRowStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/aeprowstyle",
},
{
title: "SmallImageUIStyle",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/styles/smallimageuistyle",
}
]
},
{
title: "UI Models",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/",
pages: [
{
title: "AEPButton",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepbutton"
},
{
title: "AEPIcon",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepicon"
},
{
title: "AEPImage",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aepimage"
},
{
title: "AEPText",
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: "AEPTemplateType",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/aeptemplatetype"
},
{
title: "SmallImageTemplate",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/public-classes/ui-models/smallimagetemplate"
}
]
},
{
title: "Tutorials",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/tutorial/displaying-content-cards",
pages: [
{
title: "Fetch and Display Content Cards",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/tutorial/displaying-content-cards",
},
{
title: "Customizing Content Cards",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/tutorial/customizing-content-card-templates",
},
{
title: "Listening to Content Card Events",
path: "/edge/adobe-journey-optimizer/content-card-ui/Android/tutorial/listening-content-card-events",
}
]
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Content Card UI API Usage
description: Learn how to use the Messaging extension APIs to implement content card with UI.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# API Reference

This document lists the public APIs available in the Messaging extension for implementing content card with UI.

### 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.

#### Syntax

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

#### Kotlin

```kotlin
suspend fun getContentCardUI(): Flow<List<AepUI<*, *>>>
```

#### Example

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

#### Kotlin

```kotlin
// Download the content cards for homepage surface using Messaging extension
val surfaces = mutableListOf<Surface>()
val surface = Surface("homepage")
surfaces.add(surface)
Messaging.updatePropositionsForSurfaces(surfaces)

// Initialize the ContentCardUIProvider
val contentCardUIProvider = ContentCardUIProvider(surface)

// get the content cards within a view model
class MyScreenViewModel : ViewModel {
private val contentCardUIProvider = MessagingContentCardProvider(...)
private val _aepUIList = MutableStateFlow<List<AepUI<*, *>>>(emptyList())
val aepUIList: StateFlow<List<AepUI<*, *>>> = _aepUIList.asStateFlow()

// fetch the list of cards when necessary
viewModelScope.launch {
contentCardUIProvider.getContentCardUI().collect {
aepUi ->
_aepUIList.value = aepUi
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Content Card UI
description: These documents guide you to integrating a content card ui message with an Android app.
keywords:
- Adobe Journey Optimizer
- Guide
- Content Card
- Messaging
- Customizing UI
- Card Templates
- Content Card Templates
- Small Image Template
- Android
---

# Content Card UI

## Requirements

* Latest version of [Android Studio](https://developer.android.com/studio)
* Android API 21 (or newer)
* Kotlin 1.5.0 (or newer)
* App with support for [Jetpack Compose](https://developer.android.com/develop/ui/compose/setup)

## API Reference

* [Content Card API's](./api-usage.md)

## Public Classes, Enums, and Interfaces

- [Interface - AepUI](./public-classes/aepui.md)
- [Class - ContentCardMapper](./public-classes/contentcardmapper.md)
- [Interface - ContentCardUIEventListener](./public-classes/contentcarduieventlistener.md)
- [Class - UIAction](./public-classes/uiaction.md)
- [Class - UIEvent](./public-classes/uievent.md)

## Content Provider

- [AepUIContentProvider](./public-classes/content-provider/aepuicontentprovider.md)
- [ContentCardUIProvider](./public-classes/content-provider/contentcarduiprovider.md)

## Observers

- [AepUIEventObserver](./public-classes/observers/aepuieventobserver.md)
- [ContentCardEventObserver](./public-classes/observers/contentcardeventobserver.md)

## State

- [AepCardUIState](./public-classes/state/aepcarduistate.md)
- [SmallImageCardUIState](./public-classes/state/smallimagecarduistate.md)

## Styles

- [AepButtonStyle](./public-classes/styles/aepbuttonstyle.md)
- [AepCardStyle](./public-classes/styles/aepcardstyle.md)
- [AepColumnStyle](./public-classes/styles/aepcolumnstyle.md)
- [AepIconStyle](./public-classes/styles/aepiconstyle.md)
- [AepImageStyle](./public-classes/styles/aepimagestyle.md)
- [AepRowStyle](./public-classes/styles/aeprowstyle.md)
- [AepTextStyle](./public-classes/styles/aeptextstyle.md)
- [SmallImageUIStyle](./public-classes/styles/smallimageuistyle.md)

## UI Models

* [AepButton](./public-classes/ui-models/aepbutton.md)
* [AepIcon](./public-classes/ui-models/aepicon.md)
* [AepImage](./public-classes/ui-models/aepimage.md)
* [AepText](./public-classes/ui-models/aeptext.md)
* [AepUITemplate](./public-classes/ui-models/aepuitemplate.md)
* [AepUITemplateType](./public-classes/ui-models/aepuitemplatetype.md)
* [SmallImageTemplate](./public-classes/ui-models/smallimagetemplate.md)

## Tutorials

* [Fetch and Display Content Cards](./tutorial/displaying-content-cards.md)
* [Customizing Content Card Templates](./tutorial/customizing-content-card-templates.md)
* [Listening to Content Card Events](./tutorial/listening-content-card-events.md)
Loading

0 comments on commit 9fdc134

Please sign in to comment.