Update spring constants for expressive dismiss.

- Add separate horizontal spring constants for tablets.

Fix: 391101706
Test: Manual.
Flag: com.android.launcher3.enable_expressive_dismiss_task_motion
Change-Id: I689b44697be3e5d7909f9f1238359ca529e917f0
This commit is contained in:
Pat Manning
2025-05-23 12:46:27 +01:00
parent 70f5d5738e
commit a0b7dde91c
5 changed files with 16 additions and 10 deletions
+4
View File
@@ -17,4 +17,8 @@
<!-- The number of thumbnails and icons to keep in the cache. The thumbnail cache size also
determines how many thumbnails will be fetched in the background. -->
<integer name="recentsThumbnailCacheSize">8</integer>
<!-- Expressive Dismiss -->
<item name="expressive_dismiss_task_trans_x_damping_ratio" type="dimen" format="float">0.775</item>
<item name="expressive_dismiss_task_trans_x_stiffness" type="dimen" format="float">2400</item>
</resources>
+8
View File
@@ -63,4 +63,12 @@
<!-- This is a float because it is converted to dp later in DeviceProfile -->
<item name="taskbar_icon_size" type="dimen" format="float">44</item>
<!-- Expressive Dismiss -->
<item name="expressive_dismiss_task_trans_y_damping_ratio" type="dimen" format="float">0.65</item>
<item name="expressive_dismiss_task_trans_y_stiffness" type="dimen" format="float">850</item>
<item name="expressive_dismiss_task_trans_x_damping_ratio" type="dimen" format="float">0.8</item>
<item name="expressive_dismiss_task_trans_x_stiffness" type="dimen" format="float">2800</item>
<item name="expressive_dismiss_effects_damping_ratio" type="dimen" format="float">1</item>
<item name="expressive_dismiss_effects_stiffness" type="dimen" format="float">1600</item>
</resources>
+1 -1
View File
@@ -96,7 +96,7 @@
<!-- How much a task being dragged for dismissal can undershoot the origin when dragged back to its start position. -->
<dimen name="task_dismiss_max_undershoot">25dp</dimen>
<!-- How much a task should be dragged from the origin before it detaches (or reattaches). -->
<dimen name="task_dismiss_detach_threshold">100dp</dimen>
<dimen name="task_dismiss_detach_threshold">72dp</dimen>
<dimen name="task_icon_cache_default_icon_size">72dp</dimen>
<item name="overview_modal_max_scale" format="float" type="dimen">1.1</item>
@@ -417,7 +417,7 @@ CONTAINER : StatefulContainer<T> {
breakpoints.add(minLimit)
mappings.add(Mapping.Identity)
breakpoints.add(Breakpoint(detachKey, detachThreshold, spring, Guarantee.None))
mappings.add(Mapping.Linear(0.3f))
mappings.add(Mapping.Linear(MAGNETIC_DETACH_INTERPOLATION_FRACTION))
breakpoints.add(maxLimit)
return MotionSpec(DirectionalMotionSpec(breakpoints, mappings))
@@ -435,5 +435,7 @@ CONTAINER : StatefulContainer<T> {
private const val RECENTS_SCALE_FIRST_THRESHOLD_FRACTION = 0.2f
private const val RECENTS_SCALE_DISMISS_THRESHOLD_FRACTION = 0.5f
private const val RECENTS_SCALE_SECOND_THRESHOLD_FRACTION = 0.575f
private const val MAGNETIC_DETACH_INTERPOLATION_FRACTION = 0.35f
}
}
-8
View File
@@ -106,14 +106,6 @@
<item name="swipe_up_rect_y_damping_ratio" type="dimen" format="float">0.95</item>
<item name="swipe_up_rect_y_stiffness" type="dimen" format="float">400</item>
<!-- Expressive Dismiss -->
<item name="expressive_dismiss_task_trans_y_damping_ratio" type="dimen" format="float">0.6</item>
<item name="expressive_dismiss_task_trans_y_stiffness" type="dimen" format="float">900</item>
<item name="expressive_dismiss_task_trans_x_damping_ratio" type="dimen" format="float">0.8</item>
<item name="expressive_dismiss_task_trans_x_stiffness" type="dimen" format="float">3000</item>
<item name="expressive_dismiss_effects_damping_ratio" type="dimen" format="float">1</item>
<item name="expressive_dismiss_effects_stiffness" type="dimen" format="float">1600</item>
<!-- Taskbar -->
<!-- This is a float because it is converted to dp later in DeviceProfile -->
<item name="taskbar_icon_size" type="dimen" format="float">0</item>