|
|
@@ -81,6 +81,7 @@ class SelectableInput(private val ctx: Context, attrs: AttributeSet) : LinearLay
|
|
|
mPopWindow?.width = mBinding.et.width
|
|
|
mPopWindow?.height = ViewGroup.LayoutParams.WRAP_CONTENT
|
|
|
mPopWindow?.isOutsideTouchable = true
|
|
|
+ mPopWindow?.isFocusable = true
|
|
|
|
|
|
val popBinding = LayoutSelectableinputSpinnerBinding.bind(mDropdownView!!)
|
|
|
popBinding.rvOptions.adapter = object : CommonAdapter<String>(ctx, R.layout.item_rv_selectableinput_spinner, mOptionList) {
|
|
|
@@ -95,7 +96,11 @@ class SelectableInput(private val ctx: Context, attrs: AttributeSet) : LinearLay
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- mPopWindow?.showAsDropDown(mBinding.et)
|
|
|
+ if (mPopWindow?.isShowing == false) {
|
|
|
+ mPopWindow?.showAsDropDown(mBinding.et)
|
|
|
+ } else {
|
|
|
+ mPopWindow?.dismiss()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
fun setOnSpinnerSelectListener(onSpinnerSelectListener: OnSpinnerSelectListener) {
|