Bug 893279 - Account for edit container in forward button animation (r=wesj)

This commit is contained in:
Lucas Rocha 2013-07-29 18:31:38 +01:00
parent f54d970c35
commit 74eb54b218
2 changed files with 12 additions and 5 deletions

View File

@ -1538,7 +1538,12 @@ public class BrowserToolbar extends GeckoRelativeLayout
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.
@ -1552,6 +1557,9 @@ public class BrowserToolbar extends GeckoRelativeLayout
(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);
@ -1562,7 +1570,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
layoutParams.leftMargin = mDefaultForwardMargin + (mForward.isEnabled() ? width : 0);
ViewHelper.setTranslationX(mForward, 0);
mUrlDisplayContainer.requestLayout();
requestLayout();
mForwardAnim = null;
}
});

View File

@ -67,9 +67,8 @@
<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"