package com.example.doctor.Setting

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.doctor.R
import com.example.doctor.databinding.FragmentYourDataBinding


class YourDataFragment : Fragment() {
    private lateinit var binding:FragmentYourDataBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentYourDataBinding.inflate(layoutInflater, container, false)
        return binding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        button()
    }

    private fun button()= with(binding) {
        btnExitYorData.setOnClickListener{
            activity?.supportFragmentManager?.beginTransaction()
                ?.replace(R.id.CLMainFragment, SettingFragment.newInstance())
                ?.commit()
        }

    }

    companion object {
        fun newInstance() = YourDataFragment()
    }
}