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

Method __getY

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

Gets the View Y coordinate

(self)

Source from the content-addressed store, hash-verified

671 return self.getXY()[1]
672
673 def __getY(self):
674 """
675 Gets the View Y coordinate
676 """
677
678 if DEBUG_COORDS:
679 print("getY(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId()), file=sys.stderr)
680 y = 0
681
682 if self.useUiAutomator:
683 y = self.map['bounds'][0][1]
684 else:
685 try:
686 if GET_VISIBILITY_PROPERTY in self.map and self.map[GET_VISIBILITY_PROPERTY] == 'VISIBLE':
687 _y = int(self.map[self.topProperty])
688 if DEBUG_COORDS: print(" getY: VISIBLE adding %d" % _y, file=sys.stderr)
689 y += _y
690 except:
691 warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
692
693 if DEBUG_COORDS: print(" getY: returning %d" % (y), file=sys.stderr)
694 return y
695
696 def getXY(self, debug=False):
697 """

Callers 1

getXYMethod · 0.95

Calls 3

getClassMethod · 0.95
getIdMethod · 0.95
getUniqueIdMethod · 0.95

Tested by

no test coverage detected