am dbb88e47: Merge "Remove unused default object of GestureStrokePreviewParams"
* commit 'dbb88e47c8060df8c142ad5beb22ad86c445f79c': Remove unused default object of GestureStrokePreviewParamsmain
commit
6c5c4e2e31
|
@ -84,12 +84,12 @@ public class GestureStroke {
|
|||
public final float mRecognitionSpeedThreshold; // keyWidth/sec
|
||||
|
||||
// Default GestureStroke parameters.
|
||||
private static final GestureStrokeParams DEFAULT = new GestureStrokeParams();
|
||||
public static final GestureStrokeParams DEFAULT = new GestureStrokeParams();
|
||||
|
||||
private GestureStrokeParams() {
|
||||
// These parameter values are default and intended for testing.
|
||||
mStaticTimeThresholdAfterFastTyping = 350; // msec
|
||||
mDetectFastMoveSpeedThreshold = 1.5f; // keyWidth / sec
|
||||
mDetectFastMoveSpeedThreshold = 1.5f; // keyWidth/sec
|
||||
mDynamicThresholdDecayDuration = 450; // msec
|
||||
mDynamicTimeThresholdFrom = 300; // msec
|
||||
mDynamicTimeThresholdTo = 20; // msec
|
||||
|
@ -98,7 +98,7 @@ public class GestureStroke {
|
|||
// The following parameters' change will affect the result of regression test.
|
||||
mSamplingMinimumDistance = 1.0f / 6.0f; // keyWidth
|
||||
mRecognitionMinimumTime = 100; // msec
|
||||
mRecognitionSpeedThreshold = 5.5f; // keyWidth / sec
|
||||
mRecognitionSpeedThreshold = 5.5f; // keyWidth/sec
|
||||
}
|
||||
|
||||
public GestureStrokeParams(final TypedArray mainKeyboardViewAttr) {
|
||||
|
|
|
@ -45,17 +45,10 @@ public final class GestureStrokeWithPreviewPoints extends GestureStroke {
|
|||
public final double mMaxInterpolationDistanceThreshold; // in pixel
|
||||
public final int mMaxInterpolationSegments;
|
||||
|
||||
private static final GestureStrokePreviewParams DEFAULT = new GestureStrokePreviewParams();
|
||||
|
||||
private static final float DEFAULT_MIN_SAMPLING_DISTANCE = 0.0f; // dp
|
||||
private static final int DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD = 15; // in degree
|
||||
|
||||
private GestureStrokePreviewParams() {
|
||||
mMinSamplingDistance = 0.0d;
|
||||
mMaxInterpolationAngularThreshold =
|
||||
degreeToRadian(DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD);
|
||||
mMaxInterpolationDistanceThreshold = mMinSamplingDistance;
|
||||
mMaxInterpolationSegments = 4;
|
||||
}
|
||||
private static final float DEFAULT_MAX_INTERPOLATION_DISTANCE_THRESHOLD = 0.0f; // dp
|
||||
private static final int DEFAULT_MAX_INTERPOLATION_SEGMENTS = 4;
|
||||
|
||||
private static double degreeToRadian(final int degree) {
|
||||
return degree / 180.0d * Math.PI;
|
||||
|
@ -64,18 +57,18 @@ public final class GestureStrokeWithPreviewPoints extends GestureStroke {
|
|||
public GestureStrokePreviewParams(final TypedArray mainKeyboardViewAttr) {
|
||||
mMinSamplingDistance = mainKeyboardViewAttr.getDimension(
|
||||
R.styleable.MainKeyboardView_gestureTrailMinSamplingDistance,
|
||||
(float)DEFAULT.mMinSamplingDistance);
|
||||
DEFAULT_MIN_SAMPLING_DISTANCE);
|
||||
final int interpolationAngularDegree = mainKeyboardViewAttr.getInteger(R.styleable
|
||||
.MainKeyboardView_gestureTrailMaxInterpolationAngularThreshold, 0);
|
||||
mMaxInterpolationAngularThreshold = (interpolationAngularDegree <= 0)
|
||||
? DEFAULT.mMaxInterpolationAngularThreshold
|
||||
? degreeToRadian(DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD)
|
||||
: degreeToRadian(interpolationAngularDegree);
|
||||
mMaxInterpolationDistanceThreshold = mainKeyboardViewAttr.getDimension(R.styleable
|
||||
.MainKeyboardView_gestureTrailMaxInterpolationDistanceThreshold,
|
||||
(float)DEFAULT.mMaxInterpolationDistanceThreshold);
|
||||
DEFAULT_MAX_INTERPOLATION_DISTANCE_THRESHOLD);
|
||||
mMaxInterpolationSegments = mainKeyboardViewAttr.getInteger(
|
||||
R.styleable.MainKeyboardView_gestureTrailMaxInterpolationSegments,
|
||||
DEFAULT.mMaxInterpolationSegments);
|
||||
DEFAULT_MAX_INTERPOLATION_SEGMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue