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