Gets the View Y coordinate
(self)
| 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 | """ |
no test coverage detected