-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate androidx.appcompat.widget.AppCompatSpinner #38
Comments
Would it be a validation of the quantity of items in Spinner? |
Yes, if the spinner has no items. Another improvement would be to validate if the user has selected an item in the spinner other than the first, where usually we place the text "Please select an item" that usually has no value. |
So, the quantity of items in a Spinner doesn't seem to be interesting to add to that library. Now checking if another item, other than the first one, was selected seems to be very interesting! But for that case, we would have to use a If you want to contribute, we can analyze the PR. If not, maybe I'll find some time to do this later. |
On the spinner, you can do the setError on the TextView it contains. The only problem is if the spinner has no items it will not have the TextView. My initial need was for a validation on the number of items on the spinner; sometimes if you select a parent spinner the child spinner will have no items. It would be nice to have. You could do also another improvement that I've seen on other web validation libraries which is create a error placeholder that would be placed under the widget being validated. |
How can I validate a Spinner? I tried adding one of the validations but I get this compilation error:
Cannot find a setter for <androidx.appcompat.widget.AppCompatSpinner app:validateMinLength> that accepts parameter type 'int' If a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches
The text was updated successfully, but these errors were encountered: