package com.sunny.app.soft.timberkeyboardnew.ui.activity

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.gyf.immersionbar.ImmersionBar
import com.sunny.app.soft.timberkeyboardnew.topon.AdManager

abstract class BaseActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(setRootView())
        initView()
        if (loadAd()) {
            AdManager.loadAllAd()
        }
    }

    abstract fun loadAd(): Boolean
    abstract fun setRootView(): View

    open fun initView() {
        initStatusBar()
    }

    private fun initStatusBar() {
        ImmersionBar.with(this).statusBarDarkFont(true).init()
    }

}