Closed Elessawy closed 7 years ago
Hello , Did You Find Any Method to do the same ???
no
Hi guys, The problem was that clicking inside the search is considered clicking outside the drop down window. So, a new method added
mSearchableSpinner.isInsideSearchEditText(event)
Thus, we can define an on Touch listener and check if the touch is or not inside the search and dismiss the popup window, like this:
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!mSearchableSpinner.isInsideSearchEditText(event)) {
mSearchableSpinner.hideEdit();
}
return super.onTouchEvent(event);
}
Thanks for your efforts, my issue has been solved. However, in my activity I'm using three spinners and on opening one spinner then click the second spinner to open it, the first spinner doesn't close. I used a view covers each spinner and set a touch listener on it where I can close other spinners.
mSpinner1TouchView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
mSpinner2.hideEdit();
mSpinner3.hideEdit();
return false;
}
});
thank you again for your amazing library and your fast response.
Hi @Elessawy
You can use the version 1.0.7. A new status listener added, the example project also contains an example. In short :
mSearchableSpinner.setStatusListener(new IStatusListener() {
@Override
public void spinnerIsOpening() {
mSearchableSpinner1.hideEdit();
mSearchableSpinner2.hideEdit();
}
@Override
public void spinnerIsClosing() { }
});
Thanks
Thanks Michael. I will use the latest version. Great work, keep going :)
It Says Cannot Resolve Symbol 'IStatusListener'
make sure that you are using the latest version (1.0.7) and that the listener is imported
import gr.escsoft.michaelprimez.searchablespinner.interfaces.IStatusListener;
i tried above code but not working
drop down list does not close after clicking outside it. is there any method to force close the drop down list?