Closed MKevin3 closed 4 years ago
To get around this issue I put a transparent View on top of the MaterialSpinner and get the onClickListener from there.
Hi @MKevin3, have you tried setting a OnFocusChangeListener
instead?
Possible duplicate of #10
Hi @MKevin3 any feedback on this?
I just put a view on top of the MaterialSpinner as far as Z-Order is concerned and grab the listener there. While I understand why MaterialSpinner gives the warning in the log as it is a common mistake I don't feel it should be a "and there is NO way you can do this" exception.
@MKevin3 You should be able to achieve the same functionality without the need of an extra view using the OnFocusChangeListener
.
When you click on this view it also gains focus, therefore the focus callback will be triggered, and you will be able to achieve the same effect. Take a look at the sample for a simple example.
Hi @MKevin3 did you had the time to take a look at tying OnFocusChangeListener
?
Due to some code I inherited I need to use setOnClickListener. Basically I want the look and feel of the spinner but when it is clicked on a separate dialog appears. I am not using any of the other features of the spinner, no drop down, etc. but I need the look with the title over the spinner etc.
I do fully use of your spinner in a number of other areas in the code, this area just happens to be a hackfest.
The code in MaterialSpinner.kt at line 319 blocks this usage - as hacky as it might be.
Really need this check to be optional