package com.input.board.appskey.keyboard.viewUi

import android.content.Intent
import android.os.Bundle
import android.os.CountDownTimer
import android.widget.ImageView
import android.widget.ProgressBar
import androidx.appcompat.app.AppCompatActivity
import com.input.board.appskey.keyboard.R

class NovaActivity : AppCompatActivity() {

    private lateinit var progressBar: ProgressBar
    private lateinit var novaIm: ImageView
    private var countTime = 11000L
    private lateinit var timer: CountDownTimer
    private var needShow = true


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_nova)
        init()
        findView()
    }

    private fun init() {

        timer = object : CountDownTimer(countTime, 100) {
            override fun onTick(millisUntilFinished: Long) {

            }

            override fun onFinish() {
                toHome()
            }

        }

    }


    private fun findView() {
        novaIm = findViewById(R.id.nova_picture)
        progressBar = findViewById<ProgressBar>(R.id.nova_progress)
    }


    private fun toHome() {
        startActivity(Intent(this, HomeActivity::class.java))
        finish()
    }

    override fun onDestroy() {
        super.onDestroy()
        timer.cancel()
    }


}