Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MFlisar opened this issue Jul 22, 2020 · 1 comment
Open

Comments

@MFlisar
Copy link

MFlisar commented Jul 22, 2020

Step 2: Describe your environment

  • Library version: 3.1.1
  • Android version: 9

Step 3: Describe the problem:

Steps to reproduce:

What I do is following:

  • I add a simply view like following:
<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" />
  • I add a few items to my RecyclerView
  • the items are not scrollable yet because they all fit on the screen
  • now I try to scroll down
  • afterwards I see what I describe under Observed Results
  • I remove the layout behaviour and everything works fine again

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
Copy link
Author

MFlisar commented Jul 22, 2020

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>

@MFlisar MFlisar closed this as completed Jul 22, 2020
@MFlisar MFlisar reopened this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant