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

issue/3039-fab-position #3111

Merged
merged 1 commit into from Aug 27, 2015

Conversation

Projects
None yet
2 participants
@nbradbury
Contributor

nbradbury commented Aug 27, 2015

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 added this to the 4.5 milestone Aug 27, 2015

@tonyr59h tonyr59h self-assigned this Aug 27, 2015

@tonyr59h

This comment has been minimized.

Show comment
Hide comment
@tonyr59h

tonyr59h Aug 27, 2015

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.

👏

Contributor

tonyr59h commented Aug 27, 2015

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

This comment has been minimized.

Show comment
Hide comment
@tonyr59h

tonyr59h Aug 27, 2015

Contributor

:shipit:

Contributor

tonyr59h commented Aug 27, 2015

:shipit:

tonyr59h added a commit that referenced this pull request Aug 27, 2015

@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 [Type] Bug label Aug 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment