package xyz.apiote.bimba.czwek.onboarding

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import xyz.apiote.bimba.czwek.dashboard.MainActivity

class FirstRunActivity : AppCompatActivity() {
	override fun onCreate(savedInstanceState: Bundle?) {
		installSplashScreen()
		super.onCreate(savedInstanceState)

		val preferences = getSharedPreferences("shp", MODE_PRIVATE)
		val intent = if (preferences.getBoolean("firstRun", true)) {
			Intent(this, OnboardingActivity::class.java)
		} else {
			Intent(this, MainActivity::class.java)
		}
		startActivity(intent)
		finish()
	}
}