issue/3039-fab-position #3111

Merged
merged 1 commit into from Aug 27, 2015

Projects

None yet

2 participants

@nbradbury
Contributor

Fixes #3039 - This one is annoying and takes a little explaining, so bear with me...

The issue is that on pre-L devices, the right margin is too large on the "My Site" FAB. This is because on pre-L the shadow (elevation) is drawn within the view's bounds, which modifies its visual padding. This isn't an issue on Lollipop since it natively supports elevation.

Yet strangely, the right margin looks just fine on the post list FAB. This is because it's inside a CoordinatorLayout, and CoordinatorLayout automatically offsets the FAB to account for the shadow on pre-L devices. Yes, this is insane - for details see https://code.google.com/p/android/issues/detail?id=175330

This leaves us with four choices:

  1. Leave it the way it is
  2. Remove the elevation on pre-L devices
  3. Write a bunch of code to deal specifically with the "My Site" FAB
  4. Add a CoordinatorLayout to "My Site"

I chose #4 and wrapped the My Site FAB in a CoordinatorLayout so it would take care of fixing the margins. I also chose to remove the elevation (fab_elevation) from the layouts in favor of letting FloatingActionButton set the elevation itself.

@nbradbury nbradbury Wrap the My Site FAB in a CoordinatorLayout, let the FAB handle eleva…
…tion
d34605e
@nbradbury nbradbury added this to the 4.5 milestone Aug 27, 2015
@tonyr59h tonyr59h self-assigned this Aug 27, 2015
@tonyr59h
Contributor

sigh...more support library problems :(

I think this solution is the best of those presented, what a pain though 😡

I also chose to remove the elevation (fab_elevation) from the layouts in favor of letting FloatingActionButton set the elevation itself.

👏

@tonyr59h
Contributor

:shipit:

@tonyr59h tonyr59h merged commit 867c6f7 into develop Aug 27, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@tonyr59h tonyr59h deleted the issue/3039-fab-position branch Aug 27, 2015
@tonyr59h tonyr59h added the bug label Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment