package com.izipay.tradeizipay.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import com.izipay.tradeizipay.R
import com.izipay.tradeizipay.databinding.ActivityNavigationBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class NavigationActivity : AppCompatActivity() {

    private lateinit var binding:ActivityNavigationBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
        binding = ActivityNavigationBinding.inflate(layoutInflater)
        setContentView(binding.root)

        val customToolbar: Toolbar = findViewById(R.id.customToolbar)
        setSupportActionBar(customToolbar)
        val homeFragment=HomeFragment()
        setCurrentFragment(homeFragment)
    }

    private fun setCurrentFragment(fragment:Fragment)= supportFragmentManager.beginTransaction().apply {
        replace(R.id.navContainer, fragment)
        commit()
    }
}