package com.abbidot.tracker.ui.fragment.demo

import android.content.Intent
import com.abbidot.tracker.base.BaseFragment
import com.abbidot.tracker.databinding.FragmentHomeBinding
import com.abbidot.tracker.deprecated.ui.activity.DetailActivity
import com.abbidot.tracker.deprecated.ui.fragment.vm.HomeViewModel
import com.abbidot.tracker.dialog.DialogUtils

/**
 *
 */
class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::inflate) {
    //
//    companion object {
//        @JvmStatic
//        fun newInstance(context: Context) = HomeFragment().apply {
//            mContext = context
//        }
//    }
    override fun initData() {
        super.initData()
        mViewBinding.test.setOnClickListener {
            DialogUtils.showMessageNegativeDialog(mActivity!!, "确定进去吗", { dialog, _ ->
                startActivity(Intent(context, DetailActivity::class.java))
                dialog.dismiss()
            }, null)
        }

        HomeViewModel().getData()
    }
}