ironsource-mediation
Version:
IronSource ad mediation React-Native plugin. Monetize apps with rewarded video, interstitial, banner, and native ads.
172 lines (153 loc) • 6.28 kB
text/xml
<com.ironsource.mediationsdk.ads.nativead.NativeAdLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="350dp"
android:background="@android:color/background_light"
android:visibility="invisible"
tools:visibility="visible"
android:contentDescription="com.ironsource.mediationsdk.ads.NativeAdLayout">
<!-- Root RelativeLayout for the entire native ad layout MEDIUM template -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<!-- Top section of the ad layout containing the ad badge -->
<RelativeLayout
android:id="@+id/topView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- TextView displaying 'AD' badge -->
<TextView
android:id="@+id/adBadge"
android:layout_width="20dp"
android:layout_height="20dp"
android:text="AD"
android:textColor="@android:color/white"
android:background="@android:color/holo_blue_light"
android:textSize="10sp"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="8dp"/>
</RelativeLayout>
<!-- Stack of views below the topView, containing ad icon and text -->
<LinearLayout
android:id="@+id/stackTopView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/topView"
android:background="@android:color/transparent"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<!-- ImageView for the ad's app icon -->
<ImageView
android:id="@+id/adAppIcon"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="fitCenter"/>
<!-- Container for ad title and advertiser text -->
<LinearLayout
android:id="@+id/adTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:paddingHorizontal="4dp"
android:orientation="vertical">
<!-- TextView for the ad title -->
<TextView
android:id="@+id/adTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
tools:text="Title"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@android:color/black"
android:maxLines="2"/>
<!-- TextView for the advertiser name -->
<TextView
android:id="@+id/adAdvertiser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
tools:text="Advertiser"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@android:color/black"
android:maxLines="2"/>
</LinearLayout>
</LinearLayout>
<!-- Stack of views below stackTopView, containing ad body, media, and action button -->
<LinearLayout
android:id="@+id/stackBottomView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/stackTopView"
android:background="@android:color/transparent"
android:orientation="vertical">
<!-- Push body to bottom -->
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<!-- TextView for the ad body text -->
<TextView
android:id="@+id/adBody"
android:layout_width="match_parent"
android:background="@android:color/transparent"
android:layout_height="wrap_content"
tools:text="Body"
android:textSize="12sp"
android:textColor="@android:color/black"
android:maxLines="4"/>
<!-- Media view for displaying ad media content -->
<com.ironsource.mediationsdk.ads.nativead.LevelPlayMediaView
android:id="@+id/adMedia"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="fitXY"
android:background="@android:color/transparent"
android:layout_marginTop="4dp"/>
<!-- Layout for ad details and call-to-action button -->
<LinearLayout
android:id="@+id/adDetailsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_marginTop="4dp"
android:orientation="horizontal">
<!-- TextView for the ad price (initially hidden - not supported yet) -->
<TextView
android:id="@+id/adPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/background_light"
tools:text="Price"
android:textSize="12sp"
android:textColor="@android:color/black"
android:visibility="gone"/>
<!-- TextView for the ad store name (initially hidden - not supported yet) -->
<TextView
android:id="@+id/adStore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/background_light"
tools:text="Store"
android:textSize="12sp"
android:textColor="@android:color/black"
android:visibility="gone"/>
<!-- Button for ad call-to-action -->
<Button
android:id="@+id/adCallToAction"
android:layout_width="match_parent"
android:layout_height="30dp"
tools:text="Button"
android:textColor="@android:color/white"
android:background="@android:color/holo_blue_light"
android:layout_gravity="end"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</com.ironsource.mediationsdk.ads.nativead.NativeAdLayout>