Bug 846949: Cleanup browser toolbar animation. [r=lucasr]

--HG--
extra : rebase_source : ba77407efe264e20a8dfb013ee77def241042a6a
This commit is contained in:
Sriram Ramasubramanian 2013-02-27 14:18:28 -08:00
Родитель de551462db
Коммит 4523236c32
2 изменённых файлов: 16 добавлений и 11 удалений

Просмотреть файл

@ -622,7 +622,6 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
barParams.rightMargin = 0;
mAddressBarBgCurveTowards = mAddressBarBg.getCurveTowards();
mAddressBarBg.setCurveTowards(BrowserToolbarBackground.CurveTowards.NONE);
mAddressBarBg.requestLayout();
// If we don't have any menu_items, then we simply slide all elements on the
// rigth side of the toolbar out of screen.
@ -679,10 +678,13 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
proxy.setTranslationX(translation);
proxy = AnimatorProxy.create(mTabsCount);
proxy.setTranslationX(translation);
proxy = AnimatorProxy.create(mMenu);
proxy.setTranslationX(translation);
proxy = AnimatorProxy.create(mActionItemBar);
proxy.setTranslationX(translation);
if (mHasSoftMenuButton) {
proxy = AnimatorProxy.create(mMenu);
proxy.setTranslationX(translation);
}
}
// Restore opacity of content elements in the toolbar immediatelly
@ -712,13 +714,15 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
contentAnimator.attach(mTabsCount,
PropertyAnimator.Property.TRANSLATION_X,
0);
contentAnimator.attach(mMenu,
PropertyAnimator.Property.TRANSLATION_X,
0);
contentAnimator.attach(mActionItemBar,
PropertyAnimator.Property.TRANSLATION_X,
0);
if (mHasSoftMenuButton)
contentAnimator.attach(mMenu,
PropertyAnimator.Property.TRANSLATION_X,
0);
contentAnimator.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
@Override
public void onPropertyAnimationStart() {
@ -739,7 +743,6 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
MarginLayoutParams barParams = (MarginLayoutParams) mAddressBarBg.getLayoutParams();
barParams.rightMargin = mAddressBarBgRightMargin;
mAddressBarBg.setCurveTowards(mAddressBarBgCurveTowards);
mAddressBarBg.requestLayout();
// If there are action bar items in the toolbar, we have to restore the
// alignment of the entry in relation to them. mAwesomeBarParams might
@ -822,13 +825,15 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
contentAnimator.attach(mTabsCount,
PropertyAnimator.Property.TRANSLATION_X,
translation);
contentAnimator.attach(mMenu,
PropertyAnimator.Property.TRANSLATION_X,
translation);
contentAnimator.attach(mActionItemBar,
PropertyAnimator.Property.TRANSLATION_X,
translation);
if (mHasSoftMenuButton)
contentAnimator.attach(mMenu,
PropertyAnimator.Property.TRANSLATION_X,
translation);
contentAnimator.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
@Override
public void onPropertyAnimationStart() {

Просмотреть файл

@ -119,6 +119,6 @@ public class BrowserToolbarBackground extends GeckoLinearLayout
return;
mSide = side;
invalidate();
requestLayout();
}
}