Commit af82ecb2 authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

[Home] Flip swipe velocity experiment for bottom sheet

Metrics indicate that users are more likely to use the bottom sheet
when it is quickly swiped open instead of slowly dragged. This change
updates the relevant code to handle this. The expectation in this
state is that ~50% of useless swipes will be blocked while only
blocking ~30% of useful ones (requiring a more deliberate fling).

BUG=779615

Change-Id: Iad9928da98da9e95e77052b6bd070553b0d94243
Reviewed-on: https://chromium-review.googlesource.com/825992
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524140}
parent 7e8a510d
......@@ -139,10 +139,10 @@ public class BottomSheet
private static final float SWIPE_ALLOWED_FRACTION = 0.2f;
/**
* The maximum swipe velocity (dp/ms) that should be considered as a user opening the bottom
* The minimum swipe velocity (dp/ms) that should be considered as a user opening the bottom
* sheet intentionally. This is specifically for the 'velocity' swipe logic.
*/
private static final float SHEET_SWIPE_MAX_DP_PER_MS = 0.2f;
private static final float SHEET_SWIPE_MIN_DP_PER_MS = 0.2f;
/**
* Information about the different scroll states of the sheet. Order is important for these,
......@@ -397,7 +397,7 @@ public class BottomSheet
double dpPerMs = scrollDistanceDp / (double) timeDeltaMs;
if (dpPerMs > SHEET_SWIPE_MAX_DP_PER_MS) {
if (dpPerMs < SHEET_SWIPE_MIN_DP_PER_MS) {
if (shouldRecordHistogram && !mIsSwipeVelocityRecorded) {
recordSwipeVelocity("Android.ChromeHome.OpenSheetVelocity.Fail",
(int) mLastSheetOpenMicrosPerDp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment