package com.quansu.heifengwuliu.fragment

import android.view.LayoutInflater
import android.view.ViewGroup
import com.qmuiteam.qmui.kotlin.onClick
import com.quansu.heifengwuliu.activity.OneLoginActivity
import com.quansu.heifengwuliu.base.MBFragment
import com.quansu.heifengwuliu.databinding.FragmentIndexBinding
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel
import com.ysnows.base.utils.MMKVManager
import com.ysnows.base.utils.UiSwitch

/**
 *Created by shihuiyun
 *on 2020/9/9
 */
class IndexFragment : MBFragment<BViewModel<BRepository>, FragmentIndexBinding>() {

    override fun listeners() {
        super.listeners()

        binding.btnLogout.onClick {
            MMKVManager.instance().clearAll()
            UiSwitch.single_new_task_with_clear_task(context, OneLoginActivity::class.java)
        }
    }

    override fun binding(inflater: LayoutInflater, container: ViewGroup?): FragmentIndexBinding {
        return FragmentIndexBinding.inflate(layoutInflater)
    }

    override fun title(): String? {
        return null
    }

}
