AdPopcornSSP의 경우v3.1.9
버전부터 직접 설정 이외에 템플릿 기능도 추가되었습니다.
이에 직접 설정 혹은 템플릿 사용 방식 중 하나를 선택해 사용하시기 바랍니다. 단, 템플릿 설정 시, 애드팝콘 사업팀(pm@adpopcorn.com)에 사용 문의를 먼저 해주시기 바랍니다.
<?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>
AdPopcornSSPViewBinder adpopcornSSPViewBinder
= new AdPopcornSSPViewBinder.Builder(R.id.adpopcorn_native_ad_view, R.layout.adpopcorn_native_ad_unit_layout)
.iconImageViewId(R.id.apssp_native_ad_icon_image1)
.descViewId(R.id.apssp_native_ad_desc1)
.mainImageViewId(R.id.apssp_native_ad_main_image1)
.titleViewId(R.id.apssp_native_ad_title1)
.callToActionId(R.id.apssp_native_ad_ctatext1)
.build();
adpopcornSSPNativeAd.setAdPopcornSSPViewBinder(adpopcornSSPViewBinder);
AdPopcornSSPViewBinder Builder 생성 시, view id(R.id.adpopcorn_native_ad_view)
와
layout id(R.layout.adpopcorn_native_ad_unit_layout)
는 필수로 넘겨주어야 하며, 그 외 ui component에 대해서는 사용하는 리소스에 대해서만 설정해 주면 됩니다.
1) AdPopcornSSPNativeAdTemplate Layout
<?xml version="1.0" encoding="utf-8"?>
<com.igaworks.ssp.part.nativead.AdPopcornSSPNativeAd
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/adpopcorn_native_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- AdPopcorn SSP Template View -->
<com.igaworks.ssp.part.nativead.view.AdPopcornSSPNativeAdTemplate
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adpopcornssp_native_ad_template"/>
</com.igaworks.ssp.part.nativead.AdPopcornSSPNativeAd>
AdPopcornSSPViewBinder adPopcornSSPViewBinder = new AdPopcornSSPViewBinder.Builder(R.id.adpopcornssp_native_ad_template)
.useTemplate(true)
.build();
adPopcornSSPNativeAd.setAdPopcornSSPViewBinder(adPopcornSSPViewBinder);
AdPopcornSSPViewBinder Builder
생성 시,
useTemplate 값을 true
로 설정해 주시고,
Builder에 AdPopcornSSPNativeAdTemplate View id
를 넘겨줍니다.