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

Commit 4934b136 authored by Todd Lee's avatar Todd Lee
Browse files

Update pre-draw layout check for ViewUIComponent views

Only need to ensure non-null

Bug: b/389131346
Test: manual test with new sample tiles
Flag: NONE exempt minor bug fix
Change-Id: I283c76ac977abf9981659ebace315ad369cec560
parent ca618d9f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -185,16 +185,24 @@ public class ViewUIComponent implements UIComponent {
            return;
        }
        ViewGroup.LayoutParams params = mView.getLayoutParams();
        if (params == null || params.width == 0 || params.height == 0) {
        if (params == null) {
            // layout pass didn't happen.
            logD("draw: skipped - no layout");
            return;
        }

        final Rect realBounds = getRealBounds();
        if (realBounds.width() == 0 || realBounds.height() == 0) {
            // bad bounds.
            logD("draw: skipped - zero bounds");
            return;
        }


        Canvas canvas = mSurface.lockHardwareCanvas();
        // Clear the canvas first.
        canvas.drawColor(0, PorterDuff.Mode.CLEAR);
        if (mVisibleOverride) {
            Rect realBounds = getRealBounds();
            Rect renderBounds = getBounds();
            canvas.translate(renderBounds.left, renderBounds.top);
            canvas.scale(