Constructor @type _map: map @param _map: the map containing the (attribute, value) pairs @type device: AdbClient @param device: the device containing this View @type version: int @param version: the Android SDK version number of the platform
(self, _map, device, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None)
| 243 | return 'android.widget.View' |
| 244 | |
| 245 | def __init__(self, _map, device, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None): |
| 246 | """ |
| 247 | Constructor |
| 248 | |
| 249 | @type _map: map |
| 250 | @param _map: the map containing the (attribute, value) pairs |
| 251 | @type device: AdbClient |
| 252 | @param device: the device containing this View |
| 253 | @type version: int |
| 254 | @param version: the Android SDK version number of the platform where this View belongs. If |
| 255 | this is C{-1} then the Android SDK version will be obtained in this |
| 256 | constructor. |
| 257 | @type forceviewserveruse: boolean |
| 258 | @param forceviewserveruse: Force the use of C{ViewServer} even if the conditions were given |
| 259 | to use C{UiAutomator}. |
| 260 | @type uiAutomatorHelper: UiAutomatorHelper |
| 261 | @:param uiAutomatorHelper: The UiAutomatorHelper if available |
| 262 | """ |
| 263 | |
| 264 | if DEBUG_VIEW: |
| 265 | print("☣️ View.__init__(%s, %s, %s, %s)" % ( |
| 266 | "map" if _map is not None else None, device, version, forceviewserveruse), file=sys.stderr) |
| 267 | if _map: |
| 268 | print(" map:", type(_map), file=sys.stderr) |
| 269 | for attr, val in _map.items(): |
| 270 | try: |
| 271 | if val and len(val) > 50: |
| 272 | val = val[:50] + "..." |
| 273 | except TypeError: |
| 274 | pass |
| 275 | print(" %s=%s" % (attr, val), file=sys.stderr) |
| 276 | self.map = _map |
| 277 | ''' The map that contains the C{attr},C{value} pairs ''' |
| 278 | self.device = device |
| 279 | ''' The AdbClient ''' |
| 280 | self.children = [] |
| 281 | ''' The children of this View ''' |
| 282 | self.parent = None |
| 283 | ''' The parent of this View ''' |
| 284 | self.windows = {} |
| 285 | self.currentFocus = None |
| 286 | ''' The current focus ''' |
| 287 | self.windowId = windowId |
| 288 | ''' The window this view resides ''' |
| 289 | self.build = {} |
| 290 | ''' Build properties ''' |
| 291 | self.version = version |
| 292 | ''' API version number ''' |
| 293 | self.forceviewserveruse = forceviewserveruse |
| 294 | ''' Force ViewServer use ''' |
| 295 | self.uiScrollable = None |
| 296 | ''' If this is a scrollable View this keeps the L{UiScrollable} object ''' |
| 297 | self.target = False |
| 298 | ''' Is this a touch target zone ''' |
| 299 | self.uiAutomatorHelper = uiAutomatorHelper |
| 300 | ''' The UiAutomatorHelper ''' |
| 301 | self.ui_automator_helper_node: Optional[WindowHierarchyChild] = None |
| 302 |
no test coverage detected