//package com.kdan.pdfbaselibrary.base.manager
//
//import android.content.Context
//import com.google.android.gms.analytics.GoogleAnalytics
//import com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder
//import com.google.android.gms.analytics.Tracker
//import com.kdan.pdfbaselibrary.R
//import com.kdan.pdfbaselibrary.config.MyPdfBaseModule
//
///**
// *    @author : HoboWen
// *    @date   : 2021/5/20  3:43 下午
// *    @description：
// */
//object GoogleAnalyticsManager {
//    private var mTracker: Tracker? = null
//    private var mGoogleTracker: Tracker? = null
//
//    @Synchronized
//    fun onInitTracks(context: Context?) {
//        context?.apply {
//            val analytics = GoogleAnalytics.getInstance(this)
//            /****** DEBUG模式下不发送GA数据  */
//            analytics.setDryRun(MyPdfBaseModule.isDebug)
//
//            /*使用多个跟踪器，向不同的媒体资源发送数据*/mTracker = analytics.newTracker(R.xml.global_tracker)
//            mGoogleTracker = analytics.newTracker(R.xml.google_tracker)
//        }
//    }
//
//    /**
//     * Google Analytics 屏幕-要发送屏幕浏览数据,主要用于:“屏幕”报告,互动流
//     */
//    fun setupAppView(screenName: String?) {
//        try {
//            screenName?.apply {
//                // Set screen name.
//                mTracker?.setScreenName(this)
//                // Send a screen view.
//                mTracker?.send(ScreenViewBuilder().build())
//            }
//        } catch (e: Exception) {
//            e.printStackTrace()
//        }
//    }
//
////    /**
////     * Google Analytics事件跟踪-发送事件数据。
////     *
////     * @param_category事件类别
////     * @param_action事件操作
////     * @param_label事件标签
////     */
////    fun setupEvent(cls: Class<*>, category: String, action: String, label: String?) {
////        try {
////            //类名_label_版本号
////            val labelString: String = StringBuffer(cls.simpleName).append("_").append(label).append("_").append(MyPdfBaseModule.versionName).toString()
////            // Build and send an Event.
////            mTracker?.send(
////                EventBuilder()
////                    .setCategory(category)
////                    .setAction(action)
////                    .setLabel(labelString)
////                    .build()
////            )
////        } catch (e: Exception) {
////            e.printStackTrace()
////        }
////    }
////
////    /**
////     * Google Analytics事件跟踪-发送事件数据。
////     *
////     * @param_category事件类别
////     * @param_action事件操作
////     * @param_label事件标签
////     * @param_value事件值
////     */
////    fun setupEvent(cls: Class<*>, category: String, action: String, label: String?, value: Long?) {
////        try {
////            //类名_label_版本号
////            val labelString: String = StringBuffer(cls.simpleName).append("_").append(label).append("_").append(MyPdfBaseModule.versionName).toString()
////
////            // Build and send an Event.
////            mTracker?.send(
////                EventBuilder()
////                    .setCategory(category)
////                    .setAction(action)
////                    .setLabel(labelString)
////                    .setValue(value ?: "0".toLong())
////                    .build()
////            )
////        } catch (e: Exception) {
////            e.printStackTrace()
////        }
////    }
//
//    /**
//     * @param:
//     * @create at: 9/10/16 16:55
//     */
//    fun setupDispatchLocalHits() {
//        MyPdfBaseModule.getAppContext()?.apply {
//            GoogleAnalytics.getInstance(this).dispatchLocalHits()
//        }
//    }
//}