Native Carousel Ads
Native Carousel Ads Support
Starting from NAM SDK version 7.5.0, native carousel ads are supported. Except for the additional customization settings mentioned below, native carousel ads can be implemented in the same way as basic native ads.
Carousel media assets are rendered in GfpMediaView. Since the size of individual items can be determined based on the width and height of GfpMediaView, it is recommended to set the width of GfpMediaView to MATCH_PARENT and the height to WRAP_CONTENT.
<com.naver.gfpsdk.GfpMediaView
android:id="@+id/ad_media"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
캐로셀 영역 내부 여백 처리
Handling Padding Inside the Carousel Area
The GfpNativeAdOptions.Builder.setRichMediaPaddingInDp() method allows you to set different padding values for GfpMediaView based on its placement.
- If not set, the default value is
Rect(0, 0, 0, 0)
. - When the
RichMediaPaddingInDp
value is set toRect(16, 0, 16, 0)
, a left padding of 16 dp is applied to the first item, and a right padding of 16 dp is applied to the last item.
The screenshot below shows a case where the carousel contains 5 items, and the Rect(16, 0, 16, 0)
value is applied using GfpNativeAdOptions.Builder.setRichMediaPaddingInDp().
An example of applying GfpNativeAdOptions.Builder.setRichMediaPaddingInDp() is shown below.
- Kotlin
- Java
private val nativeAdOptions = GfpNativeAdOptions.Builder()
...
.setRichMediaPaddingInDp(Rect(16, 0, 16, 0))
...
.build()
GfpNativeAdOptions nativeSimpleAdOptions = new GfpNativeAdOptions.Builder()
...
.setRichMediaPaddingInDp(Rect(16, 0, 16, 0))
...
.build();