Skip to content

Commit

Permalink
[RSearches] Only skip the animation for the in bar Related Searches
Browse files Browse the repository at this point in the history
Only skip the animatePanelToState for the in bar Related Searches
animation. The previous fix https://crrev.com/c/3211433 skip in too many
conditions, this fix only skip in one condition.

Bug: 1258274
Change-Id: If1bb7157fe4898acc0fb0303bf9c3785b4ad7df3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3215371
Commit-Queue: Gang Wu <[email protected]>
Reviewed-by: Donn Denman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#930274}
  • Loading branch information
Gang Wu authored and Chromium LUCI CQ committed Oct 11, 2021
1 parent d82829c commit 8b9a255
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,13 @@ private void updateSearchBarTextOpacity(float percentage) {
mSearchBarTermOpacity = fadingInPercentage;
}

/**
* @return Whether the animation for the in bar related searches animation is running.
*/
boolean inBarRelatedSearchesAnimationIsRunning() {
return mInBarRelatedSearchesAnimation != null && mInBarRelatedSearchesAnimation.isRunning();
}

/** Animates showing Related Searches in the bottom part of the Bar. */
void animateInBarRelatedSearches(boolean shouldGrowNotShrink) {
if (mInBarRelatedSearchesAnimation != null && mInBarRelatedSearchesAnimation.isRunning()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ protected void onHeightAnimationFinished() {
@Override
protected void animatePanelToState(
@Nullable @PanelState Integer state, @StateChangeReason int reason, long duration) {
if (state == getPanelState()) return;
// If the in bar chip showing animation is running, do not run the new panel animation.
if (getSearchBarControl().inBarRelatedSearchesAnimationIsRunning()) return;
super.animatePanelToState(state, reason, duration);
}

Expand Down

0 comments on commit 8b9a255

Please sign in to comment.