This repository was archived by the owner on Nov 27, 2022. It is now read-only.
Commit 6198d42
authored
feat: add springVelocityScale effect (#839)
Motivation
In this PR I add springVelocityScale parameter as a config of Pager. Toss defines how much velocity of gesture impacts on an initial velocity of Pager. Found it very useful in bottom sheet.
However, while writing this code I figured out interesting bug in Pager which led to fact that initial velocity of spring was always zero. It happened bc previously velocity was set only if clock was not running. However few lines above we made similar check and if clock was not running... then we were starting it, so as the result there was no chance that in current state clock was not running.
I fixed it by moving starting clock few lines below.
Test plan
You may add springVelocityScale ={4} param to ScrollableTabBarExample1 parent dd8a4f3 commit 6198d42
4 files changed
+39
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
345 | 349 | | |
346 | 350 | | |
347 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | | - | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
147 | 159 | | |
148 | 160 | | |
149 | 161 | | |
| |||
228 | 240 | | |
229 | 241 | | |
230 | 242 | | |
231 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
232 | 252 | | |
233 | 253 | | |
234 | 254 | | |
| |||
381 | 401 | | |
382 | 402 | | |
383 | 403 | | |
384 | | - | |
385 | 404 | | |
386 | 405 | | |
387 | 406 | | |
| |||
390 | 409 | | |
391 | 410 | | |
392 | 411 | | |
393 | | - | |
394 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
395 | 420 | | |
396 | 421 | | |
397 | 422 | | |
| |||
406 | 431 | | |
407 | 432 | | |
408 | 433 | | |
| 434 | + | |
409 | 435 | | |
410 | 436 | | |
411 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
0 commit comments