Bug 935628 - Animate toolbar with translation instead of scroll (r=sriram)
☠☠ backed out by 0053063dd872 ☠ ☠
authorLucas Rocha <lucasr@mozilla.com>
Mon, 11 Nov 2013 18:33:45 +0000
changeset 154353 f16921967806d5dfd9e40dae2c5c04a14f550d8a
parent 154352 3e98116d9d408cc40f83caadefc531a34bd436d2
child 154354 da1a4740a72209c41f0314d6a45311e279d9dee1
push id3458
push userlrocha@mozilla.com
push dateMon, 11 Nov 2013 18:34:25 +0000
treeherderfx-team@5fdcf5a9697f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram
bugs935628
milestone28.0a1
Bug 935628 - Animate toolbar with translation instead of scroll (r=sriram)
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1,16 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.animation.PropertyAnimator;
+import org.mozilla.gecko.animation.ViewHelper;
 import org.mozilla.gecko.db.BrowserContract.Combined;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.favicons.Favicons;
 import org.mozilla.gecko.favicons.OnFaviconLoadedListener;
 import org.mozilla.gecko.favicons.LoadFaviconTask;
 import org.mozilla.gecko.gfx.BitmapUtils;
 import org.mozilla.gecko.gfx.GeckoLayerClient;
 import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
@@ -655,17 +656,17 @@ abstract public class BrowserApp extends
         } else {
             // Immediately show the toolbar when disabling the dynamic
             // toolbar.
             if (mLayerView != null) {
                 mLayerView.getLayerClient().setOnMetricsChangedListener(null);
             }
             mHomePagerContainer.setPadding(0, 0, 0, 0);
             if (mBrowserToolbar != null) {
-                mBrowserToolbar.scrollTo(0, 0);
+                ViewHelper.setTranslationY(mBrowserToolbar, 0);
             }
         }
 
         refreshToolbarHeight();
     }
 
     private boolean isDynamicToolbarEnabled() {
         return mDynamicToolbarEnabled && !mAccessibilityEnabled;
@@ -913,17 +914,17 @@ abstract public class BrowserApp extends
         } else {
             mDynamicToolbarCanScroll = true;
         }
 
         final View toolbarLayout = mBrowserToolbar;
         final int marginTop = Math.round(aMetrics.marginTop);
         ThreadUtils.postToUiThread(new Runnable() {
             public void run() {
-                toolbarLayout.scrollTo(0, toolbarLayout.getHeight() - marginTop);
+                ViewHelper.setTranslationY(toolbarLayout, marginTop - toolbarLayout.getHeight());
             }
         });
 
         if (mFormAssistPopup != null)
             mFormAssistPopup.onMetricsChanged(aMetrics);
     }
 
     @Override