Commit f69055b7 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

Do not play assistant end animation when hiding

When assistant is started and triggered hiding animation, during a very
short time window if the user lifted their finger, we would try to play
end animation.  We should avoid doing that.

BUG=b:67496461
TEST=build and flash locally, see animation playing normally

Change-Id: Idf52f692edd9d05b16ad48687384d291b208a42e
Reviewed-on: https://chromium-review.googlesource.com/748268Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513208}
parent f438e6d4
...@@ -851,8 +851,9 @@ void VoiceInteractionOverlay::WaitingAnimation() { ...@@ -851,8 +851,9 @@ void VoiceInteractionOverlay::WaitingAnimation() {
} }
void VoiceInteractionOverlay::EndAnimation() { void VoiceInteractionOverlay::EndAnimation() {
if (IsBursting()) { if (IsBursting() || IsHidden()) {
// Too late, user action already fired, we have to finish what's started. // Too late, user action already fired, we have to finish what's started.
// Or the widget has already been hidden, no need to play the end animation.
return; return;
} }
......
...@@ -33,6 +33,7 @@ class ASH_EXPORT VoiceInteractionOverlay : public views::View { ...@@ -33,6 +33,7 @@ class ASH_EXPORT VoiceInteractionOverlay : public views::View {
return AnimationState::BURSTING == animation_state_; return AnimationState::BURSTING == animation_state_;
} }
bool IsWaiting() const { return AnimationState::WAITING == animation_state_; } bool IsWaiting() const { return AnimationState::WAITING == animation_state_; }
bool IsHidden() const { return AnimationState::HIDDEN == animation_state_; }
private: private:
enum class AnimationState { enum class AnimationState {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment