package com.ccwangluo.accelerator

import android.app.Application
import android.content.Context
import android.content.res.Configuration
import androidx.multidex.MultiDex
import com.ccwangluo.accelerator.ui.MainActivity
import com.ccwangluo.accelerator.utils.PhoneUtils
import com.github.shadowsocks.Core
import com.hjq.toast.ToastUtils
import com.tencent.android.tpush.XGPushConfig
import com.tencent.map.geolocation.TencentLocationManager
import com.tencent.mmkv.MMKV
import com.xuexiang.xpage.PageConfig
import com.xuexiang.xpage.base.XPageActivity


class App : Application(), androidx.work.Configuration.Provider by Core {
    override fun onCreate() {
        super.onCreate()
        PageConfig.getInstance() //      //页面注册,默认不设置的话使用的就是自动注册
            //      .setPageConfiguration(new AutoPageConfiguration())
            .debug("PageLog") //开启调试
            .setContainActivityClazz(XPageActivity::class.java) //设置默认的容器Activity
            .init(this)
        PhoneUtils.initSdk(this)
        // 初始化 Toast 框架
        ToastUtils.init(this)
        MultiDex.install(this)
        Core.init(this, MainActivity::class)
        MMKV.initialize(this)
        XGPushConfig.enableDebug(this,true);
    }

    override fun onConfigurationChanged(newConfig: Configuration) {
        super.onConfigurationChanged(newConfig)
        Core.updateNotificationChannels()
    }
}