package com.koko.batteryinfo

import android.app.Dialog
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.didi.drouter.api.DRouter
import com.koko.drouter.event.EventService

abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
    private val TAG = "BaseActivity"

    protected abstract val binding: T

    lateinit var launcher: ActivityLauncher


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        launcher = ActivityLauncher(this)
        setContentView(binding.root)

        eventActivity()
//        EventUtils.event("page_${javaClass.simpleName}")
        initView()
        initListener()
    }

    private fun eventActivity() {
        val eventService = DRouter.build(EventService::class.java).getService()
        eventService.eventActivity(this)
    }

    protected abstract fun initView()

    protected open fun initListener() {}


    var dialog: Dialog? = null
    override fun onDestroy() {
        super.onDestroy()
    }


    override fun onResume() {
        super.onResume()
    }


}