package com.casic.dcms.base;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.qmuiteam.qmui.util.QMUIStatusBarHelper;

import butterknife.ButterKnife;

public abstract class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(initLayoutView());
        ButterKnife.bind(this);
        QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
        initData();
        setupTopBarLayout();
        initEvent();
    }

    /**
     * 初始化xml布局
     */
    public abstract int initLayoutView();

    /**
     * 特定页面定制沉浸式状态栏
     */
    protected abstract void setupTopBarLayout();

    /**
     * 初始化默认数据
     */
    public abstract void initData();

    /**
     * 初始化业务逻辑
     */
    public abstract void initEvent();
}
