Initial library setup#70
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/content-card #70 +/- ##
=======================================================
Coverage 92.08% 92.08%
Complexity 289 289
=======================================================
Files 38 38
Lines 1871 1871
Branches 174 174
=======================================================
Hits 1723 1723
Misses 86 86
Partials 62 62
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| } | ||
|
|
||
|
|
||
| class SmallImageAepUi( |
There was a problem hiding this comment.
Can we move this to its own file?
Can we decide if it needs to be Aep or AEP and apply it across all file and class names? I vote for the latter since its an acronym and it would be consistent with the class names in Core UI service
Can we also change ui to UI?
| /** | ||
| * Composable for rendering a list of AEP UI components. | ||
| * Maintains a list of AEP UI components and renders them using the provided container. | ||
| */ |
There was a problem hiding this comment.
Let's add descriptions of what the @params mean here
| uiAsComposable.invoke() | ||
| } | ||
|
|
||
| Button(onClick = { viewModel.loadMore() }, Modifier.fillMaxWidth()) { |
There was a problem hiding this comment.
This button was added for testing. We don't need it in the actual implementation
| } | ||
| } | ||
|
|
||
| fun loadMore() { |
There was a problem hiding this comment.
can we call this refreshList? The content provider is expected to update the contentFlow when this is called thereby refreshing the list view
There was a problem hiding this comment.
Also we don't need to support this right now. It was just there for POC. We can add it later if needed
|
|
||
| /** | ||
| * Composable for rendering a Small Image Card | ||
| */ |
There was a problem hiding this comment.
Please add description for @params
Also let's make this public. Apps should be able to use this composable, just like the list one
| sealed interface AepUiState | ||
|
|
||
| data class SmallImageUIState(val title: String?, val dismissed: Boolean = false) : AepUiState | ||
| data class LargeImageUIState(val dismissed: Boolean = false) : AepUiState |
There was a problem hiding this comment.
LargeImageUIState is out of the scope of this release let's remove it
|
|
||
| sealed interface AepUiState | ||
|
|
||
| data class SmallImageUIState(val title: String?, val dismissed: Boolean = false) : AepUiState |
There was a problem hiding this comment.
Let's move this to its own file
It will need to be changed in future PRs to reflect actual values the state needs to hold
| import androidx.compose.ui.text.style.TextAlign | ||
|
|
||
| // only needed when we support server side styling | ||
| fun AEPText.getComposeTextStyle(): TextStyle { |
There was a problem hiding this comment.
Can we remove this class? There's no support for server side styling in AJO. We can add it when we need to
| val smallImageAepUiStyle: SmallImageAepUiStyle = SmallImageAepUiStyle() | ||
| ) | ||
|
|
||
| class SmallImageAepUiStyle( |
There was a problem hiding this comment.
Let's move this also to its own file
| */ | ||
| suspend fun getContent(): Flow<List<AepUiTemplate>> | ||
|
|
||
| suspend fun refreshContent() |
There was a problem hiding this comment.
Please add a description for this method
/**
* Refreshes the content for the UI by updating the flow provided in getContent`
*/
| import com.adobe.marketing.mobile.aepcomposeui.aepui.AepUI | ||
| import com.adobe.marketing.mobile.aepcomposeui.aepui.state.AepUiState | ||
|
|
||
| sealed interface UIEvent<T : AepUiTemplate, S : AepUiState> { |
There was a problem hiding this comment.
Let's add some description for this interface and what T and S mean
|
|
||
| import com.adobe.marketing.mobile.aepcomposeui.interactions.UIEvent | ||
|
|
||
| interface AepUiEventObserver { |
There was a problem hiding this comment.
Same comment here. Let's add a description for the interface and what onEvent is for
|
|
||
| import com.adobe.marketing.mobile.aepuitemplates.utils.AepUiTemplateType | ||
|
|
||
| class SmallImageTemplate() : AepUiTemplate { |
There was a problem hiding this comment.
This is a public class. Please provide some description here
| enum class AepUiTemplateType(val typeName: String) { | ||
|
|
||
| SMALL_IMAGE("SmallImage"), | ||
| LARGE_IMAGE("LargeImage") |
There was a problem hiding this comment.
We're not adding large image in the first iteration. Can we remove this enum?
| notificationbuilderMavenRepoDescription=Android Notification Builder library for Adobe Mobile Marketing | ||
|
|
||
| aepComposeUiModuleName = aepcomposeui | ||
| aepComposeUiVersion=1.0.1 |
There was a problem hiding this comment.
This needs to be 3.0.0. We align major versions of all SDKs
| aepComposeUiMavenRepoDescription = Android AEP Compose UI library for Adobe Mobile Marketing | ||
|
|
||
| aepUiTemplatesModuleName = aepuitemplates | ||
| aepUiTemplatesVersion=1.0.1 |
There was a problem hiding this comment.
Same comment here. Let's make it 3.0.0
| } | ||
|
|
||
| dependencies { | ||
| implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion") |
There was a problem hiding this comment.
Why does this library need MobileCore dependency?
| val aepUiTemplatesMavenRepoDescription: String by project | ||
|
|
||
| aepLibrary { | ||
| namespace = "com.adobe.marketing.mobile.aepcomposeui" |
There was a problem hiding this comment.
namespace needs to be com.adobe.marketing.mobile.aepuitemplates
| } | ||
|
|
||
| dependencies { | ||
| implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion") |
There was a problem hiding this comment.
Why do we need core dependency here?
| [plugins] | ||
| android-application = { id = "com.android.application", version.ref = "agp" } | ||
| jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | ||
| android-library = { id = "com.android.library", version.ref = "agp" } | ||
|
|
There was a problem hiding this comment.
| androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } | ||
| junit = { group = "junit", name = "junit", version.ref = "junit" } | ||
| androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } | ||
| androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } | ||
| androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } |
There was a problem hiding this comment.
Same comment here. All of them are included in aep-plugin
| androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycleRuntimeCompose" } | ||
| androidx-lifecycle-viewmodel-compose = {group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycleViewModelCompose"} | ||
| androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } | ||
| androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } |
There was a problem hiding this comment.
Do we need to use compose bom? aep-plugin has almost all the dependencies you need. can we include the ones not present there directly using the same version through the BuildConstants?
Example from core https://github.com/adobe/aepsdk-core-android/blob/main/code/core/build.gradle.kts#L27-L32
| @@ -0,0 +1,40 @@ | |||
| [versions] | |||
There was a problem hiding this comment.
can we verify if we need this file? most of them are included in aep-plugin
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: