[go: nahoru, domu]

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

issue/3039-fab-position #3111

Merged
merged 1 commit into from
Aug 27, 2015
Merged

issue/3039-fab-position #3111

merged 1 commit into from
Aug 27, 2015

Conversation

nbradbury
Copy link
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 added this to the 4.5 milestone Aug 27, 2015
@tonyr59h tonyr59h self-assigned this Aug 27, 2015
@tonyr59h
Copy link
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
Copy link
Contributor

:shipit:

tonyr59h added a commit that referenced this pull request Aug 27, 2015
@tonyr59h tonyr59h merged commit 867c6f7 into develop Aug 27, 2015
@tonyr59h tonyr59h deleted the issue/3039-fab-position branch August 27, 2015 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sites Tab: FAB is positioned incorrectly on Android 4.x
2 participants