package com.example.watch.ui.activity

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import com.example.watch.R

class SettingActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //        白色状态栏
        setStatusBarColor()
        setContentView(com.example.watch.R.layout.activity_setting)

//        切换tab
        turnTabPage()
    }

    fun setStatusBarColor() {
        val window = window
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
        window.statusBarColor = resources.getColor(R.color.pink)
    }

    private fun turnTabPage(){
        val home_btn = findViewById<View>(R.id.navigation_home)
        home_btn.setOnClickListener{
            startActivity(Intent(this, MainActivity::class.java))
        }
        val setting_btn = findViewById<View>(R.id.navigation_setting)
        setting_btn.setOnClickListener{
            val SettingActivityIntent = Intent(this, SettingActivity::class.java)
            startActivity(SettingActivityIntent)
        }
    }
}