<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <androidx.appcompat.widget.AppCompatButton
            android:id="@+id/btn_load_native_in_recyclerview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="原生广告在RecyclerView中运用"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.appcompat.widget.AppCompatButton
            android:id="@+id/btn_load_native"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="加载广告"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.appcompat.widget.AppCompatButton
            android:id="@+id/btn_show_native"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="显示广告"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.appcompat.widget.AppCompatButton
            android:id="@+id/btn_load_and_show"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="加载并显示广告"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="此处为getNativeAdView, 自定义布局不用写在此界面，通过addView添加到界面中" />

        <LinearLayout
            android:id="@+id/ll_ad_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" />


        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="原生广告自行加载填充模式，在Xml NativeAdView中设置好配置， View中自动完成加载"
            />

        <com.composition.android.lib.ad.widget.NativeAdView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:native_ad_slot_name="native"
            app:native_admob_advertisers_root_view="@layout/layout_admob_native_ad_view_root"
            app:ad_view_title="@id/tv_ad_title_1"
            app:ad_view_title_desc="@id/tv_ad_title_desc_1"
            app:ad_view_icon="@id/iv_ad_icon_1"
            app:ad_view_media_content_group="@id/fl_ad_media_content_1"
            app:ad_view_call_to_action="@id/btn_call_to_action_1"
            >

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/cl_ad_root_1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_ad_icon_1"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:src="@tools:sample/avatars" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_ad_title_1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:textColor="@color/black"
                    android:textSize="16sp"
                    app:layout_constraintStart_toEndOf="@id/iv_ad_icon_1"
                    app:layout_constraintTop_toTopOf="@id/iv_ad_icon_1"
                    tools:text="Ad Title" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_ad_title_desc_1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintStart_toStartOf="@id/tv_ad_title_1"
                    app:layout_constraintTop_toBottomOf="@id/tv_ad_title_1"
                    tools:text="Desc" />

                <FrameLayout
                    android:id="@+id/fl_ad_media_content_1"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:layout_marginTop="8dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_ad_icon_1"
                    tools:background="@tools:sample/backgrounds/scenic"
                    />

                <androidx.appcompat.widget.AppCompatButton
                    android:id="@+id/btn_call_to_action_1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/fl_ad_media_content_1" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </com.composition.android.lib.ad.widget.NativeAdView>

    </LinearLayout>

</ScrollView>
