am dbb88e47: Merge "Remove unused default object of GestureStrokePreviewParams"

* commit 'dbb88e47c8060df8c142ad5beb22ad86c445f79c':
  Remove unused default object of GestureStrokePreviewParams
main
Tadashi G. Takaoka 2013-12-19 22:35:59 -08:00 committed by Android Git Automerger
commit 6c5c4e2e31
2 changed files with 10 additions and 17 deletions

View File

@ -84,7 +84,7 @@ 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.

View File

@ -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);
}
}