package com.orange.widget.app

import android.app.Application
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.orange.net.net.NetHelper
import com.orange.tool.app.AppUrl
import com.orange.tool.app.IApp

class App : IApp(){

    companion object{
        private lateinit var app:Application
        fun getApp():Application = app
    }


    override fun onCreate() {
        super.onCreate()

        initAll(this)
    }

    fun initAll(app: Application){
        App.app = app
        NetHelper.netHelper.init(AppUrl.netUrl)

        ARouter.openLog()
        ARouter.openDebug()
        ARouter.init(app)
    }

    override fun init(app: Application, applicationFlag: Boolean) {
        if(!applicationFlag){
            initAll(app)
        }
    }

}