am dbb88e47: Merge "Remove unused default object of GestureStrokePreviewParams"
* commit 'dbb88e47c8060df8c142ad5beb22ad86c445f79c': Remove unused default object of GestureStrokePreviewParamsmain
commit
6c5c4e2e31
|
@ -84,7 +84,7 @@ public class GestureStroke {
|
||||||
public final float mRecognitionSpeedThreshold; // keyWidth/sec
|
public final float mRecognitionSpeedThreshold; // keyWidth/sec
|
||||||
|
|
||||||
// Default GestureStroke parameters.
|
// Default GestureStroke parameters.
|
||||||
private static final GestureStrokeParams DEFAULT = new GestureStrokeParams();
|
public static final GestureStrokeParams DEFAULT = new GestureStrokeParams();
|
||||||
|
|
||||||
private GestureStrokeParams() {
|
private GestureStrokeParams() {
|
||||||
// These parameter values are default and intended for testing.
|
// These parameter values are default and intended for testing.
|
||||||
|
|
|
@ -45,17 +45,10 @@ public final class GestureStrokeWithPreviewPoints extends GestureStroke {
|
||||||
public final double mMaxInterpolationDistanceThreshold; // in pixel
|
public final double mMaxInterpolationDistanceThreshold; // in pixel
|
||||||
public final int mMaxInterpolationSegments;
|
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 static final int DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD = 15; // in degree
|
||||||
|
private static final float DEFAULT_MAX_INTERPOLATION_DISTANCE_THRESHOLD = 0.0f; // dp
|
||||||
private GestureStrokePreviewParams() {
|
private static final int DEFAULT_MAX_INTERPOLATION_SEGMENTS = 4;
|
||||||
mMinSamplingDistance = 0.0d;
|
|
||||||
mMaxInterpolationAngularThreshold =
|
|
||||||
degreeToRadian(DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD);
|
|
||||||
mMaxInterpolationDistanceThreshold = mMinSamplingDistance;
|
|
||||||
mMaxInterpolationSegments = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double degreeToRadian(final int degree) {
|
private static double degreeToRadian(final int degree) {
|
||||||
return degree / 180.0d * Math.PI;
|
return degree / 180.0d * Math.PI;
|
||||||
|
@ -64,18 +57,18 @@ public final class GestureStrokeWithPreviewPoints extends GestureStroke {
|
||||||
public GestureStrokePreviewParams(final TypedArray mainKeyboardViewAttr) {
|
public GestureStrokePreviewParams(final TypedArray mainKeyboardViewAttr) {
|
||||||
mMinSamplingDistance = mainKeyboardViewAttr.getDimension(
|
mMinSamplingDistance = mainKeyboardViewAttr.getDimension(
|
||||||
R.styleable.MainKeyboardView_gestureTrailMinSamplingDistance,
|
R.styleable.MainKeyboardView_gestureTrailMinSamplingDistance,
|
||||||
(float)DEFAULT.mMinSamplingDistance);
|
DEFAULT_MIN_SAMPLING_DISTANCE);
|
||||||
final int interpolationAngularDegree = mainKeyboardViewAttr.getInteger(R.styleable
|
final int interpolationAngularDegree = mainKeyboardViewAttr.getInteger(R.styleable
|
||||||
.MainKeyboardView_gestureTrailMaxInterpolationAngularThreshold, 0);
|
.MainKeyboardView_gestureTrailMaxInterpolationAngularThreshold, 0);
|
||||||
mMaxInterpolationAngularThreshold = (interpolationAngularDegree <= 0)
|
mMaxInterpolationAngularThreshold = (interpolationAngularDegree <= 0)
|
||||||
? DEFAULT.mMaxInterpolationAngularThreshold
|
? degreeToRadian(DEFAULT_MAX_INTERPOLATION_ANGULAR_THRESHOLD)
|
||||||
: degreeToRadian(interpolationAngularDegree);
|
: degreeToRadian(interpolationAngularDegree);
|
||||||
mMaxInterpolationDistanceThreshold = mainKeyboardViewAttr.getDimension(R.styleable
|
mMaxInterpolationDistanceThreshold = mainKeyboardViewAttr.getDimension(R.styleable
|
||||||
.MainKeyboardView_gestureTrailMaxInterpolationDistanceThreshold,
|
.MainKeyboardView_gestureTrailMaxInterpolationDistanceThreshold,
|
||||||
(float)DEFAULT.mMaxInterpolationDistanceThreshold);
|
DEFAULT_MAX_INTERPOLATION_DISTANCE_THRESHOLD);
|
||||||
mMaxInterpolationSegments = mainKeyboardViewAttr.getInteger(
|
mMaxInterpolationSegments = mainKeyboardViewAttr.getInteger(
|
||||||
R.styleable.MainKeyboardView_gestureTrailMaxInterpolationSegments,
|
R.styleable.MainKeyboardView_gestureTrailMaxInterpolationSegments,
|
||||||
DEFAULT.mMaxInterpolationSegments);
|
DEFAULT_MAX_INTERPOLATION_SEGMENTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue