package com.cooleshow.usercenter.ui.activity;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.cooleshow.base.router.RouterPath;
import com.cooleshow.base.ui.activity.BaseActivity;
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
import com.cooleshow.usercenter.R;
import com.cooleshow.usercenter.constants.UserConstants;
import com.cooleshow.usercenter.databinding.ActivityCommEmptyBinding;

@Route(path = RouterPath.UserCenter.COMMON_EMPTY_ACTIVITY)
public class CommEmptyActivity extends BaseActivity<ActivityCommEmptyBinding> {

    @Override
    protected void initView() {
        QMUIStatusBarHelper.setStatusBarLightMode(this);
        String pageTitle = getIntent().getStringExtra(UserConstants.PAGE_TITLE);
        String errorTip = getIntent().getStringExtra(UserConstants.PAGE_ERROR_TEXT);
        int emptyResId = getIntent().getIntExtra(UserConstants.EMPTY_ICON_RESID, com.cooleshow.base.R.drawable.icon_empty_course);
        String emptyBtnText = getIntent().getStringExtra(UserConstants.EMPTY_BTN_TEXT);
        viewBinding.emptyBtn.setText(emptyBtnText);
        viewBinding.emptyIcon.setImageResource(emptyResId);
        viewBinding.titleView.setTitleText(pageTitle);
        viewBinding.emptyText.setText(errorTip);
        viewBinding.titleView.setLeftClickListener(v -> {
            finish();
        });
        viewBinding.emptyBtn.setOnClickListener(v -> {
            finish();
        });

    }

    @Override
    protected ActivityCommEmptyBinding getLayoutView() {
        return ActivityCommEmptyBinding.inflate(getLayoutInflater());
    }
}