Bug 1364194 - Refresh static toolbar snapshot when page width changes r=botond,jchen

MozReview-Commit-ID: HaQo66j640g
This commit is contained in:
Randall Barker 2017-05-11 10:40:41 -07:00
Родитель 84cf5d5cd4
Коммит 962808afbf
2 изменённых файлов: 12 добавлений и 3 удалений

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

@ -278,10 +278,15 @@ AndroidDynamicToolbarAnimator::SetCompositionSize(ScreenIntSize aSize)
return false;
}
ScreenIntCoord prevHeight = mCompositorCompositionSize.height;
ScreenIntSize prevSize = mCompositorCompositionSize;
mCompositorCompositionSize = aSize;
if (prevHeight != aSize.height) {
// The width has changed so the static snapshot needs to be updated
if ((prevSize.width != aSize.width) && (mToolbarState != eToolbarVisible)) {
PostMessage(STATIC_TOOLBAR_NEEDS_UPDATE);
}
if (prevSize.height != aSize.height) {
UpdateControllerCompositionHeight(aSize.height);
UpdateFixedLayerMargins();
}

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

@ -1712,7 +1712,11 @@ public class BrowserApp extends GeckoApp
if (aShow) {
mBrowserChrome.setVisibility(View.VISIBLE);
} else {
mBrowserChrome.setVisibility(View.GONE);
// The chrome needs to be INVISIBLE instead of GONE so that
// it will continue update when the layout changes. This
// ensures the bitmap generated for the static toolbar
// snapshot is the correct size.
mBrowserChrome.setVisibility(View.INVISIBLE);
}
super.toggleChrome(aShow);