package com.bbitcn.silk.ui.activity;

import androidx.annotation.NonNull;

import com.bbitcn.silk.adapter.PageAdapter;
import com.bbitcn.silk.base.BaseActivity;
import com.bbitcn.silk.databinding.ActivityQueryBinding;
import com.blankj.utilcode.util.KeyboardUtils;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;

/**
 * @Description 磅单查询界面
 * @Author DuanKaiji
 * @CreateTime 2024年03月27日 15:12
 */
public class QueryActivity extends BaseActivity<ActivityQueryBinding, QueryActivityPresenter> {

    @Override
    public void initView() {
        binding.viewPage2.setAdapter(new PageAdapter( this));
        binding.viewPage2.setOffscreenPageLimit(2);
        //禁止用户滑动
        binding.viewPage2.setUserInputEnabled(false);
    }

    @Override
    public void initListener() {
        super.initListener();
        binding.ivBack.setOnClickListener(v -> finish());
        new TabLayoutMediator(binding.tabLayout, binding.viewPage2, (tab, i) -> {
            if (i == 0) {
                tab.setText("待确认售");
            } else {
                tab.setText("全部磅单");
            }
        }).attach();
    }

}
