Skip to content

Commit def80c5

Browse files
pubiqqpekingme
authored andcommitted
[HideViewOnScrollBehavior] Fix the target position of the view when sliding it off the screen without animation
Resolves #4767 GIT_ORIGIN_REV_ID=2e119cfc7fac044568f4116366a0fc20d2ef9480 PiperOrigin-RevId: 756858576
1 parent 65e5f1a commit def80c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/java/com/google/android/material/behavior/HideViewOnScrollBehavior.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ public void slideOut(@NonNull V child, boolean animate) {
351351
child.clearAnimation();
352352
}
353353
updateCurrentState(child, STATE_SCROLLED_OUT);
354-
int targetTranslationY = size + additionalHiddenOffset;
354+
int targetTranslation = size + additionalHiddenOffset;
355355
if (animate) {
356-
animateChildTo(child, targetTranslationY, exitAnimDuration, exitAnimInterpolator);
356+
animateChildTo(child, targetTranslation, exitAnimDuration, exitAnimInterpolator);
357357
} else {
358-
child.setTranslationY(targetTranslationY);
358+
hideOnScrollViewDelegate.setViewTranslation(child, targetTranslation);
359359
}
360360
}
361361

0 commit comments

Comments
 (0)