Skip to content
Commit fd77f121 authored by András Kurucz's avatar András Kurucz
Browse files

Only do snapback animations on Swipeable views

SwipeHelper is observing all the children of the notification shade, it
is translating them on swipes and performs dismiss or snapback
animations on them.

NotificationSwipeHelper overrides a couple of methods to make them only
work for views implementing the SwipeableView interface.

The SwipeHelper#snapChild method is triggered for non swipeable views as
well, and it starts an animation for them, but previously we never
noticed, because the `setTranslation` method is overriden, so views
never had a starting translation to snap back from.

Updating the snapback anim to a spring animation (ag/22119722) caused a
regression, because the spring anim can do an overshoot from the target
position if it was given some starting velocity.

This is a trivial fix to skip triggering the snapback anim for non
swipeable views.

Fixes: 278858192
Test: atest NotificationSwipeHelperTest
Test: try to drag the non swipeable views in the NotificationShade and
observe that they stay in place

Change-Id: I5afb7bb94c052faf0025abe15f586937733c5fa4
parent fd9d67ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment