package com.casic.dcms.view.check;

import android.widget.LinearLayout;

import androidx.fragment.app.Fragment;

import com.casic.dcms.R;
import com.casic.dcms.adapter.SubViewPagerAdapter;
import com.casic.dcms.databinding.ActivityCheckCaseBinding;
import com.casic.dcms.fragment.check.CaseCheckFragment;
import com.casic.dcms.fragment.check.CaseCheckedFragment;
import com.casic.dcms.utils.LinearLayoutHelper;
import com.casic.dcms.utils.LocaleConstant;
import com.gyf.immersionbar.ImmersionBar;
import com.pengxh.androidx.lite.base.AndroidxBaseActivity;
import com.pengxh.androidx.lite.hub.IntHub;
import com.pengxh.androidx.lite.utils.ImmerseStatusBarManager;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : Pengxh
 * @time : 2021/4/16 9:24
 * @email : 290677893@qq.com
 */
public class CheckCaseActivity extends AndroidxBaseActivity<ActivityCheckCaseBinding> {

    @Override
    protected void setupTopBarLayout() {
        ImmerseStatusBarManager.setColor(this, IntHub.convertColor(this, R.color.white));
        ImmersionBar.with(this).statusBarDarkFont(true).init();

        viewBinding.titleBarLayout.titleView.setText("案卷核查");
        viewBinding.titleBarLayout.leftBackView.setOnClickListener(v -> finish());
    }

    @Override
    protected void observeRequestState() {

    }

    @Override
    protected void initData() {
        List<Fragment> fragmentList = new ArrayList<>();
        fragmentList.add(new CaseCheckFragment());
        fragmentList.add(new CaseCheckedFragment());
        SubViewPagerAdapter adapter = new SubViewPagerAdapter(getSupportFragmentManager(), LocaleConstant.CASE_PAGE_TITLES, fragmentList);
        viewBinding.viewPager.setAdapter(adapter);
        //绑定TabLayout
        viewBinding.topTabLayout.setupWithViewPager(viewBinding.viewPager);
        LinearLayout linearLayout = (LinearLayout) viewBinding.topTabLayout.getChildAt(0);
        LinearLayoutHelper.setDivider(this, linearLayout);
    }

    @Override
    protected void initEvent() {

    }
}