Merge "Revert "Revert "RootViewImpl: Fix measure size hint for WRAP_CONTENT windows""" into rvc-dev am: 84d1c3c618 am: 86b1664a98
Change-Id: Idc6bb002bd48567c617f4b177b2370b3f8761f16
This commit is contained in:
@@ -2347,9 +2347,18 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mDisplay.getRealSize(size);
|
mDisplay.getRealSize(size);
|
||||||
desiredWindowWidth = size.x;
|
desiredWindowWidth = size.x;
|
||||||
desiredWindowHeight = size.y;
|
desiredWindowHeight = size.y;
|
||||||
|
} else if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
|| lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
|
||||||
|
// For wrap content, we have to remeasure later on anyways. Use size consistent with
|
||||||
|
// below so we get best use of the measure cache.
|
||||||
|
desiredWindowWidth = dipToPx(config.screenWidthDp);
|
||||||
|
desiredWindowHeight = dipToPx(config.screenHeightDp);
|
||||||
} else {
|
} else {
|
||||||
desiredWindowWidth = mWinFrame.width();
|
// After addToDisplay, the frame contains the frameHint from window manager, which
|
||||||
desiredWindowHeight = mWinFrame.height();
|
// for most windows is going to be the same size as the result of relayoutWindow.
|
||||||
|
// Using this here allows us to avoid remeasuring after relayoutWindow
|
||||||
|
desiredWindowWidth = frame.width();
|
||||||
|
desiredWindowHeight = frame.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We used to use the following condition to choose 32 bits drawing caches:
|
// We used to use the following condition to choose 32 bits drawing caches:
|
||||||
|
|||||||
Reference in New Issue
Block a user