package com.zxbw.modulemain.box.activity

import android.view.View
import com.zxbw.modulemain.R
import com.zxbw.modulemain.fragment.TobePickUpFragment
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.FragmentAdapter
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.common.base.BaseFragment
import kotlinx.android.synthetic.main.activity_layout_warehouse.*


class WareHouseActivity:BaseActivity() {
    val createTitles = ArrayList<String>().apply {
        add(AppContext.get().getString(R.string.to_be_picked_up))
        add(AppContext.get().getString(R.string.finished))
    }
    val createFragments: Array<BaseFragment> = arrayOf(
        TobePickUpFragment.newInstance()
       // FinishedFragment.newInstance()
    )
    override fun onClick(v: View?) {

    }
    override fun before() {
        super.before()
        setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
    }
    override fun layoutID(): Int {
       return R.layout.activity_layout_warehouse
    }

    override fun init() {
        initVeiwPager()
        id_img_back?.setOnClickListener {
            finish()
        }
    }
    fun initVeiwPager() {
        val adapter = FragmentAdapter(supportFragmentManager)
        viewPager?.adapter = adapter

        for (i in createFragments.indices) {
            adapter.addFrag(createFragments[i], createTitles[i])
        }
        adapter.notifyDataSetChanged()
        id_fragment_ware_house_tab?.setViewPager(viewPager)
        id_fragment_ware_house_tab?.overScrollMode = View.OVER_SCROLL_NEVER
    }
}