Commit afe2cfbc authored by Min Chen's avatar Min Chen Committed by Commit Bot

ash: Make power button menu animation faster.

Bug: 826063
Change-Id: I1930da3effd7952d2019e480048778075a0bcd58
Reviewed-on: https://chromium-review.googlesource.com/981686
Commit-Queue: Min Chen <minch@chromium.org>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarQiang Xu <warx@google.com>
Cr-Commit-Position: refs/heads/master@{#546960}
parent 945901d4
...@@ -72,8 +72,8 @@ class PowerButtonMenuScreenView::PowerButtonMenuBackgroundView ...@@ -72,8 +72,8 @@ class PowerButtonMenuScreenView::PowerButtonMenuBackgroundView
animation.AddObserver(this); animation.AddObserver(this);
animation.SetTweenType(show ? gfx::Tween::EASE_IN_2 animation.SetTweenType(show ? gfx::Tween::EASE_IN_2
: gfx::Tween::FAST_OUT_LINEAR_IN); : gfx::Tween::FAST_OUT_LINEAR_IN);
animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( animation.SetTransitionDuration(
PowerButtonMenuView::kAnimationTimeoutMs)); PowerButtonMenuView::kMenuAnimationDuration);
layer()->SetOpacity(show ? kPowerButtonMenuOpacity : 0.f); layer()->SetOpacity(show ? kPowerButtonMenuOpacity : 0.f);
} }
......
...@@ -55,8 +55,7 @@ void PowerButtonMenuView::ScheduleShowHideAnimation(bool show) { ...@@ -55,8 +55,7 @@ void PowerButtonMenuView::ScheduleShowHideAnimation(bool show) {
animation.AddObserver(this); animation.AddObserver(this);
animation.SetTweenType(show ? gfx::Tween::EASE_IN animation.SetTweenType(show ? gfx::Tween::EASE_IN
: gfx::Tween::FAST_OUT_LINEAR_IN); : gfx::Tween::FAST_OUT_LINEAR_IN);
animation.SetTransitionDuration( animation.SetTransitionDuration(kMenuAnimationDuration);
base::TimeDelta::FromMilliseconds(kAnimationTimeoutMs));
layer()->SetOpacity(show ? 1.0f : 0.f); layer()->SetOpacity(show ? 1.0f : 0.f);
......
...@@ -21,8 +21,9 @@ class ASH_EXPORT PowerButtonMenuView : public views::View, ...@@ -21,8 +21,9 @@ class ASH_EXPORT PowerButtonMenuView : public views::View,
public views::ButtonListener, public views::ButtonListener,
public ui::ImplicitAnimationObserver { public ui::ImplicitAnimationObserver {
public: public:
// The duration of the animation to show or hide the power button menu view. // The duration of showing or dismissing power button menu animation.
static constexpr int kAnimationTimeoutMs = 500; static constexpr base::TimeDelta kMenuAnimationDuration =
base::TimeDelta::FromMilliseconds(250);
// Distance of the menu animation transform. // Distance of the menu animation transform.
static constexpr int kMenuViewTransformDistanceDp = 16; static constexpr int kMenuViewTransformDistanceDp = 16;
......
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