package com.bc_chat.circle.activity

import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.bc_chat.bc_base.config.RouteConfig
import com.bc_chat.bc_base.ui.BaseTabActivity
import com.bc_chat.circle.fragment.MineTopicFragment
import com.bc_chat.contacts.R
import com.zhaohaoting.framework.abs.AbsV4Fragment
import com.zhaohaoting.framework.abs.contract.BaseContract
import com.zhaohaoting.framework.abs.entity.TabTag
import com.zhaohaoting.framework.abs.entity.Tag

/**
 * author：Created by zhaohaoting on 2019/8/29
 * email：526309416@qq.com
 * desc：
 */
@Route(path = RouteConfig.MINE_TOPIC)
class MineTopicActivity : BaseTabActivity<BaseContract.BasePresenter>() {

    private var inflater: LayoutInflater? = null

    override fun initPresenter(): BaseContract.BasePresenter? = null

    override fun getTabItemView(tag: Tag?): View {
        val view = inflater?.inflate(R.layout.circle_tab_layout1, null, false)
        val tvText = view?.findViewById<TextView>(R.id.tv_text)
        val unRead = view?.findViewById<TextView>(R.id.un_read)
        tvText?.text = tag?.name
        return view!!
    }

    override fun initialize() {
        isCustomTab = true
        actionBar.setNavigationIcon(com.zhaohaoting.framework.R.mipmap.back)
        inflater = LayoutInflater.from(this)
        viewPager.setBackgroundColor(resources.getColor(R.color.white))
    }

    override fun getTabNames(): MutableList<out Tag> {
        return mutableListOf(TabTag("我发布的", "1"), TabTag("我回复的", "2"))
    }

    override fun getFragmentList(): MutableList<out AbsV4Fragment<BaseContract.BasePresenter>> {
        return mutableListOf(MineTopicFragment.newInstance("1"), MineTopicFragment.newInstance("2"))
    }
}