LayoutLib: Fix some rendering issues
Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
This commit is contained in:
@@ -413,6 +413,9 @@ public final class BridgeContext extends Activity {
|
||||
ResourceValue item = mRenderResources.findResValue(customStyle,
|
||||
false /*forceFrameworkOnly*/);
|
||||
|
||||
// resolve it in case it links to something else
|
||||
item = mRenderResources.resolveResValue(item);
|
||||
|
||||
if (item instanceof StyleResourceValue) {
|
||||
defStyleValues = (StyleResourceValue)item;
|
||||
}
|
||||
|
||||
@@ -361,9 +361,6 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
|
||||
|
||||
View view = mInflater.inflate(mBlockParser, mViewRoot);
|
||||
|
||||
// post-inflate process. For now this supports TabHost/TabWidget
|
||||
postInflateProcess(view, mParams.getProjectCallback());
|
||||
|
||||
Fragment_Delegate.setProjectCallback(null);
|
||||
|
||||
// set the AttachInfo on the root view.
|
||||
@@ -375,6 +372,9 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
|
||||
info.mHardwareAccelerated = false;
|
||||
mViewRoot.dispatchAttachedToWindow(info, 0);
|
||||
|
||||
// post-inflate process. For now this supports TabHost/TabWidget
|
||||
postInflateProcess(view, mParams.getProjectCallback());
|
||||
|
||||
// get the background drawable
|
||||
if (mWindowBackground != null) {
|
||||
Drawable d = ResourceHelper.getDrawable(mWindowBackground,
|
||||
@@ -461,13 +461,14 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
|
||||
// remeasure with the size we need
|
||||
// This must always be done before the call to layout
|
||||
w_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenWidth, MeasureSpec.EXACTLY);
|
||||
h_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenHeight,
|
||||
MeasureSpec.EXACTLY);
|
||||
h_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenHeight, MeasureSpec.EXACTLY);
|
||||
mViewRoot.measure(w_spec, h_spec);
|
||||
|
||||
// now do the layout.
|
||||
mViewRoot.layout(0, 0, mMeasuredScreenWidth, mMeasuredScreenHeight);
|
||||
|
||||
mViewRoot.mAttachInfo.mTreeObserver.dispatchOnPreDraw();
|
||||
|
||||
// draw the views
|
||||
// create the BufferedImage into which the layout will be rendered.
|
||||
boolean newImage = false;
|
||||
|
||||
Reference in New Issue
Block a user