Bug 1056315 - Animate tab panel header on first tabs panel open. r=nalexander

This commit is contained in:
Federico Paolinelli 2014-08-21 11:31:00 -04:00
parent 9507984a43
commit 489e95cb88

View File

@ -524,7 +524,12 @@ public class TabsPanel extends LinearLayout
final Resources resources = getContext().getResources();
final int toolbarHeight = resources.getDimensionPixelSize(R.dimen.browser_toolbar_height);
final int translationY = (mVisible ? 0 : -toolbarHeight);
animator.attach(mTabsContainer, PropertyAnimator.Property.ALPHA, 1.0f);
if (mVisible) {
ViewHelper.setTranslationY(mHeader, -toolbarHeight);
ViewHelper.setTranslationY(mTabsContainer, -toolbarHeight);
ViewHelper.setAlpha(mTabsContainer, 0.0f);
}
animator.attach(mTabsContainer, PropertyAnimator.Property.ALPHA, mVisible ? 1.0f : 0.0f);
animator.attach(mTabsContainer, PropertyAnimator.Property.TRANSLATION_Y, translationY);
animator.attach(mHeader, PropertyAnimator.Property.TRANSLATION_Y, translationY);
}