package com.hainaos.vc.base;

import android.os.Bundle;

import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;

import com.hainaos.vc.R;
import com.hainaos.vc.base.rx.BaseRxActivity;
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;

public abstract class BaseDataBindingActivity extends BaseRxActivity {

    public BaseDataBindingActivity() {
        super();
    }

    @Override
    @CallSuper
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        StatusBarUtil.init(this);
        UltimateBarX.statusBar(this)
                .transparent()
                .colorRes(R.color.colorPrimaryDark)
                .light(setNightMode())
                .fitWindow(setfitWindow())
                .apply();
        UltimateBarX.navigationBar(this)
                .transparent()
                .colorRes(R.color.colorPrimaryDark)
                .light(setNightMode())
                .fitWindow(setfitWindow())
                .apply();
        initDataBinding();
        initView();
        initData();
    }

    /**
     * @return 是否是黑色状态栏
     */
//    protected abstract boolean setNightMode();
    public boolean setNightMode() {
        return false;
    }

    /**
     * @return 是否是入侵
     */
//    protected abstract boolean setNightMode();
    public boolean setfitWindow() {
        return false;
    }


    protected abstract void initDataBinding();

    /**
     * 初始化视图
     */
    protected abstract void initView();

    /**
     * 初始化数据
     */
    protected abstract void initData();
}