Lines Matching refs:vt

39         VelocityTracker vt = VelocityTracker.obtain();
40 assertNotNull(vt);
41 vt.recycle();
51 VelocityTracker vt = VelocityTracker.obtain();
52 drag(vt, 100, 200, 100, 200, 10, t, 300);
53 vt.computeCurrentVelocity(1);
54 assertFalse("Velocity should not be null", vt.getXVelocity() == 0.0f);
55 assertFalse("Velocity should not be null", vt.getYVelocity() == 0.0f);
56 vt.clear();
57 vt.computeCurrentVelocity(1);
58 assertEquals(0.0f, vt.getXVelocity());
59 assertEquals(0.0f, vt.getYVelocity());
60 vt.recycle();
66 VelocityTracker vt = VelocityTracker.obtain();
67 drag(vt, 100, 200, 100, 200, 15, t, 400, new AccelerateInterpolator());
68 vt.computeCurrentVelocity(1000);
69 assertGreater(250.0f, vt.getXVelocity());
70 assertGreater(250.0f, vt.getYVelocity());
71 vt.recycle();
77 VelocityTracker vt = VelocityTracker.obtain();
78 drag(vt, 100, 200, 100, 200, 15, t, 400, new DecelerateInterpolator());
79 vt.computeCurrentVelocity(1000);
80 assertLower(250.0f, vt.getXVelocity());
81 assertLower(250.0f, vt.getYVelocity());
82 vt.recycle();
88 VelocityTracker vt = VelocityTracker.obtain();
90 drag(vt, 100, 200, 200, 200, 15, t, 400);
91 vt.computeCurrentVelocity(1000);
92 assertEquals(0.0f, vt.getYVelocity());
93 assertEqualFuzzy(250.0f, vt.getXVelocity(), 4f);
94 vt.recycle();
100 VelocityTracker vt = VelocityTracker.obtain();
102 drag(vt, 200, 200, 100, 200, 15, t, 400);
103 vt.computeCurrentVelocity(1000);
104 assertEquals(0.0f, vt.getXVelocity());
105 assertEqualFuzzy(250.0f, vt.getYVelocity(), 4f);
106 vt.recycle();
116 VelocityTracker vt = VelocityTracker.obtain();
118 drag(vt, 100, 200, 100, 200, 2, t, 100);
119 vt.computeCurrentVelocity(1000);
120 assertEquals(1000.0f, vt.getXVelocity());
121 assertEquals(1000.0f, vt.getYVelocity());
122 vt.recycle();
132 VelocityTracker vt = VelocityTracker.obtain();
133 drag(vt, 100, 200, 100, 200, 10, t, 400); // 10 steps over 400ms
134 vt.computeCurrentVelocity(1);
135 float firstX = vt.getXVelocity();
136 float firstY = vt.getYVelocity();
137 vt.clear();
138 drag(vt, 100, 200, 100, 200, 20, t, 400); // 20 steps over 400ms
139 vt.computeCurrentVelocity(1);
140 float secondX = vt.getXVelocity();
141 float secondY = vt.getYVelocity();
144 vt.recycle();
154 VelocityTracker vt = VelocityTracker.obtain();
155 drag(vt, 100, 200, 100, 200, 10, t, 400);
156 vt.computeCurrentVelocity(1);
157 float firstX = vt.getXVelocity();
158 float firstY = vt.getYVelocity();
159 vt.clear();
160 drag(vt, 100, 200, 100, 200, 10, t + 3600*1000, 400); // on hour later
161 vt.computeCurrentVelocity(1);
162 float secondX = vt.getXVelocity();
163 float secondY = vt.getYVelocity();
166 vt.recycle();
176 VelocityTracker vt = VelocityTracker.obtain();
177 drag(vt, 100, 200, 100, 200, 10, t, 400);
178 vt.computeCurrentVelocity(1);
179 float firstX = vt.getXVelocity();
180 float firstY = vt.getYVelocity();
181 vt.clear();
182 drag(vt, 200, 300, 200, 300, 10, t, 400); // 100px further
183 vt.computeCurrentVelocity(1);
184 float secondX = vt.getXVelocity();
185 float secondY = vt.getYVelocity();
188 vt.recycle();
198 VelocityTracker vt = VelocityTracker.obtain();
199 drag(vt, 100, 200, 100, 200, 10, t, 300);
200 vt.computeCurrentVelocity(1);
201 float firstX = vt.getXVelocity();
202 float firstY = vt.getYVelocity();
203 vt.computeCurrentVelocity(1);
204 float secondX = vt.getXVelocity();
205 float secondY = vt.getYVelocity();
208 vt.recycle();
217 VelocityTracker vt = VelocityTracker.obtain();
218 drag(vt, 100, 200, 100, 200, 10, t, 300);
219 vt.computeCurrentVelocity(1);
220 float firstX = vt.getXVelocity();
221 float firstY = vt.getYVelocity();
222 vt.computeCurrentVelocity(1000);
223 float secondX = vt.getXVelocity();
224 float secondY = vt.getYVelocity();
227 vt.recycle();
234 private void drag(VelocityTracker vt, int startX, int endX, int startY, int endY, int steps,
236 drag(vt, startX, endX, startY, endY, steps, startime, duration, new LinearInterpolator());
243 private void drag(VelocityTracker vt, int startX, int endX, int startY, int endY, int steps,
245 addMotionEvent(vt, startX, startY, startime, MotionEvent.ACTION_DOWN);
254 addMotionEvent(vt, x, y, time, MotionEvent.ACTION_MOVE);
256 addMotionEvent(vt, endX, endY, startime + duration, MotionEvent.ACTION_UP);
259 private void addMotionEvent(VelocityTracker vt, int x, int y, long time, int action) {
261 vt.addMovement(me);