package com.example.myapplication

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class OnboardingActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_onboarding)

        val btnStart = findViewById<TextView>(R.id.tv_skip)

        btnStart.setOnClickListener {
            // 标记已经不是第一次启动了
            val prefs = getSharedPreferences("app_prefs", MODE_PRIVATE)
            prefs.edit().putBoolean("is_first_launch", false).apply()

            // 跳转到主界面
            startActivity(Intent(this, MainActivity::class.java))
            finish()
        }
    }
}
