package com.colorful.keyboard.theme

import android.app.Application
import android.util.Log
import com.anythink.core.api.ATSDK
import com.anythink.debug.api.ATDebuggerUITest
import com.colorful.keyboard.theme.firebase.RemoteConfig
import com.colorful.keyboard.theme.myutil.Utils
import com.colorful.keyboard.theme.room.DownloadManager
import java.util.concurrent.atomic.AtomicLong

class App : Application() {
    companion object {
        lateinit var app: App
            private set

        lateinit var downloadManager: DownloadManager
            private set
    }

    var lastAdDisplayTime: AtomicLong = AtomicLong(0L)//上次广告展示的时间

    override fun onCreate() {
        super.onCreate()
        app = this
        Utils.init(this)
        downloadManager = DownloadManager.getInstance(this)
        RemoteConfig.instance.init(this)
        ATSDK.init(this, "h66b1cef2a9a51", "a90d2376d3e1dd2bd9bb5cb4f8296085f")
//        ATSDK.integrationChecking(this)
//        ATSDK.setNetworkLogDebug(true)
        //测试工具
        val version = ATSDK.getSDKVersionName ()
        Log.d("version", "onCreate: $version")
        ATDebuggerUITest.showDebuggerUI(this,"fe06c76b794f95216f98e5982ae8f335fc558956");
    }
}