package com.xm.test.myfilemaster.ad

import android.view.View

object MyReportViewListener {

    class ReportViewListener(val className: String, val click: () -> Unit) : View.OnClickListener {
        override fun onClick(v: View) {
            val idString = v.context.resources.getResourceEntryName(v.id)
            EventHelper.event("viewClick_${className}_$idString")
            click.invoke()
        }

    }

    fun View.setMyReportViewListener(className: String, click: () -> Unit) {
        this.setOnClickListener(ReportViewListener(className, click))
    }
}