package com.zswc.creativity.activity

import androidx.fragment.app.Fragment
import com.qmuiteam.qmui.widget.tab.QMUITab
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder
import com.zswc.creativity.R
import com.zswc.creativity.base.MBTabActivity
import com.zswc.creativity.databinding.ActivityAccountBinding
import com.zswc.creativity.fragment.AccountAnalysisFragment
import com.zswc.creativity.fragment.AccountBillFragment
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel

class AccountActivity : MBTabActivity<BViewModel<BRepository>, ActivityAccountBinding>() {


    override fun binding(): ActivityAccountBinding {
        return ActivityAccountBinding.inflate(layoutInflater)
    }



    override fun title(): String? {
        return getString(R.string.my_account)
    }

    override fun getPageItem(position: Int): Fragment {
        return if (position == 1) {
           AccountAnalysisFragment()
        } else AccountBillFragment()
    }

    override fun getPageCount(): Int {
     //   return 2
        return 1
    }

    override fun createTabs(tabBuilder: QMUITabBuilder): Array<QMUITab> {

        val component = tabBuilder
                .setText(getString(R.string.bill))
                .build(context())
//        val util = tabBuilder
//                .setText(getText(R.string.analysis))
//                .build(context())

        //return arrayOf(component, util)

        return arrayOf(component)
    }
}
