umano / AndroidSlidingUpPanel

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
http://umano.me
Apache License 2.0
9.5k stars 2.27k forks source link

Double tap hangs the view #876

Open Harmeet2491 opened 7 years ago

Harmeet2491 commented 7 years ago

I am working on slideup panel library version 3.1.1. I have made the slideuppanel to be anchored on the screen when clicked to expand the layout on the main activity.Whenever the layout is popping-up or collapsing and the user taps on the layout it hangs the layout.

It is happening on all the devices.

<?xml version="1.0" encoding="utf-8"?> <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sothree="http://schemas.android.com/apk/res-auto" android:id="@+id/gallery_sliding_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" android:layout_alignParentBottom="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"> <include layout="@layout/gallery_view" android:id="@+id/gallery_view"/> <LinearLayout android:id="@+id/gallery_share_slide_top" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#eeeeee" android:clickable="true" android:orientation="vertical" android:layout_marginTop="200dp" android:focusable="false" android:visibility="invisible"> <FrameLayout android:id="@+id/gallery_dialog_container" android:clickable="true" android:layout_width="match_parent" android:layout_height="wrap_content"/> </com.sothree.slidinguppanel.SlidingUpPanelLayout>

screenshot_20170905-140649

Unbekannter commented 6 years ago

@Harmeet2491 Do you have a solution for this? I also noticed the same bug

AJ92 commented 6 years ago

Up... I also experience this issue!

Harmeet2491 commented 6 years ago

ohk so I found this little work around for this one which helped me to close the screen without being interrupted. I overrode the dispatchTouchEvent method and disabled the touch until the slider is not collapsed by checking the state of the slider using slidingPanel.getPanelState() . And I have disabled the multitouch support for that particular layout so that there is no simultaneous multi-touch to hang the state of slider. I hope that helps :)

AJ92 commented 6 years ago

I also have a little work around... i assumed that the onInterceptTouchEvent method kinda is faulty so i always return false there... i lost the "swipe" functionality but clicks still work and i can double click or what ever and it still opens or closes!

uraman2000 commented 6 years ago

i just recently discover that state is actually anchored, so what I did is when it is anchored i just expand the panel! :)

Dshmuel commented 6 years ago

My fix: Added if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_SETTLING) return false; as first line in onInterceptTouchEvent

ouyangzn commented 5 years ago

delete this line image