Open Barrio17 opened 1 year ago
Update: I've just noticed that the events also seem to fire ok when using autoCompleteMode="continuousVelocity"
instead of autoCompleteMode="spring"
in the <OnSwipe>
.
This will let me crack on for now at least, though would be nice to be able to use the spring mode as it definitely better matches the animation design I'm currently implementing.
Completion was judged by touch driver reaching 0 or 1 with spring it over shoots so that does not work very well.
We trying to improve this for the next release.
Same here. I have debugged MotionLayoutState
class, and when I have touchUp: 'autocomplete'
mode enabled - I continuously receive MotionAnimationCommand.Animate
with newProgress
set to 1.0, and because of that I can not trigger manually animateTo
anymore. My event is immediately overwritten by one of those events from stuck animation.
I was able to somewhat fix it by having touchUp: 'stop'
for the cost of having my screen in unwanted state, but I would really like my animation to autocomplete properly. 🌵
Here is my Transitions
block if it helps.
Transitions: {
default: {
from: 'start',
to: 'end',
duration: 800,
onSwipe: {
anchor: 'myAnchor',
side: 'middle',
touchUp: 'autocomplete',
mode: 'velocity'
},
}
I am trying to perform an action when a Transition contained in my fragment's MotionLayout has completed.
To do so, I am using a TransitionListener and invoke the required action in
onTransactionCompleted()
. The transition uses an OnSwipe action and has autoCompleteMode set to spring.What I'm seeing is that if I complete the swipe gesture with my finger down the whole time, I can see events firing for onTransitionChange() throughout and then eventually an
onTransitionCompleted()
call. However.... if I allow the 'spring' to autocomplete the animation for me, I see theonTransitionChange()
events stop firing at the progress point where i lifted my finger andonTransitionCompleted()
is never called. The animation itself is completing fine - it just seems that the TransitionListener events do not fire during the autocomplete phase of the transition. Once the animation has completed, if i drag the target view a little further, the events kick in again and I seeonTransitionCompleted()
call fire.I found the below issue which sounds like this may have been tracked and resolved previously but has since regressed: https://issuetracker.google.com/issues/149423772
Some code snippets:
Listener in fragment:
Relevant Transition from my motion scene:
As it stands I can't find a way to trigger the action when my transition has completed without the user having dragged 100% of the way through the swipe. Any help much appreciated!
Extra info:
<OnClick>
withclickAction="transitionToEnd"
instead of the<OnSwipe>
.