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

Commit ca7e901e authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Remove requestLayout when setting interpolated view bounds

Bug: 394840414
Test: Manually checked perf; regresses functionality
Flag: com.android.systemui.shared.clock_reactive_variants
Change-Id: Ic4fff4217f3242a8fac356ee2dd8bdfa01f208dd
parent c26379f2
Loading
Loading
Loading
Loading
+2 −11
Original line number Original line Diff line number Diff line
@@ -215,12 +215,7 @@ open class SimpleDigitalClockTextView(
            )
            )
        }
        }


        setInterpolatedViewBounds(
        setInterpolatedViewBounds(getInterpolatedTextBounds(), widthMeasureSpec, heightMeasureSpec)
            getInterpolatedTextBounds(),
            widthMeasureSpec,
            heightMeasureSpec,
            force = true,
        )
    }
    }


    override fun onDraw(canvas: Canvas) {
    override fun onDraw(canvas: Canvas) {
@@ -388,7 +383,6 @@ open class SimpleDigitalClockTextView(
        interpBounds: Rect,
        interpBounds: Rect,
        widthMeasureSpec: Int = measuredWidthAndState,
        widthMeasureSpec: Int = measuredWidthAndState,
        heightMeasureSpec: Int = measuredHeightAndState,
        heightMeasureSpec: Int = measuredHeightAndState,
        force: Boolean = false,
    ) {
    ) {
        val heightMode = MeasureSpec.getMode(heightMeasureSpec)
        val heightMode = MeasureSpec.getMode(heightMeasureSpec)
        val widthMode = MeasureSpec.getMode(widthMeasureSpec)
        val widthMode = MeasureSpec.getMode(widthMeasureSpec)
@@ -415,10 +409,7 @@ open class SimpleDigitalClockTextView(
                )
                )
            }
            }


        if (force || widthSpec != measuredWidthAndState || heightSpec != measuredHeightAndState) {
        setMeasuredDimension(widthSpec, heightSpec)
        setMeasuredDimension(widthSpec, heightSpec)
            parent?.requestLayout()
        }
    }
    }


    private fun updateXTranslation(inPoint: Point, interpolatedTextBounds: Rect): Point {
    private fun updateXTranslation(inPoint: Point, interpolatedTextBounds: Rect): Point {