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

Side by Side Diff: ash/shelf/voice_interaction_overlay.cc

Issue 2947843005: Update voice interaction animation (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/animation/tween.h » ('j') | ui/gfx/animation/tween.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/shelf/voice_interaction_overlay.h" 5 #include "ash/shelf/voice_interaction_overlay.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 transform.Translate(center.x() - kRippleCircleStartRadiusDip, 374 transform.Translate(center.x() - kRippleCircleStartRadiusDip,
375 center.y() - kRippleCircleStartRadiusDip); 375 center.y() - kRippleCircleStartRadiusDip);
376 transform.Scale(scale_factor, scale_factor); 376 transform.Scale(scale_factor, scale_factor);
377 377
378 { 378 {
379 ui::ScopedLayerAnimationSettings settings(ripple_layer_->GetAnimator()); 379 ui::ScopedLayerAnimationSettings settings(ripple_layer_->GetAnimator());
380 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: 380 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy::
381 IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 381 IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
382 settings.SetTransitionDuration( 382 settings.SetTransitionDuration(
383 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs)); 383 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs));
384 settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); 384 settings.SetTweenType(gfx::Tween::SLOW_OUT_LINEAR_IN);
385 385
386 ripple_layer_->SetTransform(transform); 386 ripple_layer_->SetTransform(transform);
387 387
388 settings.SetTransitionDuration( 388 settings.SetTransitionDuration(
389 base::TimeDelta::FromMilliseconds(kRippleOpacityRetractDurationMs)); 389 base::TimeDelta::FromMilliseconds(kRippleOpacityRetractDurationMs));
390 ripple_layer_->SetOpacity(0); 390 ripple_layer_->SetOpacity(0);
391 } 391 }
392 392
393 // Setup icon animation. 393 // Setup icon animation.
394 transform.MakeIdentity(); 394 transform.MakeIdentity();
395 395
396 transform.Translate(center.x() - kIconStartSizeDip / 2.f, 396 transform.Translate(center.x() - kIconStartSizeDip / 2.f,
397 center.y() - kIconStartSizeDip / 2.f); 397 center.y() - kIconStartSizeDip / 2.f);
398 398
399 scale_factor = kIconStartSizeDip / kIconInitSizeDip; 399 scale_factor = kIconStartSizeDip / kIconInitSizeDip;
400 transform.Scale(scale_factor, scale_factor); 400 transform.Scale(scale_factor, scale_factor);
401 401
402 { 402 {
403 ui::ScopedLayerAnimationSettings settings(icon_layer_->GetAnimator()); 403 ui::ScopedLayerAnimationSettings settings(icon_layer_->GetAnimator());
404 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: 404 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy::
405 IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 405 IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
406 settings.SetTransitionDuration( 406 settings.SetTransitionDuration(
407 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs)); 407 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs));
408 settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); 408 settings.SetTweenType(gfx::Tween::SLOW_OUT_LINEAR_IN);
409 409
410 icon_layer_->SetTransform(transform); 410 icon_layer_->SetTransform(transform);
411 icon_layer_->SetOpacity(0); 411 icon_layer_->SetOpacity(0);
412 } 412 }
413 413
414 // Setup background animation. 414 // Setup background animation.
415 transform.MakeIdentity(); 415 transform.MakeIdentity();
416 416
417 transform.Translate(center.x() - kBackgroundStartSizeDip / 2.f, 417 transform.Translate(center.x() - kBackgroundStartSizeDip / 2.f,
418 center.y() - kBackgroundStartSizeDip / 2.f); 418 center.y() - kBackgroundStartSizeDip / 2.f);
419 419
420 scale_factor = kBackgroundStartSizeDip / kBackgroundInitSizeDip; 420 scale_factor = kBackgroundStartSizeDip / kBackgroundInitSizeDip;
421 transform.Scale(scale_factor, scale_factor); 421 transform.Scale(scale_factor, scale_factor);
422 422
423 { 423 {
424 ui::ScopedLayerAnimationSettings settings(background_layer_->GetAnimator()); 424 ui::ScopedLayerAnimationSettings settings(background_layer_->GetAnimator());
425 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: 425 settings.SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy::
426 IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 426 IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
427 settings.SetTransitionDuration( 427 settings.SetTransitionDuration(
428 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs)); 428 base::TimeDelta::FromMilliseconds(kFullRetractDurationMs));
429 settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); 429 settings.SetTweenType(gfx::Tween::SLOW_OUT_LINEAR_IN);
430 430
431 background_layer_->SetTransform(transform); 431 background_layer_->SetTransform(transform);
432 background_layer_->SetOpacity(0); 432 background_layer_->SetOpacity(0);
433 } 433 }
434 } 434 }
435 435
436 } // namespace ash 436 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/animation/tween.h » ('j') | ui/gfx/animation/tween.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698