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

Commit 79387722 authored by Milton Wu's avatar Milton Wu Committed by Automerger Merge Worker
Browse files

Merge "Support tuning sysui_rounded_size" into tm-dev am: 353fdaeb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17200803

Change-Id: I14a729986b48b50d906054a452d4af1f0f34e6b9
parents bbbfeb61 353fdaeb
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -125,17 +125,18 @@ class RoundedCornerResDelegate(
            bottomRoundedSize = Size(bottomRadius, bottomRadius)
        }

        if (roundedSizeFactor != null && roundedSizeFactor > 0) {
            val length: Int = (roundedSizeFactor * density).toInt()
            roundedSize = Size(length, length)
        }

        if (topRoundedSize.width == 0) {
            topRoundedSize = roundedSize
        }
        if (bottomRoundedSize.width == 0) {
            bottomRoundedSize = roundedSize
        }

        if (roundedSizeFactor != null && roundedSizeFactor > 0) {
            val length: Int = (roundedSizeFactor * density).toInt()
            topRoundedSize = Size(length, length)
            bottomRoundedSize = Size(length, length)
        }
    }

    fun updateTuningSizeFactor(factor: Int?, newReloadToken: Int) {
+2 −6
Original line number Diff line number Diff line
@@ -102,8 +102,9 @@ class RoundedCornerResDelegateTest : SysuiTestCase() {
    fun testUpdateTuningSizeFactor() {
        mContext.orCreateTestableResources.addOverrides(
                mockTypeArray = mockTypedArray,
                radius = 1,
                radiusTop = 0,
                radiusBottom = 0,
                radiusBottom = 2,
                multipleRadius = false)

        roundedCornerResDelegate = RoundedCornerResDelegate(mContext.resources, null)
@@ -115,11 +116,6 @@ class RoundedCornerResDelegateTest : SysuiTestCase() {
        assertEquals(Size(length, length), roundedCornerResDelegate.topRoundedSize)
        assertEquals(Size(length, length), roundedCornerResDelegate.bottomRoundedSize)

        mContext.orCreateTestableResources.addOverrides(
                mockTypeArray = mockTypedArray,
                radiusTop = 1,
                radiusBottom = 2,
                multipleRadius = false)
        roundedCornerResDelegate.updateTuningSizeFactor(null, 2)

        assertEquals(Size(1, 1), roundedCornerResDelegate.topRoundedSize)