package com.zswc.creativity

import android.speech.tts.TextToSpeech
import cat.ereza.customactivityoncrash.config.CaocConfig
import com.uuzuche.lib_zxing.activity.ZXingLibrary
import com.ysnows.base.base.BApp
import com.ysnows.base.config.IConfig
import com.ysnows.update.component.UpdateUtils
import com.zswc.creativity.activity.CustomErrorActivity
import com.zswc.creativity.config.Config
import java.util.*


class App : BApp(){
    private val TAG = "MIXPUSH"



    override fun init() {
        config = Config

        instance = this

        tts = TextToSpeech(applicationContext) { status ->
            if (status == TextToSpeech.SUCCESS) tts?.language = Locale.CHINESE
        }

        UpdateUtils.init(this)
        //二维码库
        ZXingLibrary.initDisplayOpinion(this)


        //注册微信
       // regToWx(this)
        //  Bugtags.start(instance()!!.config()!!.bugTagsAppkey(), this, Bugtags.BTGInvocationEventBubble)



//        CCRetrofit.instance()
//                .create(IUmeng.class)
//                .init()
//                .subscribe();

        //整个配置属性，可以设置一个或多个，也可以一个都不设置
        CaocConfig.Builder.create()
                .showErrorDetails(true)
                .errorActivity(CustomErrorActivity::class.java) // .eventListener(new CustomEventListener())
                .apply()
    }

    override fun config(): IConfig? {
        return config
    }




    companion object {

        //全局弹框
        var isShow = 0 //1是已经弹出


        var tts: TextToSpeech? = null


        lateinit var instance: App


    }



}
