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

Method __getX

src/com/dtmilano/android/viewclient.py:643–664  ·  view source on GitHub ↗

Gets the View X coordinate

(self)

Source from the content-addressed store, hash-verified

641 return self.getXY()[0]
642
643 def __getX(self):
644 """
645 Gets the View X coordinate
646 """
647
648 if DEBUG_COORDS:
649 print("getX(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId()), file=sys.stderr)
650 x = 0
651
652 if self.useUiAutomator:
653 x = self.map['bounds'][0][0]
654 else:
655 try:
656 if GET_VISIBILITY_PROPERTY in self.map and self.map[GET_VISIBILITY_PROPERTY] == 'VISIBLE':
657 _x = int(self.map[self.leftProperty])
658 if DEBUG_COORDS: print(" getX: VISIBLE adding %d" % _x, file=sys.stderr)
659 x += _x
660 except:
661 warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
662
663 if DEBUG_COORDS: print(" getX: returning %d" % (x), file=sys.stderr)
664 return x
665
666 def getY(self):
667 """

Callers 1

getXYMethod · 0.95

Calls 3

getClassMethod · 0.95
getIdMethod · 0.95
getUniqueIdMethod · 0.95

Tested by

no test coverage detected