Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: ui/views/animation/ink_drop_animation_controller_impl.cc

Issue 1924663007: Expand the Material Design hover as it fades out when a ripple is triggered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/ink_drop_animation_controller_impl.h ('k') | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_animation_controller_impl.cc
diff --git a/ui/views/animation/ink_drop_animation_controller_impl.cc b/ui/views/animation/ink_drop_animation_controller_impl.cc
index 963440d909e6478c60690c7374745207bc219dea..d28a280868bca12e92ff55b783360651ff2fbbaa 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl.cc
+++ b/ui/views/animation/ink_drop_animation_controller_impl.cc
@@ -29,7 +29,7 @@ const int kHoverFadeInAfterAnimationDurationInMs = 250;
// The duration, in milliseconds, of the hover state fade out animation when it
// is triggered by an ink drop ripple animation starting.
-const int kHoverFadeOutBeforeAnimationDurationInMs = 300;
+const int kHoverFadeOutBeforeAnimationDurationInMs = 120;
// The amount of time in milliseconds that |hover_| should delay after a ripple
// animation before fading in.
@@ -85,7 +85,8 @@ void InkDropAnimationControllerImpl::AnimateToState(
if (ink_drop_state != views::InkDropState::HIDDEN) {
SetHoveredInternal(false, base::TimeDelta::FromMilliseconds(
- kHoverFadeOutBeforeAnimationDurationInMs));
+ kHoverFadeOutBeforeAnimationDurationInMs),
+ true);
}
ink_drop_animation_->AnimateToState(ink_drop_state);
@@ -96,7 +97,7 @@ void InkDropAnimationControllerImpl::SnapToActivated() {
if (!ink_drop_animation_)
CreateInkDropAnimation();
- SetHoveredInternal(false, base::TimeDelta());
+ SetHoveredInternal(false, base::TimeDelta(), false);
ink_drop_animation_->SnapToActivated();
}
@@ -107,7 +108,8 @@ void InkDropAnimationControllerImpl::SetHovered(bool is_hovered) {
is_hovered ? base::TimeDelta::FromMilliseconds(
kHoverFadeInFromUserInputDurationInMs)
: base::TimeDelta::FromMilliseconds(
- kHoverFadeOutFromUserInputDurationInMs));
+ kHoverFadeOutFromUserInputDurationInMs),
+ false);
}
void InkDropAnimationControllerImpl::DestroyHiddenTargetedAnimations() {
@@ -175,7 +177,8 @@ void InkDropAnimationControllerImpl::InkDropAnimationEnded(
void InkDropAnimationControllerImpl::SetHoveredInternal(
bool is_hovered,
- base::TimeDelta animation_duration) {
+ base::TimeDelta animation_duration,
+ bool explode) {
StopHoverAfterAnimationTimer();
if (IsHoverFadingInOrVisible() == is_hovered)
@@ -186,7 +189,7 @@ void InkDropAnimationControllerImpl::SetHoveredInternal(
if (hover_ && !IsVisible())
hover_->FadeIn(animation_duration);
} else {
- hover_->FadeOut(animation_duration);
+ hover_->FadeOut(animation_duration, explode);
}
}
@@ -210,7 +213,8 @@ void InkDropAnimationControllerImpl::StopHoverAfterAnimationTimer() {
void InkDropAnimationControllerImpl::HoverAfterAnimationTimerFired() {
SetHoveredInternal(true, base::TimeDelta::FromMilliseconds(
- kHoverFadeInAfterAnimationDurationInMs));
+ kHoverFadeInAfterAnimationDurationInMs),
+ true);
hover_after_animation_timer_.reset();
}
« no previous file with comments | « ui/views/animation/ink_drop_animation_controller_impl.h ('k') | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698