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 BaseTransparentActivity extends BaseRxActivity {

    public BaseTransparentActivity() {
        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();
    }

    /**
     * 设置布局
     */
    protected abstract int getLayoutId();

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

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