generated from AdobeDocs/dev-site-documentation-template
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial batch of updates for android content card ui documentation
- Loading branch information
Showing
35 changed files
with
1,496 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/pages/edge/adobe-journey-optimizer/content-card-ui/Android/api-usage.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
``` |
77 changes: 77 additions & 0 deletions
77
src/pages/edge/adobe-journey-optimizer/content-card-ui/Android/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.