package com.casic.dcms.base;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.core.content.ContextCompat;

import com.casic.dcms.R;
import com.casic.dcms.utils.StatusBarColorUtil;
import com.gyf.immersionbar.ImmersionBar;

import butterknife.BindView;

public abstract class BaseCaseActivity extends BaseActivity {

    @BindView(R.id.leftBackView)
    ImageView leftBackView;
    @BindView(R.id.titleView)
    TextView titleView;

    @Override
    protected void setupTopBarLayout() {
        StatusBarColorUtil.setColor(this, ContextCompat.getColor(this, R.color.mainThemeColor));
        ImmersionBar.with(this).statusBarDarkFont(false).init();
        leftBackView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        titleView.setText(setTitleName());
    }

    /**
     * 设置页面标题
     */
    protected abstract String setTitleName();
}
