Added ability to provide reach ratio speed to swipe.

This commit is contained in:
23rd 2025-03-16 19:00:59 +03:00
parent ad9106b815
commit c29d78ac0d
2 changed files with 7 additions and 2 deletions

View file

@ -262,7 +262,9 @@ void SetupSwipeHandler(
animationReachCallback,
0.,
1.,
kBounceDuration);
state->finishByTopData.reachRatioDuration
? state->finishByTopData.reachRatioDuration
: kBounceDuration);
base::Platform::Haptic();
} else if (state->reached
&& ratio < kResetReachedOn) {
@ -272,7 +274,9 @@ void SetupSwipeHandler(
animationReachCallback,
1.,
0.,
kBounceDuration);
state->finishByTopData.reachRatioDuration
? state->finishByTopData.reachRatioDuration
: kBounceDuration);
}
state->reached = false;
}

View file

@ -22,6 +22,7 @@ struct SwipeHandlerFinishData {
Fn<void(void)> callback;
int64 msgBareId = 0;
float64 speedRatio = 1.0;
crl::time reachRatioDuration = 0;
bool keepRatioWithinRange = false;
bool provideReachOutRatio = false;
};