FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

Cannot work with SwipeRefreshLayout

Open XinwenCheng opened this issue 10 years ago • 1 comments

Seems FloatingActionButton can't work with SwipeRefreshLayout, right?

<LinearLayout 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"
    android:orientation="vertical">

    <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/fragment_planlist_planListSwipeRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        tools:context="com.fourthdimension.gaodingv1android.PlanListFragment">

        <ListView
            android:id="@+id/fragment_planlist_planListView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:dividerHeight="3dp" />
    </android.support.v4.widget.SwipeRefreshLayout>

    <com.melnykov.fab.FloatingActionButton
        android:id="@+id/fragment_planlist_newPlanFloatingActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_margin="16dp"
        android:src="@drawable/icon_newplan_56"
        fab:fab_colorNormal="#F2F2F2"
        fab:fab_colorPressed="#EEEEEE"
        fab:fab_colorRipple="#a9b7b7"
        fab:fab_shadow="true" />
</LinearLayout>

Code as above, this button won't appear, even I've attached it to plan list view in Java code.

If I just remove SwipeRefreshLayout, it works. But I need the refresh component, would you please help to check? Thanks!

<LinearLayout 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"
    android:orientation="vertical">

    <ListView
        android:id="@+id/fragment_planlist_planListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:dividerHeight="3dp" />

    <com.melnykov.fab.FloatingActionButton
        android:id="@+id/fragment_planlist_newPlanFloatingActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_margin="16dp"
        android:src="@drawable/icon_newplan_56"
        fab:fab_colorNormal="#F2F2F2"
        fab:fab_colorPressed="#EEEEEE"
        fab:fab_colorRipple="#a9b7b7"
        fab:fab_shadow="true" />
</LinearLayout>

XinwenCheng avatar Oct 10 '15 09:10 XinwenCheng

https://github.com/makovkastar/FloatingActionButton/issues/54

vassilisimon avatar Oct 13 '15 10:10 vassilisimon