package com.develop.auth.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.develop.auth.databinding.DialogGenderSelectBinding
import com.develop.food.base.ui.FullScreenTransparentDialog

class GenderSelectDialog(
    private val onSelect: (male: Boolean) -> Unit
): FullScreenTransparentDialog() {

    private lateinit var binding: DialogGenderSelectBinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = DialogGenderSelectBinding.inflate(
            inflater, container, false
        )
        binding.tvSelectMale.setOnClickListener {
            binding.tvSelectFemale.isSelected = false
            binding.tvSelectMale.isSelected = true
            onSelect(true)
              removeSelf()
        }
        binding.tvSelectFemale.setOnClickListener {
            binding.tvSelectFemale.isSelected = true
            binding.tvSelectMale.isSelected = false
            onSelect(false)
              removeSelf()
        }
        return binding.root
    }
}