Commit d9a3c865 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Use correct fade animation when entering overview from home

And add some delay before stating opacity animation.

BUG=1020735

Change-Id: I5fabd3923c55ecf969727b2887e32dd938873b41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895080Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712347}
parent 5a934f16
......@@ -457,11 +457,16 @@ void OverviewItem::SetBounds(const gfx::RectF& target_bounds,
overview_session_->enter_exit_overview_type() ==
OverviewSession::EnterExitOverviewType::kSlideInEnter;
if (!slide_in) {
FadeInWidgetAndMaybeSlideOnEnter(
item_widget_.get(),
OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN,
/*slide=*/false,
/*observe=*/true);
// If entering from home launcher, use the home specific (fade)
// animation.
OverviewAnimationType fade_animation =
animation_type == OVERVIEW_ANIMATION_ENTER_FROM_HOME_LAUNCHER
? animation_type
: OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN;
FadeInWidgetAndMaybeSlideOnEnter(item_widget_.get(), fade_animation,
/*slide=*/false,
/*observe=*/true);
}
// Update the item header visibility immediately if entering from home
......
......@@ -158,10 +158,14 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings(
animation_settings_->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
animation_settings_->SetPreemptionStrategy(
ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
// Add animation delay when entering from home launcher using slide
// animation (which is the case if homerview gesture is not enabled, in
// which case overview will fade in without sliding).
if (!features::IsHomerviewGestureEnabled()) {
// Add animation delay when entering from home launcher.
// Delay transform only when using slide animation (which is used
// if kHomerviewGesture is not enabled), as otherwise the overview item
// will only fade in.
if (features::IsHomerviewGestureEnabled()) {
animator->SchedulePauseForProperties(
kFromHomeLauncherDelay, ui::LayerAnimationElement::OPACITY);
} else {
animator->SchedulePauseForProperties(
kFromHomeLauncherDelay, ui::LayerAnimationElement::OPACITY |
ui::LayerAnimationElement::TRANSFORM);
......
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