@@ -248,20 +248,19 @@ private static GestureDescription createClick (PointF clickPoint, long duration)
248
248
return clickBuilder .build ();
249
249
}
250
250
251
- private GestureDescription createSwipe (PointF originPoint , int direction , int momentum ) {
252
- final int DURATION = scrollSpeed + 20 ;
253
- Path clickPath = new Path ();
254
- PointF lineDirection = new PointF (originPoint .x + (momentum + 75 ) * PointerControl .dirX [direction ], originPoint .y + (momentum + 75 ) * PointerControl .dirY [direction ]);
251
+ private void createSwipe (PointF originPoint , int direction , int momentum ) {
255
252
253
+ final int DURATION = 300 - scrollSpeed *10 ;
254
+ Path clickPath = new Path ();
255
+ PointF lineDirection = new PointF (originPoint .x + (75 + momentum ) * PointerControl .dirX [direction ], originPoint .y + (75 +momentum ) * PointerControl .dirY [direction ]);
256
256
mService .shellSwipe ((int ) originPoint .x , (int ) originPoint .y , (int ) lineDirection .x , (int ) lineDirection .y , DURATION );
257
257
258
- clickPath .moveTo (originPoint .x , originPoint .y );
259
- clickPath .lineTo (lineDirection .x , lineDirection .y );
260
- GestureDescription .StrokeDescription clickStroke =
261
- new GestureDescription .StrokeDescription (clickPath , 0 , DURATION );
262
- GestureDescription .Builder clickBuilder = new GestureDescription .Builder ();
263
- clickBuilder .addStroke (clickStroke );
264
- return clickBuilder .build ();
258
+ try {
259
+ Thread .sleep (DURATION + 200 );
260
+ } catch (InterruptedException e ) {
261
+ Log .e (LOG_TAG , "Thread interrupted: " ,e );
262
+ }
263
+
265
264
}
266
265
267
266
public boolean perform (KeyEvent keyEvent ) {
0 commit comments