Bug 1197233 - When fullscreening a video make sure we don't show garbage in the toolbar area. r=rbarker

--HG--
extra : commitid : FC0cW3NkINy
This commit is contained in:
Kartikaya Gupta 2015-08-21 13:21:58 -04:00
parent c10cfda0d4
commit 7ec5cb2fcf
2 changed files with 14 additions and 2 deletions

View File

@ -235,9 +235,17 @@ public class DynamicToolbarAnimator {
}
IntSize getViewportSize() {
ThreadUtils.assertOnUiThread();
int viewWidth = mTarget.getView().getWidth();
int viewHeight = mTarget.getView().getHeight();
int viewHeightVisible = viewHeight - Math.round(mMaxTranslation - mToolbarTranslation);
float toolbarTranslation = mToolbarTranslation;
if (mAnimationTask != null) {
// If we have an animation going, mToolbarTranslation may be in flux
// and we should use the final value it will settle on.
toolbarTranslation = mAnimationTask.getFinalToolbarTranslation();
}
int viewHeightVisible = viewHeight - Math.round(mMaxTranslation - toolbarTranslation);
return new IntSize(viewWidth, viewHeightVisible);
}
@ -482,6 +490,10 @@ public class DynamicToolbarAnimator {
mShiftLayerView = aShiftLayerView;
}
float getFinalToolbarTranslation() {
return mEndTranslation;
}
@Override
public boolean internalRun(long timeDelta, long currentFrameStartTime) {
if (!mContinueAnimation) {

View File

@ -221,7 +221,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
}
mViewportMetrics = mViewportMetrics.setViewportSize(width, height);
if (scrollChange != null) {
mViewportMetrics = mViewportMetrics.offsetViewportBy(scrollChange.x, scrollChange.y);
mViewportMetrics = mViewportMetrics.offsetViewportByAndClamp(scrollChange.x, scrollChange.y);
}
if (mGeckoIsReady) {