airtest.core.android.rotation module

class RotationWatcher(adb)[源代码]

基类:object

RotationWatcher class

get_ready(*args, **kwargs)[源代码]
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)