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

Request: allow to use any size #108

Open
AndroidDeveloperLB opened this issue Jan 25, 2015 · 5 comments
Open

Request: allow to use any size #108

AndroidDeveloperLB opened this issue Jan 25, 2015 · 5 comments

Comments

@AndroidDeveloperLB
Copy link

mini and normal aren't always enough...
I assume that the problematic part here is the shadow, but maybe there is a way to create it on demand?

@dirkam
Copy link

dirkam commented Jan 25, 2015

+1 (although the size it's stated in the guidelines, it would be useful for in some cases)

@AndroidDeveloperLB
Copy link
Author

I also think that the size should include the shadow, to avoid confusion of why it gets truncated.

@sfunke
Copy link

sfunke commented Feb 25, 2015

Just opened a pull request from my fork, where I implemented this feature out of own needs:
#127

Fingers crossed that it gets pulled in ;-)

In the meantime, feel free to take my branch at
https://github.com/sfunke/FloatingActionButton/tree/feature/free-size

Just add a fab_size attribute to the xml where you include the button in layout, and give it a dimension value.

@MGaetan89
Copy link

Until this is integrated in the library, I just scale the button as follow:

fab.setScaleX(0.75f);
fab.setScaleY(0.75f);

Didn't test it with shadow enable though.

@mustafaberkaymutlu
Copy link

mustafaberkaymutlu commented Sep 18, 2017

You can also override R.dimen.fab_size_normal or R.dimen.fab_size_mini to anything you want by adding the same dimensions into your dimens.xml:

<dimen name="fab_size_mini">40dp</dimen>
<dimen name="fab_size_normal">56dp</dimen>

Their default values are 40dp and 56dp.

dimens.xml in the library
Answer source

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

5 participants