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

Commit 72b320b9 authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Change SysUI dialog scale from 0.8 to 0.9 for predictive back

Bug: 329387893
Flag: ACONFIG com.android.systemui.predictive_back_animate_dialogs TEAMFOOD
Test: atest BackAnimationSpecTest
Test: atest OnBackAnimationCallbackExtensionTest
Test: Manual, i.e. verifying dialog scale animation is toned down with change applied
Change-Id: Ie1f203885a0239ce65dd01ffbf542baf27e474e0
parent 69a62d57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,5 +71,5 @@ fun BackAnimationSpec.Companion.floatingSystemSurfacesForSysUi(
        displayMetrics = displayMetrics,
        maxMarginXdp = 8f,
        maxMarginYdp = 8f,
        minScale = 0.8f,
        minScale = 0.9f,
    )
+3 −3
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ class BackAnimationSpecTest : SysuiTestCase() {

    @Test
    fun sysUi_floatingSystemSurfaces_animationValues() {
        val maxX = 14.0f
        val maxY = 4.0f
        val minScale = 0.8f
        val maxX = 19.0f
        val maxY = 14.0f
        val minScale = 0.9f

        val backAnimationSpec = BackAnimationSpec.floatingSystemSurfacesForSysUi(displayMetrics)

+11 −1
Original line number Diff line number Diff line
@@ -4,7 +4,10 @@ import android.util.DisplayMetrics
import android.window.BackEvent
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.mock
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@@ -48,7 +51,14 @@ class OnBackAnimationCallbackExtensionTest : SysuiTestCase() {

        onBackAnimationCallback.onBackProgressed(backEvent)

        verify(onBackProgress).invoke(BackTransformation(0f, 0f, 1f))
        val argumentCaptor = argumentCaptor<BackTransformation>()
        verify(onBackProgress).invoke(capture(argumentCaptor))

        val actual = argumentCaptor.value
        val tolerance = 0.0001f
        assertThat(actual.translateX).isWithin(tolerance).of(0f)
        assertThat(actual.translateY).isWithin(tolerance).of(0f)
        assertThat(actual.scale).isWithin(tolerance).of(1f)
    }

    @Test