Skip to content
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

Cannot set typeface to floatingActionButton view #59

Closed
kushal25 opened this issue Dec 15, 2014 · 6 comments
Closed

Cannot set typeface to floatingActionButton view #59

kushal25 opened this issue Dec 15, 2014 · 6 comments

Comments

@kushal25
Copy link

Unable to set typeface to floatingActionButton view. I am trying to use fontawesome icons for each floatingActionButton. For now, i am using app:fab_icon to set the icon from the drawables folder. But, would like use fontAwesome Icons. Please show me a way.

@chalup
Copy link
Contributor

chalup commented Dec 17, 2014

There is a PR with setDrawable method for FAB. When I merge it, you'll be able to set the correct icon from code (I'm sure there are some IconFontDrawable implementations available).

@chalup chalup closed this as completed Dec 17, 2014
@kushal25
Copy link
Author

Did u add the setDrawable method for FAB yet?. I am using the version 1.6.0 but still haven't been able to use the iconfontdrawable implementations.

@chalup
Copy link
Contributor

chalup commented Jan 19, 2015

You should be able to use FloatingActionButton.setIconDrawable method.

@kushal25
Copy link
Author

Yea, but that still will use the icon image from drawable's folder. What i usually do is, set any icon a font-awesome string value. and then setTypeface in the activity to get the fontAwesome icon. Isnt this possible with fab as well?

@chalup
Copy link
Contributor

chalup commented Jan 19, 2015

I think you're referring to:

public void setIcon(@DrawableRes int icon)

but there's also

public void setIconDrawable(@NonNull Drawable iconDrawable)

There are multiple libraries that allow creating Drawable from font. If you want setText + setTypeface directly on FAB class, that's not going to happen.

@kushal25
Copy link
Author

Alright. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants