MCPcopy Create free account
hub / github.com/dtmilano/AndroidViewClient / longTouch

Method longTouch

src/com/dtmilano/android/viewclient.py:4149–4163  ·  view source on GitHub ↗
(self, x=-1, y=-1, selector=None)

Source from the content-addressed store, hash-verified

4147 self.device.touch(x, y)
4148
4149 def longTouch(self, x=-1, y=-1, selector=None):
4150 if self.uiAutomatorHelper:
4151 if selector:
4152 if DEBUG_UI_AUTOMATOR_HELPER:
4153 print("ViewClient: Long-touching View by selector=%s through UiAutomatorHelper" % (selector),
4154 file=sys.stderr)
4155 oid_ref = self.uiAutomatorHelper.ui_device.find_object(by_selector=selector)
4156 self.uiAutomatorHelper.ui_object2.long_click(oid=oid_ref.oid)
4157 else:
4158 if DEBUG_UI_AUTOMATOR_HELPER:
4159 print("ViewClient: Long-touching (%d, %d) through UiAutomatorHelper" % (x, y), file=sys.stderr)
4160 self.uiAutomatorHelper.ui_device.swipe(start_x=int(x), start_y=int(y), end_x=int(x), end_y=int(y),
4161 steps=400)
4162 else:
4163 self.device.longTouch(x, y)
4164
4165 def swipe(self, startX=-1, startY=-1, endX=-1, endY=-1, steps=400, segments=None, segmentSteps=5, start=None,
4166 end=None):

Callers

nothing calls this directly

Calls 4

long_clickMethod · 0.80
find_objectMethod · 0.45
swipeMethod · 0.45
longTouchMethod · 0.45

Tested by

no test coverage detected