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

Style is not applied to the FAB button #11

Closed
carvalhorr opened this issue Jun 29, 2017 · 6 comments
Closed

Style is not applied to the FAB button #11

carvalhorr opened this issue Jun 29, 2017 · 6 comments

Comments

@carvalhorr
Copy link

When I apply a style in XML to the FAB what gets styled is the clickable area that fills the entire screen. Would it be possible to apply the style to the button instead?

Example:

If I use the style tag:
<uk.co.markormesher.android_fab.FloatingActionButton style="my_style_here" />

I get this:
device-2017-06-29-233008

@markormesher
Copy link
Owner

Hi @carvalhorr. The problem with styling the uk.co.markormesher.android_fab.FloatingActionButton view element is that it's not just the button, it's actually a wrapper that contains the button, the icon, the speed-dial menu components, etc.

What kind of styles were you trying to apply? I can help you figure out how to apply them to just the button (or make plans for a new release that will allow it).

@carvalhorr
Copy link
Author

Thanks, @markormesher. I would like the same syle that is applied in the other FAB.

The style is defined here: https://github.com/OneBusAway/onebusaway-android/blob/master/onebusaway-android/src/main/res/values/styles.xml (See the style name "OneBusAway.FloatingActionButton")

@barbeau
Copy link
Contributor

barbeau commented Jun 30, 2017

@carvalhorr What device/emulator/Android version was the screenshot from?

I had a similar issue when adding the setting for "left hand mode" to OneBusAway Android (OneBusAway/onebusaway-android@625b262), which simply flips the My Location FAB to be aligned to parent left instead of parent right (i.e., moves it to the left side of the screen). From the above commit description:

Note that below API Level 17, the FAB gets stretched across the entire screen immediately after changing the setting. Apparently you can't remove a layout rule programmatically before this (API Level 17), so the only workaround is restarting the app to reset the FAB layout and remove the opposite rule.

It's been a while since I looked at this, so I'm not sure if it's related or not. But it would be good to know which device/emulator you're seeing this on.

@carvalhorr
Copy link
Author

This is an emulator running API level 23.

@markormesher
Copy link
Owner

Dragging up an old issue: one thing on my list to add in v2.1 is exposure of the core views making up the FAB (the card view, the icon wrapper, etc). I imagine you've worked around this already, but that should resolve this for anyone coming across this in the future.

@markormesher
Copy link
Owner

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

3 participants