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

Commit 10df650f authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

LayoutLib: add support for layout_only render.

Change-Id: I1cd791cf9560156c1ac488f8e454240c84e29cc6
parent 016d37e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge {
                Capability.UNBOUND_RENDERING,
                Capability.CUSTOM_BACKGROUND_COLOR,
                Capability.RENDER,
                Capability.LAYOUT_ONLY,
                Capability.EMBEDDED_LAYOUT,
                Capability.VIEW_MANIPULATION,
                Capability.PLAY_ANIMATION,
+48 −42
Original line number Diff line number Diff line
@@ -421,6 +421,11 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
            // now do the layout.
            mViewRoot.layout(0, 0, mMeasuredScreenWidth, mMeasuredScreenHeight);

            if (params.isLayoutOnly()) {
                // delete the canvas and image to reset them on the next full rendering
                mImage = null;
                mCanvas = null;
            } else {
                mViewRoot.mAttachInfo.mTreeObserver.dispatchOnPreDraw();

                // draw the views
@@ -471,6 +476,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
                }

                mViewRoot.draw(mCanvas);
            }

            mViewInfoList = startVisitingViews(mViewRoot, 0);