package com.composition.android.lib.ad.basic

import android.app.Activity
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatButton
import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import com.composition.android.lib.ad.interfaces.AdListener
import com.composition.android.lib.ad.interfaces.ImageLoader

/**
 * @classname:
 * @author: LiuXiaoLong
 * @date: 2022/9/6
 * description: 原生广告View配置类，指定相关视图
 */
class NativeAdViewHolder(
    var titleView : AppCompatTextView? = null,
    var titleDescView : View? = null,
    var iconView : View? = null,
    var rootView : View? = null,
    var contentView : View? = null,
    var contentMediaGroup : ViewGroup? = null,
    var callActionView : AppCompatButton? = null,
    var ratingBar : View? = null,
    var advertiserView : View? = null,
    var adListener : AdListener? = null,
    var dislikeView : View? = null,
    var activity : Activity? = null, //穿山甲广告需要
    var imageLoader : ImageLoader<AppCompatImageView>? = null
) {


    companion object{

        fun buildNativeAdViewHolder(viewHolder : NativeAdViewHolder.()-> Unit) : NativeAdViewHolder{
            return NativeAdViewHolder().also(viewHolder)
        }

    }

}

fun buildAdNativeViewHolder(viewHolder: NativeAdViewHolder.() -> Unit) = NativeAdViewHolder.buildNativeAdViewHolder(viewHolder)