Package com :: Package dtmilano :: Package android :: Module viewclient :: Class View |
[hide private]
[frames] | no frames]

# Class View

source code

View class

Instance Methods | [hide private]
__init__(self, _map, device, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None) Constructor | source code
__getitem__(self, key) | source code
__getattr__(self, name) | source code
__call__(self, *args, **kwargs) | source code
getClass(self) Gets the View class | source code
getId(self) Gets the View Id | source code
getContentDescription(self) Gets the content description. | source code
getTag(self) Gets the tag. | source code
getParent(self) Gets the parent. | source code
getChildren(self) Gets the children of this View. | source code
getText(self) Gets the text attribute. | source code
getHeight(self) Gets the height. | source code
getWidth(self) Gets the width. | source code
getUniqueId(self) Gets the unique Id of this View. | source code
getVisibility(self) Gets the View visibility | source code
getX(self) Gets the View X coordinate | source code
__getX(self) Gets the View X coordinate | source code
getY(self) Gets the View Y coordinate | source code
__getY(self) Gets the View Y coordinate | source code
getXY(self, debug=False) Returns the screen coordinates of this `View`. | source code
getCoords(self) Gets the coords of the View | source code
getPositionAndSize(self) Gets the position and size (X,Y, W, H) | source code
getBounds(self) Gets the View bounds | source code
getCenter(self) Gets the center coords of the View | source code
__obtainStatusBarDimensionsIfVisible(self) | source code
__obtainVxVy(self, m) | source code
__obtainVwVh(self, m) | source code
__obtainPxPy(self, m) | source code
__dumpWindowsInformation(self, debug=False) | source code
touch(self, eventType=2, deltaX=0, deltaY=0) Touches the center of this `View`. | source code
escapeSelectorChars(self, selector) | source code
obtainSelectorForView(self) | source code
longTouch(self, duration=2000) Long touches this `View` | source code
allPossibleNamesWithColon(self, name) | source code
intersection(self, l1, l2) | source code
containsPoint(self, (x, y)) | source code
add(self, child) Adds a child | source code
isClickable(self) | source code
isFocused(self) Gets the focused value | source code
variableNameFromId(self) | source code
setTarget(self, target) | source code
isTarget(self) | source code
writeImageToFile(self, filename, _format=`'``PNG``'`) Write the View image to the specified filename in the specified format. | source code
__smallStr__(self) | source code
__tinyStr__(self) | source code
__microStr__(self) | source code
__str__(self) | source code

Class Methods | [hide private]
__copy(cls, view) Copy constructor | source code

Static Methods | [hide private]
factory(arg1, arg2, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None) View factory | source code

Instance Variables | [hide private]
| map The map that contains the `attr`,`value` pairs
| device The AdbClient
| children The children of this View
| parent The parent of this View
| currentFocus The current focus
| windowId The window this view resides
| build Build properties
| version API version number
| forceviewserveruse Force ViewServer use
| uiScrollable If this is a scrollable View this keeps the UiScrollable object
| target Is this a touch target zone
| uiAutomatorHelper The UiAutomatorHelper
| useUiAutomator Whether to use UIAutomator or ViewServer
| idProperty The id property depending on the View attribute format
| textProperty The text property depending on the View attribute format
| tagProperty The tag property depending on the View attribute format
| leftProperty The left property depending on the View attribute format
| topProperty The top property depending on the View attribute format
| widthProperty The width property depending on the View attribute format
| heightProperty The height property depending on the View attribute format
| isFocusedProperty The focused property depending on the View attribute format

Method Details | [hide private]

### factory(arg1, arg2, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None) Static Method | source code
View factory Parameters: `arg1` (ClassType or dict) `arg2` (View instance or AdbClient)

### __init__(self, _map, device, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None) (Constructor) | source code
Constructor Parameters: `_map` (map) - the map containing the (attribute, value) pairs `device` (AdbClient) - the device containing this View `version` (int) - the Android SDK version number of the platform where this View belongs. If this is `-1` then the Android SDK version will be obtained in this constructor. `forceviewserveruse` (boolean) - Force the use of `ViewServer` even if the conditions were given to use `UiAutomator`. `uiAutomatorHelper` (UiAutomatorHelper @:param uiAutomatorHelper: The UiAutomatorHelper if available)

### getClass(self) | source code
Gets the View class Returns: the View class or `None` if not defined

### getId(self) | source code
Gets the View Id Returns: the View `Id` or `None` if not defined See Also: getUniqueId()

### getText(self) | source code
Gets the text attribute. Returns: the text attribute or `None` if not defined

### getUniqueId(self) | source code
Gets the unique Id of this View. See Also: ViewClient.__splitAttrs() for a discussion on Unique Ids

### getXY(self, debug=False) | source code
Returns the screen coordinates of this `View`. WARNING: Don't call self.getX() or self.getY() inside this method or it will enter an infinite loop Returns: The screen coordinates of this `View`

### getCoords(self) | source code
Gets the coords of the View Returns: A tuple containing the View's coordinates ((L, T), (R, B))

### getPositionAndSize(self) | source code
Gets the position and size (X,Y, W, H) Returns: A tuple containing the View's coordinates (X, Y, W, H)

### getCenter(self) | source code
Gets the center coords of the View Author: Dean Morin

### touch(self, eventType=2, deltaX=0, deltaY=0) | source code
Touches the center of this `View`. The touch can be displaced from the center by using `deltaX` and `deltaY` values. Parameters: `eventType` (adbclient.DOWN, adbclient.UP or adbclient.DOWN_AND_UP) - The event type `deltaX` (int) - Displacement from center (X axis) `deltaY` (int) - Displacement from center (Y axis)

### longTouch(self, duration=2000) | source code
Long touches this `View` Parameters: `duration` - duration in ms

### add(self, child) | source code
Adds a child Parameters: `child` (View) - The child to add

### isFocused(self) | source code
Gets the focused value Returns: the focused value. If the property cannot be found returns `False`

### writeImageToFile(self, filename, _format=`'``PNG``'`) | source code
Write the View image to the specified filename in the specified format. Parameters: `filename` (str) - Absolute path and optional filename receiving the image. If this points to a directory, then the filename is determined by this View unique ID and format extension. `_format` (str) - Image format (default format is PNG)