Skip to content

Commit

Permalink
[RSearches] Set the status correctly after the panel animation is done
Browse files Browse the repository at this point in the history
We do not need to check the height when set the panel's status, since
onHeightAnimationFinished is only called when the animation is finished,
not canceled.

(cherry picked from commit 40afecd)

Bug: 1316167
Change-Id: I124a151f44bb4f2a591a343fb9549a70f1e622fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593964
Reviewed-by: Donn Denman <donnd@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#994335}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3606139
Auto-Submit: Gang Wu <gangwu@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5005@{#205}
Cr-Branched-From: 5b4d945-refs/heads/main@{#992738}
  • Loading branch information
Gang Wu authored and Chromium LUCI CQ committed Apr 27, 2022
1 parent 3638d12 commit ef20912
Showing 1 changed file with 5 additions and 9 deletions.
Expand Up @@ -382,17 +382,13 @@ public void onEnd(Animator animation) {

/**
* Called when layout-specific actions are needed after the animation finishes.
* This method should only be called when the animation ends normally and not when it is
* canceled.
*/
protected void onHeightAnimationFinished() {
// If animating to a particular PanelState, and after completing
// resizing the Panel to its desired state, then the Panel's state
// should be updated. This method also is called when an animation
// is cancelled (which can happen by a subsequent gesture while
// an animation is happening). That's why the actual height should
// be checked.
if (mAnimatingState != null && mAnimatingState != PanelState.UNDEFINED
&& MathUtils.areFloatsEqual(
getHeight(), getPanelHeightFromState(mAnimatingState))) {
// If animating to a particular PanelState, and after completing resizing the Panel to its
// desired state, then the Panel's state should be updated.
if (mAnimatingState != null && mAnimatingState != PanelState.UNDEFINED) {
setPanelState(mAnimatingState, mAnimatingStateReason);
}

Expand Down

0 comments on commit ef20912

Please sign in to comment.