FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

layout_marginBottom doesn't work on Lollypop

Open siddharth96 opened this issue 11 years ago • 2 comments

Hi,

For this layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ListView
        android:id="@+id/fabListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.melnykov.fab.FloatingActionButton
        android:id="@+id/btnFab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginRight="@dimen/margin_small"
        android:layout_marginBottom="@dimen/margin_normal"
        android:src="@drawable/ic_action_content_new"
        fab:fab_colorNormal="@color/main_button_background"
        fab:fab_colorPressed="@color/main_button_background_pressed" />
</RelativeLayout>

The margin bottom doesn't seem to work on Lollypop (on a Nexus 6 Emulator).

fab

siddharth96 avatar Jan 10 '15 10:01 siddharth96

+1, I am in the same boat. Mine is on a Nexus 4 with 5.0.1. Tested the same xml layout with a Button instead of the FAB and the marginBottom worked as intended. Is the view eating up marginBottom to get animations to work or something?

Jawnnypoo avatar Jan 20 '15 07:01 Jawnnypoo

I had this issue too, FAB only overrides bottom margin when used on pre - lolipop device with shadow enabled (to accomodate shadow drawable). This issue looks like some kind of RelativeLayout \ FrameLayout bug. I use this FAB inside fragment, and had exactly same issue, but when I changed fragment container from FrameLayout to RelativeLayout this issue gone.

dkostyrev avatar Feb 25 '15 21:02 dkostyrev