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

Commit 52a85046 authored by Stefan Kuhne's avatar Stefan Kuhne Committed by Android (Google) Code Review
Browse files

Merge "Possible resize flickering on config change"

parents 4a305c95 cc075c76
Loading
Loading
Loading
Loading
+14 −10
Original line number Original line Diff line number Diff line
@@ -519,20 +519,24 @@ public class NonClientDecorView extends LinearLayout
            // inaccessible. For that case we remember the previous metrics to avoid flashes.
            // inaccessible. For that case we remember the previous metrics to avoid flashes.
            View caption = getChildAt(0);
            View caption = getChildAt(0);
            View content = getChildAt(1);
            View content = getChildAt(1);
            if (content != null && caption != null) {
            if (caption != null && content != null) {
                mLastContentWidth = content.getWidth();
                int captionHeight = caption.getHeight();
                mLastContentHeight = content.getHeight();
                int contentWidth = content.getWidth();
                mLastCaptionHeight = caption.getHeight();
                int contentHeight = content.getHeight();

                // Get the draw position within our surface (shadow offsets).
                // Get the draw position within our surface.
                int[] surfaceOrigin = new int[2];
                int[] surfaceOrigin = new int[2];
                surfaceOrigin[0] = 0;
                surfaceOrigin[0] = 0;
                surfaceOrigin[1] = 0;
                surfaceOrigin[1] = 0;

                // Get the shadow offsets.
                getLocationInSurface(surfaceOrigin);
                getLocationInSurface(surfaceOrigin);
                // Only update if a layout has already be performed (which might not be after a
                // relayout. Otherwise use the previous values for the content.
                if (captionHeight != 0 && contentWidth != 0 && contentHeight != 0) {
                    mLastCaptionHeight = captionHeight;
                    mLastXOffset = surfaceOrigin[0];
                    mLastXOffset = surfaceOrigin[0];
                    mLastYOffset = surfaceOrigin[1];
                    mLastYOffset = surfaceOrigin[1];
                    mLastContentWidth = contentWidth;
                    mLastContentHeight = contentHeight;
                }
            }
            }


            // Since the surface is spanning the entire screen, we have to add the start offset of
            // Since the surface is spanning the entire screen, we have to add the start offset of