package com.wall.photography.wallpaper.activivty

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.CountDownTimer
import com.wall.photography.wallpaper.MyApp
import com.wall.photography.wallpaper.R
import com.wall.photography.wallpaper.databinding.ActivityMainBinding
import com.wall.photography.wallpaper.databinding.ActivityWelcomeBinding

class MyWelComeActivity : AppCompatActivity() {

    private lateinit var vb:ActivityWelcomeBinding
    private lateinit var goTimer:CountDownTimer
    private val countTime = 2000L
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        vb = ActivityWelcomeBinding.inflate(layoutInflater)
        setContentView(vb.root)
        init()
    }

    private fun init(){
        goTimer = object :CountDownTimer(countTime,500){
            override fun onTick(millisUntilFinished: Long) {

            }

            override fun onFinish() {
                    enterMain()


            }
        }
        goTimer.start()
    }

    private fun enterMain(){
        startActivity(Intent(this@MyWelComeActivity, MainActivity::class.java))
        finish()
    }

}