-
Notifications
You must be signed in to change notification settings - Fork 29
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
Typeface for spinner's hint, floating label and ... #28
Comments
@asr1994 Hi, you could use Generally it is better to use something like InflationX.Calligraphy library to apply custom fonts across your app easily. |
Hi @asr1994, thanks for the support.
Please consider taking a look at the TextInputLayout documentation. Although this widget is still based on the android support libs (for compatibility with older projects) most of the documentation still applies. And worry not, if you're using AndroidX jetifier will ensure this widget will use the AndroidX libs instead of the older ones. Hope this helps and let me know if there's anything else I can help you. |
I'm using Calligraphy to use a custom font all over my app. All widgets like TextInputLayouts, Buttons, etc. use the custom font but MaterialSpinner ignores the custom font. |
Since custom fonts can be declared in style/themes using the appcompat version, and since the Material Components allow you to declare a default style for almost every text view or text view parent, I switched from Calligraphy to just adding all the necessary styles, and using So, as a result, I decided to add a custom style resource for the MaterialSpinner in my case, so the constructor now looks like this:
I always the style declared in my app's theme, as such:
As you probably noticed, the commented out code is trying to imitate what the Material Components version of TextInputLayout does for its child TextInputEditText. but it unfortunately did not work for me (yes, even trying to use the same overlay logic in themes).
( |
Hi, thanks for this great library. I'm going to set typeface for hint, floating label and selected item but i don't know how!. I found the custom adapter solution for list items but for hint, floating label and etc. i couldn't figure it out. I'll be appreciated if you give me some advice or better solution.
Here's my custom adapter :
`public class SpinnerAdapter extends ArrayAdapter {
}`
Thank you
The text was updated successfully, but these errors were encountered: