Commit 247490c1 authored by Melissa Zhang's avatar Melissa Zhang Committed by Chromium LUCI CQ

[Sharesheet] Fix scale animation.

Scale animation not always completing. Update layer after setting
transition to fix issue.

Bug: 1152651
Change-Id: I4785b5b5da3f8bff19d9076ce517f16b2001af56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2557823Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833037}
parent 6ec0ee06
......@@ -322,19 +322,22 @@ void SharesheetBubbleView::ShowActionView() {
share_action_scoped_settings->SetPreemptionStrategy(
ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
// |share_action_view_| scale & opacity fade in.
// |share_action_view_| scale fade in.
share_action_scoped_settings->SetTransitionDuration(kSlowAnimateTime);
share_action_scoped_settings->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN_2);
// Set##name kicks off the animation with the TransitionDuration and
// TweenType currently set. See ui/compositor/layer_animator.cc Set##name.
share_action_view_layer->SetTransform(gfx::Transform());
// |share_action_view_| opacity fade in.
share_action_scoped_settings->SetTransitionDuration(kQuickAnimateTime);
share_action_scoped_settings->SetTweenType(gfx::Tween::Type::LINEAR);
share_action_view_layer->SetOpacity(1.0f);
// Delay |share_action_view_| animate so that we can see |main_view_| fade out
// first.
share_action_view_layer->GetAnimator()->SchedulePauseForProperties(
kAnimateDelay, ui::LayerAnimationElement::TRANSFORM |
ui::LayerAnimationElement::OPACITY);
share_action_view_layer->SetOpacity(1.0f);
share_action_view_layer->SetTransform(gfx::Transform());
}
void SharesheetBubbleView::ResizeBubble(const int& width, const int& height) {
......
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