Closed simoks closed 2 years ago
I'm experiencing this problem with the default SnackBar too, seems to be something to do with it recieving a ACTION_CANCEL event from the CoordinatorLayout when the SwipeDismissBehavior calls requestDisallowInterceptTouchEvent in onViewCaptured.
@elliotmurray I'm also experiencing this with the default snackbar. Did you find a solution?
Does this help: https://stackoverflow.com/a/42222170/444761 (also: https://www.codeleading.com/article/43344985927/ )
Behavior
touch event comes from CoordinatorLayout
. I think CoordinatorLayout
parent requestDisallowInterceptTouchEvent
should be used
I have created a custom view extending from the BaseTransientBottomBar class. I can't drag to dismiss this view, so no animation is visible for dragging.
When I'm trying to drag the view, the message below is shown in my logcat console : "Ignoring pointerId=0 because ACTION_DOWN was not received for this pointer before ACTION_MOVE. It likely happened because ViewDragHelper did not receive all the events in the event stream."
class CustomSnackBar (parent: ViewGroup, content: CustomView) : BaseTransientBottomBar< CustomView >(parent, content, content){
..... }
val behavior = Behavior().apply { setSwipeDirection(SwipeDismissBehavior.SWIPE_DIRECTION_END_TO_START) setDragDismissDistance(0.3f) }
customSnackBar.setDuration(Snackbar.LENGTH_INDEFINITE).setBehavior(behavior)
Android target and compiled SdkVersion: : 28
Material Library version: tested with 1.1.0, 1.2.0-alpha05, 1.2.0-alpha07 (the same problem)