aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-12-20 15:00:04 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-12-20 15:25:24 +0900
commit081989ca30a6f3f10c37c9d582de18fc29fd2df7 (patch)
tree4dff06c7c83bc418ab3bede80ef0fbe3895bfe97 /java/src
parent6e97efef78f32daebed7ec3b0624cd645072ec84 (diff)
downloadlatinime-081989ca30a6f3f10c37c9d582de18fc29fd2df7.tar.gz
latinime-081989ca30a6f3f10c37c9d582de18fc29fd2df7.tar.xz
latinime-081989ca30a6f3f10c37c9d582de18fc29fd2df7.zip
Remove unused default object of GestureStrokePreviewParams
This change also fixes build broken by Id615556766. Change-Id: I16605cc3b65e3e9ab2d5a498825c31d9b4046b73
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java6
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java21
2 files changed, 10 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
index 0c1181721..4f78e6b52 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
@@ -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) {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java b/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java
index ec6e4df01..9ce204393 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java
@@ -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);
}
}