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

menu width #23

Closed nomisRev closed 8 years ago

nomisRev commented 8 years ago

I'm using your library in a fragment. (Layout included below).

I'm using the same Fab implementation as you're using in the example. Only difference is I changed the width of the CardView to match parent, it should take up the whole width of the screen. But it doesn't. It takes a very small portion in the right corner of the screen. And I cannot identify where the problem originates from.

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <be.prontopoc.ui.Fab
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:src="@drawable/ic_add_white"
        android:layout_margin="@dimen/fab_margin"/>

    <!-- Overlay that dims the screen -->
    <com.gordonwong.materialsheetfab.DimOverlayFrameLayout
        android:id="@+id/overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <!-- Circular reveal container for the sheet -->
    <io.codetail.widget.RevealLinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="end|bottom"
        android:orientation="vertical">

        <!-- Sheet that contains your items -->
        <android.support.v7.widget.CardView
            android:id="@+id/fab_sheet"
            android:layout_width="match_parent"
            android:layout_height="200dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

            </LinearLayout>

        </android.support.v7.widget.CardView>
    </io.codetail.widget.RevealLinearLayout>

</android.support.design.widget.CoordinatorLayout>
gowong commented 8 years ago

Can you try wrapping your views in a another layout? I don't think the issue is specific to this library. Start with a very simple layout like only a CardView inside a LinearLayout and then add the other views one by one.

If that doesn't help, I can take a look when I get the chance.