leinardi / FloatingActionButtonSpeedDial

A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification (https://material.io/components/buttons-floating-action-button#types-of-transitions)
Apache License 2.0
1.46k stars 140 forks source link

Snackbar behaviour breaks clicks, scrolling and similar for one touch #153

Open MFlisar opened 4 years ago

MFlisar commented 4 years ago

Step 2: Describe your environment

Step 3: Describe the problem:

Steps to reproduce:

What I do is following:

Observed Results:

As soon as I add the app:layout_behavior="@string/speeddial_scrolling_view_snackbar_behavior" behaviour to the SpeedDialView I see that I can break the touch handling of the RecyclerViewfor at least one click / touch. This means the RecyclerView is not responding to a scroll or click once and will only respond when I try it the second time.

MFlisar commented 4 years ago

Example layout looks like following in my case:

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.MainActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rvContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <com.leinardi.android.speeddial.SpeedDialView
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:backgroundTint="?colorAccent"
        app:layout_behavior="@string/speeddial_scrolling_view_snackbar_behavior"
        app:sdMainFabClosedIconColor="@android:color/white"
        app:sdMainFabClosedSrc="@drawable/ic_add_black_24dp" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>