package com.quansu.heifengwuliu.activity

import android.view.View
import com.quansu.heifengwuliu.R
import com.quansu.heifengwuliu.adapter.CollectionAdapter
import com.quansu.heifengwuliu.base.MBRActivity
import com.quansu.heifengwuliu.databinding.ActivityCollectionBinding
import com.quansu.heifengwuliu.utils.net.NetEngine
import com.ysnows.base.base.BRRepository
import com.ysnows.base.base.BRViewModel
import com.ysnows.base.net.IResponse
import io.reactivex.Observable

class CollectionActivity : MBRActivity<BRViewModel<BRRepository>, CollectionAdapter, ActivityCollectionBinding>() {

    override fun initView(view: View?) {
        super.initView(view)
        titleBar()?.setRightText(getString(R.string.all_select))
    }


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


    override fun initAdapter(): CollectionAdapter {
        return CollectionAdapter()
    }

    override fun api(): Observable<out IResponse<*>> {
        return NetEngine.service.taskList("", vm?.repository()?.autoPage()!!)
    }

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