package es.verdnatura.presentation.view.feature.login.activity

import android.content.Intent
import es.verdnatura.R
import es.verdnatura.databinding.ActivityLoginBinding
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.addFragment
import es.verdnatura.presentation.view.feature.login.fragment.LoginFragment
import es.verdnatura.presentation.view.feature.main.activity.MainActivity

class LoginActivity : BaseActivity<ActivityLoginBinding>() {


    override fun getLayoutId(): Int = R.layout.activity_login

    override fun init() {

        /* val crashButton = Button(this)
        crashButton.text = "Crash!"
        crashButton.setOnClickListener {
            throw RuntimeException("Test Crash") // Force a crash
        }

        addContentView(crashButton, ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT))*/

        //goToMain()
        addFragment(LoginFragment.newInstance(), R.id.main_frame_layout, LoginFragment.TAG)
    }

     fun goToMain() {
        val intent = Intent(this, MainActivity::class.java)
        startActivity(intent)
        //splash_progress.visibility=View.GONE
        finish()
    }

}

