package com.develop.foodcooking

import android.os.Bundle
import android.view.LayoutInflater
import com.develop.base.ext.navigateTo
import com.develop.base.util.MMkvUtils
import com.develop.common.router.Screens
import com.develop.common.tag.FIRST_IN
import com.develop.common.ui.CommonBVMActivity
import com.develop.foodcooking.databinding.ActivityMainBinding

class MainActivity : CommonBVMActivity<ActivityMainBinding, MainViewModel>() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        if (MMkvUtils.getBool(FIRST_IN)) {
            navigateTo(Screens.Main.ENTRANCE_CHOSEN)
        } else {
            navigateTo(Screens.Setting.ANIMATION)
        }
        finish()
    }

    override fun createViewBinding(inflater: LayoutInflater): ActivityMainBinding {
        return ActivityMainBinding.inflate(inflater)
    }

    override fun createViewModel(): MainViewModel {
        return getViewModel(MainViewModel::class.java)
    }
}