Merge "Call BackCallback.setTriggerBack immediately on ACTION_UP" into udc-dev

This commit is contained in:
Marvin Bernal
2023-05-15 21:24:19 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 3 deletions

View File

@@ -323,7 +323,6 @@ class BackPanelController internal constructor(
if (isFlungAwayFromEdge(endX = event.x) ||
previousXTranslation > params.staticTriggerThreshold
) {
updateArrowState(GestureState.ACTIVE)
updateArrowState(GestureState.FLUNG)
} else {
updateArrowState(GestureState.CANCELLED)
@@ -331,8 +330,11 @@ class BackPanelController internal constructor(
}
GestureState.INACTIVE -> {
if (isFlungAwayFromEdge(endX = event.x)) {
// This is called outside of updateArrowState so that
// BackAnimationController can immediately evaluate state
// instead of after the flung delay
backCallback.setTriggerBack(true)
mainHandler.postDelayed(MIN_DURATION_INACTIVE_BEFORE_FLUNG_ANIMATION) {
updateArrowState(GestureState.ACTIVE)
updateArrowState(GestureState.FLUNG)
}
} else {

View File

@@ -132,7 +132,7 @@ data class EdgePanelParams(private var resources: Resources) {
entryWidthInterpolator = PathInterpolator(.19f, 1.27f, .71f, .86f)
entryWidthTowardsEdgeInterpolator = PathInterpolator(1f, -3f, 1f, 1.2f)
activeWidthInterpolator = PathInterpolator(.56f, -0.39f, .18f, 1.46f)
activeWidthInterpolator = PathInterpolator(.7f, -0.24f, .48f, 1.21f)
arrowAngleInterpolator = entryWidthInterpolator
horizontalTranslationInterpolator = PathInterpolator(0.2f, 1.0f, 1.0f, 1.0f)
verticalTranslationInterpolator = PathInterpolator(.5f, 1.15f, .41f, .94f)