Skip to content

Instantly share code, notes, and snippets.

@farbodsz
Last active August 3, 2017 16:15
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save farbodsz/a43891f5eef40b1c3141 to your computer and use it in GitHub Desktop.
Save farbodsz/a43891f5eef40b1c3141 to your computer and use it in GitHub Desktop.
A Spinner component with a floating label for Android, similar to EditText components wrapped in a TextInputLayout.

Moved to an Android library...

This Gist has been discontinued and will be updated on a GitHub project here. The files I have removed from this Gist can be found there. Please feel free to open issues, pull requests, etc, so that I can change and improve the library how you like.

If you are already using the Gist, delete the layout XML, values XML, and Java files (the ones I have removed from this Gist), and instead add the following in your app module's build.gradle dependencies:

compile 'com.satsuware.lib:usefulviews:+'

Make sure to change your imports as well in the files that you are using the LabelledSpinner component.

@farbodsz
Copy link
Author

@mcelotti - I have added the option for an error text for when the first item of the Spinner (e.g. a prompt, or hint) is selected, so the user knows it is an invalid selection.
See the changes in LabelledSpinner.java in the repo.

@paolorotolo - You mentioned that you would be willing to help on the project ;) . As you may (or may not) know, I have moved this to a repo. There are a few issues at the moment, so feel free to make a fork/pull request, or open an issue if you see an improvement/bug/etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment