Skip to content

Commit

Permalink
Merge pull request #325 from gchai/master
Browse files Browse the repository at this point in the history
Added documentation to drag functions
  • Loading branch information
dtmilano authored Feb 27, 2024
2 parents 8a1994a + e381876 commit 5396879
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/com/dtmilano/android/adb/adbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,8 @@ def imageToData(self, image, output_type=None):
output_type = pytesseract.Output.DICT
return pytesseract.image_to_data(image, output_type=output_type)

def __transformPointByOrientation(self, xxx_todo_changeme, orientationOrig, orientationDest):
(x, y) = xxx_todo_changeme
def __transformPointByOrientation(self, initPoint, orientationOrig, orientationDest):
(x, y) = initPoint
if orientationOrig != orientationDest:
if orientationDest == 1:
_x = x
Expand Down Expand Up @@ -1075,7 +1075,7 @@ def longTouch(self, x, y, duration=2000, orientation=-1):
self.__checkTransport()
self.drag((x, y), (x, y), duration, orientation)

def drag(self, xxx_todo_changeme1, xxx_todo_changeme2, duration, steps=1, orientation=-1):
def drag(self, startCoords, endCoords, duration, steps=1, orientation=-1):
"""
Sends drag event in PX (actually it's using C{input swipe} command).
Expand All @@ -1085,8 +1085,8 @@ def drag(self, xxx_todo_changeme1, xxx_todo_changeme2, duration, steps=1, orient
@param steps: number of steps (currently ignored by C{input swipe})
@param orientation: the orientation (-1: undefined)
"""
(x0, y0) = xxx_todo_changeme1
(x1, y1) = xxx_todo_changeme2
(x0, y0) = startCoords
(x1, y1) = endCoords
self.__checkTransport()
if orientation == -1:
orientation = self.display['orientation']
Expand All @@ -1101,7 +1101,7 @@ def drag(self, xxx_todo_changeme1, xxx_todo_changeme2, duration, steps=1, orient
else:
self.shell('input touchscreen swipe %d %d %d %d %d' % (x0, y0, x1, y1, duration))

def dragDip(self, xxx_todo_changeme3, xxx_todo_changeme4, duration, steps=1, orientation=-1):
def dragDip(self, startCoords, endCoords, duration, steps=1, orientation=-1):
"""
Sends drag event in DIP (actually it's using C{input swipe} command.
Expand All @@ -1110,8 +1110,8 @@ def dragDip(self, xxx_todo_changeme3, xxx_todo_changeme4, duration, steps=1, ori
@param duration: duration of the event in ms
@param steps: number of steps (currently ignored by C{input swipe})
"""
(x0, y0) = xxx_todo_changeme3
(x1, y1) = xxx_todo_changeme4
(x0, y0) = startCoords
(x1, y1) = endCoords
self.__checkTransport()
if orientation == -1:
orientation = self.display['orientation']
Expand Down

0 comments on commit 5396879

Please sign in to comment.