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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 562373002: Change keyboard animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 6c02069e7ff6e761199c30be5780802c71a78726..e8f3fb5cee30fc54627da2e3e4fcc9eb10b24681 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -40,11 +40,13 @@ namespace {
const int kHideKeyboardDelayMs = 100;
// The virtual keyboard show/hide animation duration.
-const int kAnimationDurationMs = 200;
+const int kShowAnimationDurationMs = 350;
+const int kHideAnimationDurationMs = 100;
// The opacity of virtual keyboard container when show animation starts or
// hide animation finishes.
-const float kAnimationStartOrAfterHideOpacity = 0.2f;
+// TODO(rsadam@): Investigate why setting this to zero crashes.
+const float kAnimationStartOrAfterHideOpacity = 0.01f;
// Event targeter for the keyboard container.
class KeyboardContainerTargeter : public wm::MaskedWindowTargeter {
@@ -364,9 +366,9 @@ void KeyboardController::HideKeyboard(HideReason reason) {
container_animator->AddObserver(animation_observer_.get());
ui::ScopedLayerAnimationSettings settings(container_animator);
- settings.SetTweenType(gfx::Tween::EASE_OUT);
+ settings.SetTweenType(gfx::Tween::FAST_OUT_LINEAR_IN);
settings.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kAnimationDurationMs));
+ base::TimeDelta::FromMilliseconds(kHideAnimationDurationMs));
gfx::Transform transform;
transform.Translate(0, proxy_->GetKeyboardWindow()->bounds().height());
container_->SetTransform(transform);
@@ -542,9 +544,9 @@ void KeyboardController::ShowKeyboardInternal() {
// ShowKeyboardContainer with these settings. The container should become
// visible immediately.
ui::ScopedLayerAnimationSettings settings(container_animator);
- settings.SetTweenType(gfx::Tween::EASE_IN);
+ settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN);
settings.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kAnimationDurationMs));
+ base::TimeDelta::FromMilliseconds(kShowAnimationDurationMs));
container_->SetTransform(gfx::Transform());
container_->layer()->SetOpacity(1.0);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698