package com.kaixed.kchat.view.activity

import android.R
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.kaixed.kchat.databinding.ActivityProfileBinding
import com.kaixed.kchat.view.fragment.SettingsFragment


class ProfileActivity : AppCompatActivity() {
    private lateinit var binding: ActivityProfileBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        binding = ActivityProfileBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.clProfile.setOnClickListener {
            val intent = Intent(this, ProfileDetailActivity::class.java)
            startActivity(intent)
        }

        binding.rlSetting.setOnClickListener {
//            val intent = Intent(this, SettingActivity::class.java)
//            startActivity(intent)
            supportFragmentManager
                .beginTransaction()
                .replace(
                    binding.fragmentContainer.id,
                    SettingsFragment()
                ) // fragment_container 是你的布局中的容器ID
                .commit()
            binding.clProfile.visibility = View.GONE
            binding.llSettingItems.visibility = View.GONE

        }
    }
}