Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33758ef8 authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

LayoutLib: Fix some rendering issues

Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
parent a4747d53
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
            }
+6 −5
Original line number Diff line number Diff line
@@ -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;