package com.example.myapplication.ui.mine

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.example.myapplication.R
import android.widget.LinearLayout
import de.hdodenhof.circleimageview.CircleImageView

class MineFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_mine, container, false)
    }

    
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        
        // 会员充值按钮点击
        view.findViewById<ImageView>(R.id.imgLeft).setOnClickListener {
            findNavController().navigate(R.id.action_global_rechargeFragment)
        }
        
        // 金币充值按钮点击
        view.findViewById<ImageView>(R.id.imgRight).setOnClickListener {
            findNavController().navigate(R.id.action_global_goldCoinRechargeFragment)
        }

        // 头像点击
        view.findViewById<CircleImageView>(R.id.avatar).setOnClickListener {
             findNavController().navigate(R.id.action_mineFragment_to_personalSettings)
        }

        //我的键盘
        view.findViewById<LinearLayout>(R.id.keyboard_settings).setOnClickListener {
            findNavController().navigate(R.id.action_mineFragment_to_mykeyboard)
       }
        
        // 反馈按钮点击
        view.findViewById<LinearLayout>(R.id.click_Feedback).setOnClickListener {
            findNavController().navigate(R.id.action_mineFragment_to_feedbackFragment)
       }

        // 反馈按钮点击
        view.findViewById<LinearLayout>(R.id.click_Notice).setOnClickListener {
            findNavController().navigate(R.id.action_mineFragment_to_notificationFragment)
       }

    }
}
