애드팝콘 SSP
Android 네이티브 광고 미디에이션 레이아웃 가이드 입니다.
1. 직접 설정
adpopcorn_native_ad_unit_layout.xml 샘플
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:background="#FFFFFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:background="#FFFFFF">
<ImageView
android:id="@+id/apssp_native_ad_icon_image1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="10dp"/>
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/apssp_native_ad_title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"/>
<TextView
android:id="@+id/apssp_native_ad_desc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:textColor="#000000"/>
</LinearLayout>
<TextView
android:id="@+id/apssp_native_ad_ctatext1"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_marginTop="25dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#3d7caf"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:gravity="center"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="@+id/apssp_native_ad_main_image1"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>xml에서 생성한 ui component를 sdk에서 제공하는 setAdPopcornSSPViewBinder API를 이용해 아래와 같이 설정해 줍니다.
AdPopcornSSPViewBinder Builder 생성 시, view id(R.id.adpopcorn_native_ad_view)와
layout id(R.layout.adpopcorn_native_ad_unit_layout)는 필수로 넘겨주어야 하며, 그 외 ui component에 대해서는 사용하는 리소스에 대해서만 설정해 주면 됩니다.
2. 템플릿 사용
1) AdPopcornSSPNativeAdTemplate Layout
AdPopcornSSPNativeAd View 안에 AdPopcornSSPNativeAdTemplate 뷰를 추가해 줍니다.
2) Native Asset 연결
xml에 생성한 resource id를 setAdPopcornSSPViewBinder API를 이용하여 아래와 같은 방식으로 매칭합니다.
AdPopcornSSPViewBinder Builder 생성 시,
useTemplate 값을 true로 설정해 주시고,
Builder에 AdPopcornSSPNativeAdTemplate View id를 넘겨줍니다.
Last updated
Was this helpful?