package com.ytpm.hydtw.application

import android.app.Application
import android.view.Gravity
import com.anythink.core.api.ATAdConst
import com.anythink.core.api.ATSDK
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import com.ytpm.hydtw.R
import com.ytpm.hydtw.network.BaseRetrofit
import me.jessyan.autosize.AutoSize

class DatiApplication : Application() {

    companion object {
        lateinit var instance: DatiApplication
            private set
    }

    override fun onCreate() {
        super.onCreate()

        instance = this

        AutoSize.initCompatMultiProcess(this)

        ToastUtils.getDefaultMaker().setMode(ToastUtils.MODE.DARK)
        ToastUtils.getDefaultMaker().setGravity(Gravity.CENTER, 0, 0)

        LogUtils.getConfig().setLogSwitch(true)

        ATSDK.setNetworkLogDebug(true)
        ATSDK.integrationChecking(this)
        ATSDK.setPersonalizedAdStatus(ATAdConst.PRIVACY.PERSIONALIZED_ALLOW_STATUS)

        ATSDK.setLocalStrategyAssetPath(this, "localStrategy")
        ATSDK.init(
            applicationContext,
            "a684009039113d",
            "afd78bcd2b03126f0c24d7b4e48a439d6"
        )
        ATSDK.start()

    }
}