|
@@ -9,6 +9,7 @@ import com.develop.common.databinding.DialogGenderSelectBinding
|
|
|
|
|
|
|
|
|
|
class GenderSelectDialog(
|
|
class GenderSelectDialog(
|
|
|
|
+ private var selectedPos: Int = 0,
|
|
private val onSelect: (male: Int) -> Unit
|
|
private val onSelect: (male: Int) -> Unit
|
|
) : FullScreenTransparentDialog() {
|
|
) : FullScreenTransparentDialog() {
|
|
|
|
|
|
@@ -28,27 +29,39 @@ class GenderSelectDialog(
|
|
binding.ivCancel.setOnClickListener {
|
|
binding.ivCancel.setOnClickListener {
|
|
removeSelf()
|
|
removeSelf()
|
|
}
|
|
}
|
|
|
|
+ if (selectedPos==0){
|
|
|
|
+ binding.tvSelectFemale.isSelected = false
|
|
|
|
+ binding.tvSelectMale.isSelected = false
|
|
|
|
+ binding.tvSelectNo.isSelected = true
|
|
|
|
+ } else if (selectedPos == 1){
|
|
|
|
+ binding.tvSelectFemale.isSelected = true
|
|
|
|
+ binding.tvSelectMale.isSelected = false
|
|
|
|
+ binding.tvSelectNo.isSelected = false
|
|
|
|
+ } else {
|
|
|
|
+ binding.tvSelectFemale.isSelected = false
|
|
|
|
+ binding.tvSelectMale.isSelected = true
|
|
|
|
+ binding.tvSelectNo.isSelected = false
|
|
|
|
+ }
|
|
|
|
|
|
binding.tvSelectNo.setOnClickListener {
|
|
binding.tvSelectNo.setOnClickListener {
|
|
binding.tvSelectFemale.isSelected = false
|
|
binding.tvSelectFemale.isSelected = false
|
|
binding.tvSelectMale.isSelected = false
|
|
binding.tvSelectMale.isSelected = false
|
|
- binding.tvSelectNo.isSelected =true
|
|
|
|
|
|
+ binding.tvSelectNo.isSelected = true
|
|
onSelect(0)
|
|
onSelect(0)
|
|
}
|
|
}
|
|
|
|
|
|
binding.tvSelectMale.setOnClickListener {
|
|
binding.tvSelectMale.setOnClickListener {
|
|
binding.tvSelectFemale.isSelected = false
|
|
binding.tvSelectFemale.isSelected = false
|
|
binding.tvSelectMale.isSelected = true
|
|
binding.tvSelectMale.isSelected = true
|
|
- binding.tvSelectNo.isSelected =false
|
|
|
|
|
|
+ binding.tvSelectNo.isSelected = false
|
|
onSelect(2)
|
|
onSelect(2)
|
|
}
|
|
}
|
|
binding.tvSelectFemale.setOnClickListener {
|
|
binding.tvSelectFemale.setOnClickListener {
|
|
binding.tvSelectFemale.isSelected = true
|
|
binding.tvSelectFemale.isSelected = true
|
|
binding.tvSelectMale.isSelected = false
|
|
binding.tvSelectMale.isSelected = false
|
|
- binding.tvSelectNo.isSelected =false
|
|
|
|
|
|
+ binding.tvSelectNo.isSelected = false
|
|
onSelect(1)
|
|
onSelect(1)
|
|
}
|
|
}
|
|
- binding.tvSelectNo.isSelected = true
|
|
|
|
return binding.root
|
|
return binding.root
|
|
}
|
|
}
|
|
}
|
|
}
|