package com.kaixed.kchat.view.activity

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.kaixed.kchat.databinding.ActivitySettingBinding
import com.kaixed.kchat.model.setting.SettingItem
import com.kaixed.kchat.view.adapter.SettingListAdapter

class SettingActivity : AppCompatActivity() {
    private lateinit var binding: ActivitySettingBinding
    private lateinit var settingItems: MutableList<SettingItem>
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivitySettingBinding.inflate(layoutInflater)
        enableEdgeToEdge()
        setContentView(binding.root)

        settingItems = getSettingItems()
        binding.rvSetting.layoutManager =
            LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
        binding.rvSetting.adapter = SettingListAdapter(settingItems)

    }

    private fun getSettingItems(): MutableList<SettingItem> {
        return mutableListOf(
            SettingItem.NormalItem("账号与安全", "安全"),
            SettingItem.TitleItem(""),
            SettingItem.NormalItem("青少年模式", "模式"),
            SettingItem.NormalItem("关怀模式", "模式"),
            SettingItem.TitleItem(""),
            SettingItem.NormalItem("新消息通知", "杂"),
            SettingItem.NormalItem("聊天", "杂"),
            SettingItem.NormalItem("设备", "杂"),
            SettingItem.NormalItem("通用", "杂"),
            SettingItem.TitleItem("隐私"),
            SettingItem.NormalItem("朋友权限", "隐私"),
            SettingItem.NormalItem("个人信息与权限", "隐私"),
            SettingItem.NormalItem("个人信息收集清单", "隐私"),
            SettingItem.NormalItem("第三方信息共享清单", "隐私"),
            SettingItem.TitleItem(""),
            SettingItem.NormalItem("插件", "插件"),
            SettingItem.TitleItem(""),
            SettingItem.NormalItem("关于", "帮助"),
            SettingItem.NormalItem("帮助与反馈", "帮助"),
            SettingItem.TitleItem(""),
            SettingItem.NormalItem("切换账户", "账户"),
            SettingItem.NormalItem("退出", "账户")
        )
    }

}