gowong / material-sheet-fab

Android library that provides the floating action button to sheet transition from Google's Material Design.
MIT License
1.58k stars 255 forks source link

Problem with margin on FAB #1

Closed SilkSama closed 9 years ago

SilkSama commented 9 years ago

Thanks for your job.

There is a problem when I set a margin to the FAB. I try to use your component with a fullscreen sheet and if I have a margin on the FAB the sheet is shifted. (regarding to the fab margins)

gowong commented 9 years ago

Hi,

This is because whenever opening the sheet, the sheet's position is automatically aligned with the FAB. I may add an attr in the future to disable this behavior, but for now you can add negative margins to your sheet as a workaround:

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="16dp"
    android:layout_marginBottom="16dp" />

<android.support.v7.widget.CardView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginRight="-16dp"
    android:layout_marginBottom="-16dp">