summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-05-11 14:03:38 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-11 14:03:38 -0700
commitb12b6b5116e3d76474296b45f570693bb10d6c99 (patch)
tree09c87d73150ccd5dc20010d99ec0a7d2552d7b31 /core/java/android
parentef279363716706192b4da543fcae3e92cc14d27e (diff)
parent8a90e6e3174083f274538567d851f98478fc83e9 (diff)
downloadframeworks_base-b12b6b5116e3d76474296b45f570693bb10d6c99.zip
frameworks_base-b12b6b5116e3d76474296b45f570693bb10d6c99.tar.gz
frameworks_base-b12b6b5116e3d76474296b45f570693bb10d6c99.tar.bz2
Merge "Minor refactoring before starting on velocity tracker changes." into jb-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/VelocityTracker.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/view/VelocityTracker.java b/core/java/android/view/VelocityTracker.java
index 1c35e31..f703e34 100644
--- a/core/java/android/view/VelocityTracker.java
+++ b/core/java/android/view/VelocityTracker.java
@@ -298,6 +298,24 @@ public final class VelocityTracker implements Poolable<VelocityTracker> {
return estimate(time, yCoeff);
}
+ /**
+ * Gets the X coefficient with the specified index.
+ * @param index The index of the coefficient to return.
+ * @return The X coefficient, or 0 if the index is greater than the degree.
+ */
+ public float getXCoeff(int index) {
+ return index <= degree ? xCoeff[index] : 0;
+ }
+
+ /**
+ * Gets the Y coefficient with the specified index.
+ * @param index The index of the coefficient to return.
+ * @return The Y coefficient, or 0 if the index is greater than the degree.
+ */
+ public float getYCoeff(int index) {
+ return index <= degree ? yCoeff[index] : 0;
+ }
+
private float estimate(float time, float[] c) {
float a = 0;
float scale = 1;