Fixing icon dragging
Bug: 129434166 Change-Id: Id2e5509dbfbdb76ec868ca6117c2a0c0d5233404
This commit is contained in:
1 parent
1f457ae87f
commit
b3e2cd3d88
1 file changed
+2
-1
@@ -598,11 +598,12 @@ public final class LauncherInstrumentation {
|
|||||||
|
|
||||||
void movePointer(long downTime, long duration, Point from, Point to) {
|
void movePointer(long downTime, long duration, Point from, Point to) {
|
||||||
final Point point = new Point();
|
final Point point = new Point();
|
||||||
|
final long startTime = SystemClock.uptimeMillis();
|
||||||
for (; ; ) {
|
for (; ; ) {
|
||||||
sleep(16);
|
sleep(16);
|
||||||
|
|
||||||
final long currentTime = SystemClock.uptimeMillis();
|
final long currentTime = SystemClock.uptimeMillis();
|
||||||
final float progress = (currentTime - downTime) / (float) duration;
|
final float progress = (currentTime - startTime) / (float) duration;
|
||||||
if (progress > 1) return;
|
if (progress > 1) return;
|
||||||
|
|
||||||
point.x = from.x + (int) (progress * (to.x - from.x));
|
point.x = from.x + (int) (progress * (to.x - from.x));
|
||||||
|
|||||||
Reference in new issue
Block a user