Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added delay between DOWN and UP
  • Loading branch information
dtmilano committed Oct 12, 2012
1 parent 60c6c0d commit 8f6f781
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions AndroidViewClient/src/com/dtmilano/android/viewclient.py
Expand Up @@ -26,6 +26,7 @@
import os import os
import java import java
import types import types
import time
import warnings import warnings
from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner


Expand All @@ -34,7 +35,7 @@
DEBUG_TREE = DEBUG and True DEBUG_TREE = DEBUG and True
DEBUG_GETATTR = DEBUG and False DEBUG_GETATTR = DEBUG and False
DEBUG_COORDS = DEBUG and True DEBUG_COORDS = DEBUG and True
DEBUG_TOUCH = DEBUG and True DEBUG_TOUCH = DEBUG and True or True
DEBUG_STATUSBAR = DEBUG and True DEBUG_STATUSBAR = DEBUG and True
DEBUG_WINDOWS = DEBUG and True DEBUG_WINDOWS = DEBUG and True


Expand Down Expand Up @@ -570,7 +571,14 @@ def touch(self, type=MonkeyDevice.DOWN_AND_UP):
(x, y) = self.getCenter() (x, y) = self.getCenter()
if DEBUG_TOUCH: if DEBUG_TOUCH:
print >>sys.stderr, "should touch @ (%d, %d)" % (x, y) print >>sys.stderr, "should touch @ (%d, %d)" % (x, y)
self.device.touch(x, y, type) if type == MonkeyDevice.DOWN_AND_UP:
if WARNINGS:
print >> sys.stderr, "ViewClient: touch workaround enabled"
self.device.touch(x, y, MonkeyDevice.DOWN)
time.sleep(50/1000.0)
self.device.touch(x+10, y+10, MonkeyDevice.UP)
else:
self.device.touch(x, y, type)


def allPossibleNamesWithColon(self, name): def allPossibleNamesWithColon(self, name):
l = [] l = []
Expand Down

0 comments on commit 8f6f781

Please sign in to comment.