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

Commit 2e5b9e70 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Use slowSpatialSpec() when flinging and animating to targetOffset

This CL changes the spring used to animate to the target offset when
flinging a STL transition, from defaultSpatialSpec() to
slowSpatialSpec(). The slow spec is better for large offsets, which is
the case for our main use case of STL (Flexiglass).

In the future, we could either make this a parameter of our transition
specs or, even better, decide that automatically based on the size of
the STL or the gesture distance.

Bug: 417444347
Test: Manual, observed the slower animation when releasing a swipe
 transition
Flag: com.android.systemui.scene_container
Change-Id: I12876009a3a6a0d5e340ca836a6773a4f5960321
parent 380cbdd7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -433,7 +433,9 @@ internal class SwipeAnimation<T : ContentKey>(
            return initialVelocity - result.endState.velocity
        }

        val motionSpatialSpec = spec ?: layoutState.motionScheme.defaultSpatialSpec()
        // TODO(b/417444347): Use the default or fast spatial spec for small STLs, or make it a
        // parameter of the transitions spec.
        val motionSpatialSpec = spec ?: layoutState.motionScheme.slowSpatialSpec()
        animatable.animateTo(
            targetValue = targetOffset,
            animationSpec = motionSpatialSpec,
+61 −71
Original line number Diff line number Diff line
@@ -58,8 +58,7 @@
    880,
    896,
    912,
    928,
    944
    928
  ],
  "features": [
    {
@@ -223,59 +222,55 @@
          "y": 5.2
        },
        {
          "x": 8.4,
          "x": 5.6,
          "y": 5.2
        },
        {
          "x": 11.2,
          "x": 7.6,
          "y": 5.2
        },
        {
          "x": 13.6,
          "x": 9.6,
          "y": 5.2
        },
        {
          "x": 15.6,
          "x": 11.6,
          "y": 5.2
        },
        {
          "x": 16.8,
          "x": 13.2,
          "y": 5.2
        },
        {
          "x": 17.6,
          "x": 14.4,
          "y": 5.2
        },
        {
          "x": 18.4,
          "y": 5.2
        },
        {
          "x": 18.8,
          "x": 15.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 16.4,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 17.2,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 17.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.4,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.4,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.8,
          "y": 5.2
        },
        {
@@ -462,75 +457,71 @@
        },
        {
          "width": 150,
          "height": 99.2
          "height": 102.8
        },
        {
          "width": 150,
          "height": 81.2
          "height": 91.2
        },
        {
          "width": 144,
          "height": 62.8
          "width": 149.2,
          "height": 78.8
        },
        {
          "width": 138,
          "height": 46.4
          "width": 145.2,
          "height": 66.4
        },
        {
          "width": 133.2,
          "height": 32
          "width": 141.2,
          "height": 54.8
        },
        {
          "width": 129.6,
          "height": 20.4
          "width": 137.6,
          "height": 44.4
        },
        {
          "width": 127.2,
          "height": 12
          "width": 134.4,
          "height": 35.2
        },
        {
          "width": 125.2,
          "height": 6.4
          "width": 131.6,
          "height": 26.4
        },
        {
          "width": 124,
          "height": 2.8
        },
        {
          "width": 123.2,
          "height": 0.4
          "width": 129.6,
          "height": 19.6
        },
        {
          "width": 122.4,
          "height": 0
          "width": 127.6,
          "height": 14.4
        },
        {
          "width": 122,
          "height": 0
          "width": 126.4,
          "height": 10.4
        },
        {
          "width": 122,
          "height": 0
          "width": 125.2,
          "height": 7.2
        },
        {
          "width": 122,
          "height": 0
          "width": 124,
          "height": 4.8
        },
        {
          "width": 122,
          "height": 0
          "width": 123.6,
          "height": 3.2
        },
        {
          "width": 122,
          "height": 0
          "width": 122.8,
          "height": 2
        },
        {
          "width": 122,
          "height": 0
          "width": 122.4,
          "height": 1.2
        },
        {
          "width": 122,
          "height": 0
          "width": 122.4,
          "height": 0.4
        },
        {
          "width": 122,
@@ -600,22 +591,21 @@
        1,
        1,
        1,
        0.99781144,
        0.87040234,
        0.6695792,
        0.48078007,
        0.33033127,
        0.22004372,
        0.14321749,
        0.09153093,
        0.057634596,
        0.035840217,
        0.022048427,
        0.013435689,
        0.008117776,
        0,
        0,
        0,
        1,
        1,
        1,
        0.9844751,
        0.8289564,
        0.6262902,
        0.44474912,
        0.30327561,
        0.20090407,
        0.13020064,
        0.08292485,
        0.052065734,
        0.032297794,
        0.019826554,
        0.01205862,
        0,
        0
      ]
+64 −94
Original line number Diff line number Diff line
@@ -58,10 +58,7 @@
    880,
    896,
    912,
    928,
    944,
    960,
    976
    928
  ],
  "features": [
    {
@@ -229,71 +226,59 @@
          "y": 5.2
        },
        {
          "x": 6.8,
          "y": 5.2
        },
        {
          "x": 10.4,
          "y": 5.2
        },
        {
          "x": 13.2,
          "y": 5.2
        },
        {
          "x": 15.2,
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 16.8,
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 17.6,
          "x": 7.2,
          "y": 5.2
        },
        {
          "x": 18.4,
          "x": 9.6,
          "y": 5.2
        },
        {
          "x": 18.8,
          "x": 11.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 13.2,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 14.8,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 15.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 16.8,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 17.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.4,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.8,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.8,
          "y": 5.2
        },
        {
@@ -472,87 +457,75 @@
        },
        {
          "width": 150,
          "height": 147.2
          "height": 152.4
        },
        {
          "width": 150,
          "height": 122
          "height": 137.6
        },
        {
          "width": 150,
          "height": 95.2
        },
        {
          "width": 146.8,
          "height": 70.8
        },
        {
          "width": 139.6,
          "height": 50.8
          "height": 120.4
        },
        {
          "width": 134,
          "height": 34
        },
        {
          "width": 130,
          "height": 19.2
          "width": 150,
          "height": 102.8
        },
        {
          "width": 127.2,
          "height": 9.2
          "width": 150,
          "height": 85.6
        },
        {
          "width": 125.2,
          "height": 2.8
          "width": 146.4,
          "height": 70.4
        },
        {
          "width": 123.6,
          "height": 0
          "width": 141.6,
          "height": 56.8
        },
        {
          "width": 122.8,
          "height": 0
          "width": 137.6,
          "height": 44.8
        },
        {
          "width": 122.4,
          "height": 0
          "width": 134,
          "height": 34.4
        },
        {
          "width": 122,
          "height": 0
          "width": 131.2,
          "height": 25.2
        },
        {
          "width": 122,
          "height": 0
          "width": 129.2,
          "height": 18
        },
        {
          "width": 122,
          "height": 0
          "width": 127.2,
          "height": 12.8
        },
        {
          "width": 122,
          "height": 0
          "width": 125.6,
          "height": 8.8
        },
        {
          "width": 122,
          "height": 0
          "width": 124.8,
          "height": 5.6
        },
        {
          "width": 122,
          "height": 0
          "width": 124,
          "height": 3.6
        },
        {
          "width": 122,
          "height": 0
          "width": 123.2,
          "height": 2
        },
        {
          "width": 122,
          "height": 0
          "width": 122.8,
          "height": 1.2
        },
        {
          "width": 122,
          "height": 0
          "width": 122.4,
          "height": 0.4
        },
        {
          "width": 122,
@@ -619,25 +592,22 @@
        1,
        1,
        1,
        0.99979615,
        0.8860379,
        0.6869267,
        0.4955439,
        0.34154767,
        0.22803628,
        0.14868054,
        0.095156215,
        0.05998723,
        0.037340246,
        0.022991102,
        0.014020911,
        0.008477271,
        0,
        0,
        0,
        0,
        0,
        0
        1,
        1,
        1,
        1,
        0.9679595,
        0.7966402,
        0.5945783,
        0.41900647,
        0.284207,
        0.18753082,
        0.12116034,
        0.07697477,
        0.048229113,
        0.02986427,
        0.018303879,
        0.011116857
      ]
    }
  ]
+81 −11
Original line number Diff line number Diff line
@@ -51,7 +51,14 @@
    768,
    784,
    800,
    816
    816,
    832,
    848,
    864,
    880,
    896,
    912,
    928
  ],
  "features": [
    {
@@ -259,6 +266,34 @@
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 5.2,
          "y": 5.2
@@ -416,39 +451,59 @@
        },
        {
          "width": 150,
          "height": 200.4
          "height": 196.8
        },
        {
          "width": 150,
          "height": 218.4
          "height": 208.4
        },
        {
          "width": 150,
          "height": 236.8
          "height": 220.8
        },
        {
          "width": 150,
          "height": 253.2
          "height": 233.2
        },
        {
          "width": 150,
          "height": 266.8
          "height": 244.8
        },
        {
          "width": 150,
          "height": 277.2
          "height": 255.2
        },
        {
          "width": 150,
          "height": 284.8
          "height": 264
        },
        {
          "width": 150,
          "height": 290
          "height": 271.6
        },
        {
          "width": 150,
          "height": 294
          "height": 278
        },
        {
          "width": 150,
          "height": 283.2
        },
        {
          "width": 150,
          "height": 287.2
        },
        {
          "width": 150,
          "height": 290.4
        },
        {
          "width": 150,
          "height": 292.8
        },
        {
          "width": 150,
          "height": 294.8
        },
        {
          "width": 150,
@@ -456,12 +511,20 @@
        },
        {
          "width": 150,
          "height": 298
          "height": 297.6
        },
        {
          "width": 150,
          "height": 298.4
        },
        {
          "width": 150,
          "height": 298.8
        },
        {
          "width": 150,
          "height": 299.2
        },
        {
          "width": 150,
          "height": 299.6
@@ -537,6 +600,13 @@
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
      ]
    }
+67 −57
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@
    592,
    608,
    624,
    640
    640,
    656
  ],
  "features": [
    {
@@ -124,51 +125,55 @@
          "y": 5.2
        },
        {
          "x": 6.4,
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 10.4,
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 13.6,
          "x": 5.2,
          "y": 5.2
        },
        {
          "x": 15.6,
          "x": 8.4,
          "y": 5.2
        },
        {
          "x": 17.2,
          "x": 10.8,
          "y": 5.2
        },
        {
          "x": 18,
          "x": 12.8,
          "y": 5.2
        },
        {
          "x": 18.8,
          "x": 14.4,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 15.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 16.8,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 17.6,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18,
          "y": 5.2
        },
        {
          "x": 19.2,
          "x": 18.4,
          "y": 5.2
        },
        {
          "x": 18.8,
          "y": 5.2
        },
        {
@@ -279,70 +284,74 @@
        },
        {
          "width": 150,
          "height": 224
          "height": 231.6
        },
        {
          "width": 150,
          "height": 183.2
          "height": 205.6
        },
        {
          "width": 150,
          "height": 141.6
          "height": 177.2
        },
        {
          "width": 150,
          "height": 104.4
          "height": 149.6
        },
        {
          "width": 148,
          "height": 74.4
          "width": 150,
          "height": 123.6
        },
        {
          "width": 139.6,
          "height": 51.2
          "width": 150,
          "height": 100.4
        },
        {
          "width": 133.6,
          "height": 32.4
          "width": 150,
          "height": 80.4
        },
        {
          "width": 129.6,
          "height": 15.6
          "width": 144,
          "height": 63.2
        },
        {
          "width": 126.4,
          "height": 5.2
          "width": 139.2,
          "height": 49.2
        },
        {
          "width": 124.4,
          "height": 0
          "width": 135.2,
          "height": 37.2
        },
        {
          "width": 123.2,
          "height": 0
          "width": 131.6,
          "height": 25.6
        },
        {
          "width": 122.4,
          "height": 0
          "width": 129.2,
          "height": 17.2
        },
        {
          "width": 122,
          "height": 0
          "width": 127.2,
          "height": 10.8
        },
        {
          "width": 122,
          "height": 0
          "width": 125.6,
          "height": 6.4
        },
        {
          "width": 122,
          "height": 0
          "width": 124.4,
          "height": 3.6
        },
        {
          "width": 122,
          "height": 0
          "width": 123.6,
          "height": 1.6
        },
        {
          "width": 122,
          "width": 122.8,
          "height": 0.4
        },
        {
          "width": 122.4,
          "height": 0
        },
        {
@@ -409,21 +418,22 @@
        1,
        1,
        1,
        0.99532944,
        0.8594856,
        0.65783304,
        0.4708934,
        0.3228633,
        0.21474116,
        0.13960199,
        0.089136004,
        0.05608259,
        0.034851786,
        0.021427846,
        0.013050736,
        0.007881473,
        0,
        0,
        1,
        1,
        1,
        1,
        0.9795674,
        0.81836563,
        0.615729,
        0.43611857,
        0.29685906,
        0.19639339,
        0.12714638,
        0.08091212,
        0.050766658,
        0.03147315,
        0.019310223,
        0.011739091,
        0,
        0,
        0,
Loading