Skip to content

Commit 4ba1a90

Browse files
Native ad template (#131)
* Fix: Correct README setup and bump version This commit corrects the setup instructions in the README and increments the library version. * **Version Bump:** * The library version is updated from `1.1.0-beta02` to `1.1.0-beta03`. * **Documentation Fixes:** * Corrected the Gradle plugin aliases in `README.md` to use `libs.plugins.jetbrains.compose` and `libs.plugins.jetbrains.compose.compiler`. * Updated the dependency name in the `README.md` setup guide from `libs.lexilabs.basic.ads` to `libs.basic.ads`. * Updated the Kotlin version badge to `2.3.0`. * **Version History:** * The `VERSIONS.md` file has been updated to log the `1.1.0-beta02` and `1.1.0-beta03` releases. * Fix: Remediate security vulnerabilities in transitive dependencies (#128) This commit updates the build configuration to mitigate several security vulnerabilities present in transitive dependencies. It replaces the previous `compileOnly` approach with Gradle's dependency constraints, which provides a more robust method for forcing specific, non-vulnerable versions of these libraries. * **Dependency Constraints:** * A `constraints` block has been added to `basic-ads/build.gradle.kts` to enforce strict versions for vulnerable transitive dependencies on the `androidMain` configuration. * **Vulnerabilities Addressed:** * **`okhttp`**: Patched for `CVE-2021-0341`. * **`org.bitbucket.b_c:jose4j`**: Patched for `CVE-2024-29371`. * **`io.netty`**: Patched for `CVE-2025-67735` and `CVE-2025-55163`. * **`com.google.protobuf`**: Patched for `CVE-2024-7254`. * **`org.jdom:jdom2`**: Patched for `CVE-2021-33813`. * **`org.apache.commons:commons-compress`**: Added and patched for `CVE-2024-26308`. * **Build Configuration:** * The `libs.versions.toml` file has been updated to centralize the version numbers for these remediated dependencies. * Refactor: Introduce DSL for Native Ad templates This commit introduces a new declarative DSL for constructing native ad layouts, replacing the previous override-based approach. The new `NativeAdTemplate` provides a `Supervisor` scope with composable functions for each ad asset, simplifying custom ad view creation. This change is marked as experimental and requires opting in with `@ExperimentalBasicAdsFeature`. * **New `NativeAdTemplate` DSL:** * A new `NativeAdTemplate` abstract class has been created with `expect` declarations in `commonMain` and platform-specific `actual` implementations. * It introduces a `Supervisor` composable that provides a `SupervisorScope`. * Within this scope, developers can use composables like `Headline`, `Body`, `Media`, `Icon`, and `CallToAction` to build the ad layout declaratively. * This DSL handles the underlying platform view registration (`NativeAdView` on Android, `GADNativeAdView` on iOS) automatically. * **Refactored `NativeAdDefault`:** * The `NativeAdDefault` implementation has been refactored to use the new `NativeAdTemplate` DSL, resulting in a much simpler and more readable layout definition. * Redundant implementation code has been removed from the `androidMain` and `iosMain` variants of `NativeAdDefault` and centralized in the `NativeAdTemplate` base. * **Experimental API:** * All new and related native ad composables, including `NativeAd`, `NativeAdDefault`, and `NativeAdTemplate`, are now annotated with `@ExperimentalBasicAdsFeature`. * **API Update:** * The public API dump has been updated to reflect the new DSL structure. * Refactor: Unify NativeAdDefault and rename Image to AdIcon This commit refactors the native ad implementation by moving the `NativeAdDefault` composable to `commonMain` and renaming several related classes for clarity. * **`NativeAdDefault` Unification:** * The `expect` class `NativeAdDefault` and its `actual` implementations on Android and iOS have been removed. * A single, unified `NativeAdDefault` class now resides in `commonMain`, providing a consistent default layout across platforms and reducing code duplication. * **API Renaming for Clarity:** * The data class `NativeAdData.Image` has been renamed to `NativeAdData.AdIcon` to more accurately reflect its purpose. * The composable function `NativeAdTemplate.Icon` has been renamed to `NativeAdTemplate.AdIcon`. * In `NativeAdData.AdChoicesInfo`, the `images` property has been renamed to `adIcons`. * **Implementation Updates:** * The `AdIcon` composable now directly accepts an `AdIcon` data object instead of a generic content lambda, simplifying its usage within custom templates. * Platform-specific converters and `NativeAdData` implementations have been updated to align with these renames. * The public API dump has been updated to reflect all changes. * Refactor: Improve NativeAd stability and implementation This commit introduces several refactorings to the `NativeAd` implementation, focusing on improving stability, fixing race conditions on iOS, and refining the API. * **Robust Native Ad Loading (iOS):** * The `NativeAdHandler` on iOS now automatically initiates the ad loading process in a background coroutine upon creation. This resolves a race condition where the ad might not have been loaded before being displayed. * Error logging for ad loading failures has been improved. * **Null-Safety and State Handling:** * Removed redundant `nativeAdData != null` checks from individual `NativeAdTemplate` components. * A central null check is now performed within the `NativeAdDefault.Show()` composable, ensuring `nativeAdData` is available before rendering the ad layout. * On iOS, the `MediaView` now safely accesses `nativeAdData` to prevent potential null pointer exceptions. * **API Refinement:** * The `NativeAdTemplate.copy()` function has been made `abstract`, requiring concrete template implementations like `NativeAdDefault` to provide their own copy logic. * The public API dump has been updated to reflect these changes. * Refactor(iOS): Remove unused AdLoader delegate This commit removes the `AdLoader` class from the `iosMain` source set. The `AdLoader` class was a `GADAdLoaderDelegateProtocol` implementation used to handle native ad loading callbacks. This file is no longer required as the delegate logic has been consolidated elsewhere. * Refactor: Improve variable naming in iOS NativeAd This commit refactors the iOS implementation of the `NativeAd` composable to improve code clarity and readability. * **Variable Renaming:** * In `basic-ads/src/iosMain/kotlin/app/lexilabs/basic/ads/composable/NativeAd.kt`, the variable `composeController` has been renamed to `adTemplateController`. * Similarly, `composeView` has been renamed to `adTemplate`. * These changes make the code's intent clearer without altering its functionality. * **Code Cleanup:** * Removed an extraneous newline from `basic-ads/src/commonMain/kotlin/app/lexilabs/basic/ads/nativead/NativeAdDefault.kt`. * Refactor: Simplify iOS NativeAdTemplate implementation This commit refactors the iOS implementation of `NativeAdTemplate` to simplify its structure and remove unnecessary complexity. The custom `ComposeInUIView` and `ViewInUIView` helper composables have been removed in favor of directly using `UIKitView`. * **View Implementation:** * All composable elements within the template (`Headline`, `Body`, `CallToAction`, `Icon`, `Media`, etc.) now directly use `UIKitView` to create and manage their underlying native `UIView` components (e.g., `UILabel`, `UIImageView`, `GADMediaView`). * This change eliminates the need for intermediate `ComposeUIViewController` instances and their associated lifecycle management, resulting in a cleaner and more direct implementation. * **Data Handling:** * The `update` blocks for each `UIKitView` now directly populate the native views with data from `nativeAdData` (e.g., setting `text` on a `UILabel` or `image` on a `UIImageView`). * Views are now automatically hidden if their corresponding data is null or empty. * **CallToAction Behavior:** * The `CallToAction` button now correctly has `setUserInteractionEnabled` set to `false`, as the parent `GADNativeAdView` is responsible for handling click events. * Feat: Promote Native Ads to stable API This commit stabilizes the Native Ad API by removing the `@ExperimentalBasicAdsFeature` annotation from all related components. Additionally, it includes a refactoring of the iOS implementation to improve view management. * **API Stabilization:** * The `@ExperimentalBasicAdsFeature` annotation has been removed from all Native Ad composables and classes, including `NativeAd`, `NativeAdDefault`, and `NativeAdTemplate`. * The `ExperimentalBasicAdsFeature` annotation class itself has been deleted, marking the Native Ad feature as stable. * **iOS Implementation Refactor:** * The responsibility for creating and managing the `GADNativeAdView` on iOS has been moved from the `NativeAd` composable into the `NativeAdTemplate` implementation. * This change simplifies the `NativeAd` composable and centralizes the native view handling logic within the template. * Restore signing of publication (accidentally deactivated). * Refactor: Simplify NativeAdTemplate API This commit refactors the `NativeAdTemplate` composable API to be more declarative and less boilerplate-heavy. The individual ad asset composables no longer require a `content` lambda, as they now implicitly handle the rendering of the ad data. * **API Simplification:** * The `content: @composable () -> Unit` parameter has been removed from `Headline`, `Body`, `CallToAction`, `Advertiser`, `Price`, and `Store`. These composables now automatically render the corresponding data from the `NativeAdData` object. * The `AdIcon` composable has been renamed to `Icon` and no longer requires an `adIcon` parameter. It now retrieves the icon directly from the provided `NativeAdData`. * **Improved `StarRating`:** * The `StarRating` composable has been enhanced. Instead of an empty `content` lambda, it now provides a `stars: @composable (Double) -> Unit` lambda. This allows developers to easily create a custom visual representation for the star rating value. * **Implementation Cleanup:** * The `actual` implementations on Android and iOS have been updated to reflect these changes, removing the now-unnecessary `ComposeView` and `UILabel` wrappers and directly accessing the ad data. * **API Dump:** * The `basic-ads.api` file has been updated to reflect the new, simpler function signatures. * Fix(iOS): Ensure native ad views fill their container This commit corrects the layout behavior of native ads on iOS to ensure they expand to fill the available space of their parent composable. * **`NativeAd` Composable:** * The `UIKitView` responsible for displaying the native ad is now modified with `Modifier.fillMaxSize()`. This ensures the ad view stretches to the full dimensions of its container. * **`NativeAdTemplate`:** * Similarly, the `UIKitView` within the `NativeAdTemplate` has been updated to use `Modifier.fillMaxSize()`, providing consistent sizing behavior for templated ads.
1 parent 12e3384 commit 4ba1a90

17 files changed

Lines changed: 516 additions & 859 deletions

File tree

VERSIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Here's a list of the Basic-Ads dependency versions for each release after 0.2.0:
3131
| 1.1.0-beta01 | 2.3.0 | 1.9.3 | 1.9.1 | 24.9.0 / 12.14.0 | 4.0.0 / 3.1.0 |
3232
| 1.1.0-beta02 | 2.3.0 | 1.9.3 | 1.9.1 | 24.9.0 / 12.14.0 | 4.0.0 / 3.1.0 |
3333
| 1.1.0-beta03 | 2.3.0 | 1.9.3 | 1.9.1 | 24.9.0 / 12.14.0 | 4.0.0 / 3.1.0 |
34-
| 1.1.0 | 2.3.0 | 1.9.3 | 1.9.1 | 24.9.0 / 12.14.0 | 4.0.0 / 3.1.0 |
34+
| 1.1.0 | 2.3.0 | 1.9.3 | 1.9.1 | 24.9.0 / 12.14.0 | 4.0.0 / 3.1.0 |

basic-ads/api/basic-ads.api

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ public abstract interface annotation class app/lexilabs/basic/ads/DependsOnGoogl
192192
public abstract interface annotation class app/lexilabs/basic/ads/DependsOnGoogleUserMessagingPlatform : java/lang/annotation/Annotation {
193193
}
194194

195-
public abstract interface annotation class app/lexilabs/basic/ads/ExperimentalBasicAdsFeature : java/lang/annotation/Annotation {
196-
}
197-
198195
public final class app/lexilabs/basic/ads/FullscreenContentDelegate : com/google/android/gms/ads/FullScreenContentCallback {
199196
public static final field $stable I
200197
public fun <init> (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)V
@@ -371,7 +368,7 @@ public final class app/lexilabs/basic/ads/nativead/NativeAdConvertersKt {
371368
public static final fun toCommon (Lcom/google/android/gms/ads/MediaContent;)Lapp/lexilabs/basic/ads/nativead/NativeAdData$MediaContent;
372369
public static final fun toCommon (Lcom/google/android/gms/ads/MuteThisAdReason;)Lapp/lexilabs/basic/ads/nativead/NativeAdData$MuteThisAdReason;
373370
public static final fun toCommon (Lcom/google/android/gms/ads/nativead/NativeAd$AdChoicesInfo;)Lapp/lexilabs/basic/ads/nativead/NativeAdData$AdChoicesInfo;
374-
public static final fun toCommon (Lcom/google/android/gms/ads/nativead/NativeAd$Image;)Lapp/lexilabs/basic/ads/nativead/NativeAdData$Image;
371+
public static final fun toCommon (Lcom/google/android/gms/ads/nativead/NativeAd$Image;)Lapp/lexilabs/basic/ads/nativead/NativeAdData$AdIcon;
375372
}
376373

377374
public final class app/lexilabs/basic/ads/nativead/NativeAdData {
@@ -383,7 +380,7 @@ public final class app/lexilabs/basic/ads/nativead/NativeAdData {
383380
public final fun getBody ()Ljava/lang/String;
384381
public final fun getCallToAction ()Ljava/lang/String;
385382
public final fun getHeadline ()Ljava/lang/String;
386-
public final fun getIcon ()Lapp/lexilabs/basic/ads/nativead/NativeAdData$Image;
383+
public final fun getIcon ()Lapp/lexilabs/basic/ads/nativead/NativeAdData$AdIcon;
387384
public final fun getMediaContent ()Lapp/lexilabs/basic/ads/nativead/NativeAdData$MediaContent;
388385
public final fun getMuteThisAdReasons ()Ljava/util/List;
389386
public final fun getPlacementId ()Ljava/lang/Long;
@@ -395,11 +392,11 @@ public final class app/lexilabs/basic/ads/nativead/NativeAdData {
395392
public final class app/lexilabs/basic/ads/nativead/NativeAdData$AdChoicesInfo {
396393
public static final field $stable I
397394
public fun <init> (Ljava/util/List;Ljava/lang/CharSequence;)V
398-
public final fun getImages ()Ljava/util/List;
395+
public final fun getAdIcons ()Ljava/util/List;
399396
public final fun getText ()Ljava/lang/CharSequence;
400397
}
401398

402-
public final class app/lexilabs/basic/ads/nativead/NativeAdData$Image {
399+
public final class app/lexilabs/basic/ads/nativead/NativeAdData$AdIcon {
403400
public static final field $stable I
404401
public fun <init> (Landroid/graphics/drawable/Drawable;DLandroid/net/Uri;)V
405402
public final fun getDrawable ()Landroid/graphics/drawable/Drawable;
@@ -428,23 +425,9 @@ public final class app/lexilabs/basic/ads/nativead/NativeAdDefault : app/lexilab
428425
public fun <init> ()V
429426
public fun <init> (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)V
430427
public synthetic fun <init> (Lapp/lexilabs/basic/ads/nativead/NativeAdData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
431-
public fun AdChoices (Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
432-
public fun Advertiser (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
433-
public fun Attribution (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
434-
public fun Body (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
435-
public fun CallToAction (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
436-
public fun Headline (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
437-
public fun Icon (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
438-
public fun Media (Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/ScaleType;Landroidx/compose/runtime/Composer;I)V
439-
public final fun NativeAdButton-t6yy7ic (Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/graphics/Shape;Landroidx/compose/runtime/Composer;II)V
440-
public fun Price (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
441428
public fun Show (Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
442-
public fun StarRating (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
443-
public fun Store (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
444-
public final fun Supervisor (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
445429
public fun copy (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;
446430
public fun getNativeAdData ()Lapp/lexilabs/basic/ads/nativead/NativeAdData;
447-
public fun invoke (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;
448431
}
449432

450433
public final class app/lexilabs/basic/ads/nativead/NativeAdHandler {
@@ -466,36 +449,30 @@ public abstract interface class app/lexilabs/basic/ads/nativead/NativeAdScope {
466449
public abstract class app/lexilabs/basic/ads/nativead/NativeAdTemplate : app/lexilabs/basic/ads/nativead/NativeAdScope {
467450
public static final field $stable I
468451
public fun <init> (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)V
469-
public abstract fun AdChoices (Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
470-
public abstract fun Advertiser (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
471-
public abstract fun Attribution (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
472-
public abstract fun Body (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
473-
public abstract fun CallToAction (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
474-
public abstract fun Headline (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
475-
public abstract fun Icon (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
476-
public abstract fun Media (Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/ScaleType;Landroidx/compose/runtime/Composer;I)V
477-
public abstract fun Price (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
452+
public final fun AdChoices (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
453+
public final fun Advertiser (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
454+
public final fun Attribution (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
455+
public final fun Body (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
456+
public final fun CallToAction (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
457+
public final fun Headline (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
458+
public final fun Icon (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
459+
public final fun Media (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/ScaleType;Landroidx/compose/runtime/Composer;II)V
460+
public final fun NativeAdButton-jB83MbM (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/graphics/Shape;Landroidx/compose/runtime/Composer;II)V
461+
public final fun Price (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
478462
public abstract fun Show (Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;I)V
479-
public abstract fun StarRating (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
480-
public abstract fun Store (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
463+
public final fun StarRating (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
464+
public final fun Store (Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
465+
public final fun Supervisor (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
481466
public abstract fun copy (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;
482467
public fun getNativeAdData ()Lapp/lexilabs/basic/ads/nativead/NativeAdData;
483-
public abstract fun invoke (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;
468+
public final fun invoke (Lapp/lexilabs/basic/ads/nativead/NativeAdData;)Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;
484469
}
485470

486471
public final class app/lexilabs/basic/ads/nativead/NativeAdTemplate$ComposeDefaultImpls {
487-
public static final fun AdChoices$default (Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
488-
public static final fun Advertiser$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
489-
public static final fun Attribution$default (Ljava/lang/String;Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
490-
public static final fun Body$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
491-
public static final fun CallToAction$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
492-
public static final fun Headline$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
493-
public static final fun Icon$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
494-
public static final fun Media$default (Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/ScaleType;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
495-
public static final fun Price$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
496472
public static final fun Show$default (Landroidx/compose/ui/Modifier;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
497-
public static final fun StarRating$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
498-
public static final fun Store$default (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lapp/lexilabs/basic/ads/nativead/NativeAdTemplate;Landroidx/compose/runtime/Composer;II)V
473+
}
474+
475+
public abstract interface class app/lexilabs/basic/ads/nativead/NativeAdTemplate$SupervisorScope {
499476
}
500477

501478
public final class app/lexilabs/basic/ads/nativead/NativeAdViewKt {

basic-ads/src/androidMain/kotlin/app/lexilabs/basic/ads/nativead/NativeAdConverters.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import com.google.android.gms.ads.nativead.NativeAd
66

77
public fun NativeAd.AdChoicesInfo.toCommon(): NativeAdData.AdChoicesInfo {
88
return NativeAdData.AdChoicesInfo(
9-
images = this.images.map { it.toCommon() },
9+
adIcons = this.images.map { it.toCommon() },
1010
text = this.text
1111
)
1212
}
1313

14-
public fun NativeAd.Image.toCommon(): NativeAdData.Image {
15-
return NativeAdData.Image(
14+
public fun NativeAd.Image.toCommon(): NativeAdData.AdIcon {
15+
return NativeAdData.AdIcon(
1616
drawable = this.drawable,
1717
scale = this.scale,
1818
uri = this.uri

basic-ads/src/androidMain/kotlin/app/lexilabs/basic/ads/nativead/NativeAdData.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public actual class NativeAdData (
1818
get() = android.callToAction
1919
public actual val headline: String?
2020
get() = android.headline
21-
public actual val icon: Image?
21+
public actual val icon: AdIcon?
2222
get() = android.icon?.toCommon()
2323
public actual val mediaContent: MediaContent?
2424
get() = android.mediaContent?.toCommon()
@@ -33,10 +33,10 @@ public actual class NativeAdData (
3333
public actual val store: String?
3434
get() = android.store
3535
public actual class AdChoicesInfo (
36-
public val images: List<Image>,
36+
public val adIcons: List<AdIcon>,
3737
public val text: CharSequence
3838
)
39-
public actual class Image (
39+
public actual class AdIcon (
4040
public val drawable: Drawable?,
4141
public val scale: Double,
4242
public val uri: Uri?

0 commit comments

Comments
 (0)