Bug 893279 - Account for edit container in forward button animation (r=wesj)
authorLucas Rocha <lucasr@mozilla.com>
Mon, 29 Jul 2013 18:31:38 +0100
changeset 143472 a7c85fd8b5c7bda742173c9e1d342fecc4b4c33f
parent 143471 69bee1d290b7301506b4c2ae2a2965961ee89d71
child 143473 ce8fb2c1f618a43d0fdd01307a587b5009299dae
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs893279
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 893279 - Account for edit container in forward button animation (r=wesj)
mobile/android/base/BrowserToolbar.java
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -1533,41 +1533,49 @@ public class BrowserToolbar extends Geck
             @Override
             public void onPropertyAnimationStart() {
                 if (!enabled) {
                     // Set the margin before the transition when hiding the forward button. We
                     // have to do this so that the favicon isn't clipped during the transition
                     ViewGroup.MarginLayoutParams layoutParams =
                         (ViewGroup.MarginLayoutParams)mUrlDisplayContainer.getLayoutParams();
                     layoutParams.leftMargin = 0;
-                    mUrlDisplayContainer.requestLayout();
+
+                    // Do the same on the URL edit container
+                    layoutParams = (ViewGroup.MarginLayoutParams)mUrlEditContainer.getLayoutParams();
+                    layoutParams.leftMargin = 0;
+
+                    requestLayout();
                     // Note, we already translated the favicon, site security, and text field
                     // in prepareForwardAnimation, so they should appear to have not moved at
                     // all at this point.
                 }
             }
 
             @Override
             public void onPropertyAnimationEnd() {
                 if (enabled) {
                     ViewGroup.MarginLayoutParams layoutParams =
                         (ViewGroup.MarginLayoutParams)mUrlDisplayContainer.getLayoutParams();
                     layoutParams.leftMargin = mUrlBarViewOffset;
 
+                    layoutParams = (ViewGroup.MarginLayoutParams)mUrlEditContainer.getLayoutParams();
+                    layoutParams.leftMargin = mUrlBarViewOffset;
+
                     ViewHelper.setTranslationX(mTitle, 0);
                     ViewHelper.setTranslationX(mFavicon, 0);
                     ViewHelper.setTranslationX(mSiteSecurity, 0);
                 }
 
                 ViewGroup.MarginLayoutParams layoutParams =
                     (ViewGroup.MarginLayoutParams)mForward.getLayoutParams();
                 layoutParams.leftMargin = mDefaultForwardMargin + (mForward.isEnabled() ? width : 0);
                 ViewHelper.setTranslationX(mForward, 0);
 
-                mUrlDisplayContainer.requestLayout();
+                requestLayout();
                 mForwardAnim = null;
             }
         });
 
         prepareForwardAnimation(mForwardAnim, enabled, width);
         mForwardAnim.start();
     }
 
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -62,19 +62,18 @@
                                   android:layout_centerVertical="true"
                                   android:padding="13dp"
                                   android:src="@drawable/ic_menu_back"
                                   android:contentDescription="@string/back"
                                   android:background="@drawable/url_bar_nav_button"/>
 
     <LinearLayout android:id="@+id/url_edit_container"
                   style="@style/UrlBar.Button"
-                  android:layout_marginLeft="4dp"
-                  android:layout_marginRight="4dp"
-                  android:paddingLeft="8dp"
+                  android:paddingLeft="12dp"
+                  android:paddingRight="4dp"
                   android:visibility="gone"
                   android:orientation="horizontal"
                   android:layout_toRightOf="@id/back"
                   android:layout_toLeftOf="@id/menu_items">
 
         <view class="org.mozilla.gecko.CustomEditText"
               android:id="@+id/url_edit_text"
               style="@style/UrlBar.Button"