package com.dafay.demo.viewbinding

import com.dafay.demo.viewbinding.base.BaseActivity
import com.dafay.demo.viewbinding.databinding.ActivityMainBinding

class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::inflate) {
    override fun bindListener() {
        binding.btnReplace1.setOnClickListener {
            supportFragmentManager.beginTransaction()
                .replace(R.id.fl_content, Test01Fragment())
                .addToBackStack(null)
                .commit()
        }
        binding.btnReplace2.setOnClickListener {
            supportFragmentManager.beginTransaction()
                .replace(R.id.fl_content, Test02Fragment())
                .addToBackStack(null)
                .commit()
        }
    }
}