airtest.core.android.rotation module

class RotationWatcher(adb, ori_method='MINICAPORI')[源代码]

基类:object

RotationWatcher class

get_ready()[源代码]
install()[源代码]

Install the RotationWatcher package

返回:None
uninstall()[源代码]

Uninstall the RotationWatcher package

返回:None
setup_server()[源代码]

Setup rotation wacher server

返回:server process
teardown()[源代码]
start()[源代码]

Start the RotationWatcher daemon thread

返回:initial orientation
reg_callback(ow_callback)[源代码]
参数:ow_callback

Returns:

class XYTransformer[源代码]

基类:object

transform the coordinates (x, y) by orientation (upright <–> original)

static up_2_ori(tuple_xy, tuple_wh, orientation)[源代码]

Transform the coordinates upright –> original

参数:
  • tuple_xy – coordinates (x, y)
  • tuple_wh – screen width and height
  • orientation – orientation
返回:

transformed coordinates (x, y)

static ori_2_up(tuple_xy, tuple_wh, orientation)[源代码]

Transform the coordinates original –> upright

参数:
  • tuple_xy – coordinates (x, y)
  • tuple_wh – screen width and height
  • orientation – orientation
返回:

transformed coordinates (x, y)