Merge "Decrease fling sensitivity for vertical falsing."
This commit is contained in:
@@ -38,10 +38,10 @@ import java.util.Locale;
|
||||
class DistanceClassifier extends FalsingClassifier {
|
||||
|
||||
private static final float HORIZONTAL_FLING_THRESHOLD_DISTANCE_IN = 1;
|
||||
private static final float VERTICAL_FLING_THRESHOLD_DISTANCE_IN = 1;
|
||||
private static final float VERTICAL_FLING_THRESHOLD_DISTANCE_IN = 1.5f;
|
||||
private static final float HORIZONTAL_SWIPE_THRESHOLD_DISTANCE_IN = 3;
|
||||
private static final float VERTICAL_SWIPE_THRESHOLD_DISTANCE_IN = 3;
|
||||
private static final float VELOCITY_TO_DISTANCE = 80f;
|
||||
private static final float VELOCITY_TO_DISTANCE = 30f;
|
||||
private static final float SCREEN_FRACTION_MAX_DISTANCE = 0.8f;
|
||||
|
||||
private final float mVerticalFlingThresholdPx;
|
||||
|
||||
@@ -42,8 +42,8 @@ class ZigZagClassifier extends FalsingClassifier {
|
||||
// most swipes will follow somewhat of a 'C' or 'S' shape, we allow more deviance along the
|
||||
// `SECONDARY` axis.
|
||||
private static final float MAX_X_PRIMARY_DEVIANCE = .05f;
|
||||
private static final float MAX_Y_PRIMARY_DEVIANCE = .1f;
|
||||
private static final float MAX_X_SECONDARY_DEVIANCE = .6f;
|
||||
private static final float MAX_Y_PRIMARY_DEVIANCE = .15f;
|
||||
private static final float MAX_X_SECONDARY_DEVIANCE = .4f;
|
||||
private static final float MAX_Y_SECONDARY_DEVIANCE = .3f;
|
||||
|
||||
private final float mMaxXPrimaryDeviance;
|
||||
|
||||
@@ -60,10 +60,10 @@ public class DistanceClassifierTest extends ClassifierTest {
|
||||
mClassifier.onTouchEvent(appendDownEvent(1, 1));
|
||||
assertThat(mClassifier.isFalseTouch(), is(true));
|
||||
|
||||
mClassifier.onTouchEvent(appendMoveEvent(1, 2));
|
||||
mClassifier.onTouchEvent(appendMoveEvent(1, 40));
|
||||
assertThat(mClassifier.isFalseTouch(), is(true));
|
||||
|
||||
mClassifier.onTouchEvent(appendUpEvent(1, 40));
|
||||
mClassifier.onTouchEvent(appendUpEvent(1, 80));
|
||||
assertThat(mClassifier.isFalseTouch(), is(false));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user