Skip to content

Commit

Permalink
[Search] Add start delay to scrim animation during SearchBar to Searc…
Browse files Browse the repository at this point in the history
…hView expand to reduce visual noise

PiperOrigin-RevId: 623875803
  • Loading branch information
dsn5ft authored and imhappi committed Apr 11, 2024
1 parent a968296 commit b77b141
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class SearchViewAnimationHelper {
private static final long SHOW_CONTENT_ALPHA_DURATION_MS = 150;
private static final long SHOW_CONTENT_ALPHA_START_DELAY_MS = 75;
private static final long SHOW_CONTENT_SCALE_DURATION_MS = SHOW_DURATION_MS;
private static final long SHOW_SCRIM_ALPHA_DURATION_MS = 100;

// Constants for hide collapse animation
private static final long HIDE_DURATION_MS = 250;
Expand Down Expand Up @@ -328,6 +329,7 @@ private Animator getScrimAlphaAnimator(boolean show) {

ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
animator.setDuration(show ? SHOW_DURATION_MS : HIDE_DURATION_MS);
animator.setStartDelay(show ? SHOW_SCRIM_ALPHA_DURATION_MS : 0);
animator.setInterpolator(ReversableAnimatedValueInterpolator.of(show, interpolator));
animator.addUpdateListener(MultiViewUpdateListener.alphaListener(scrim));
return animator;
Expand Down

0 comments on commit b77b141

Please sign in to comment.