airtest.core.android.rotation module

class RotationWatcher(adb)[source]

Bases: object

RotationWatcher class

get_ready(*args, **kwargs)[source]
teardown()[source]
start()[source]

Start the RotationWatcher daemon thread

Returns:initial orientation
reg_callback(ow_callback)[source]
Parameters:ow_callback

Returns:

class XYTransformer[source]

Bases: object

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

static up_2_ori(tuple_xy, tuple_wh, orientation)[source]

Transform the coordinates upright –> original

Parameters:
  • tuple_xy – coordinates (x, y)
  • tuple_wh – screen width and height
  • orientation – orientation
Returns:

transformed coordinates (x, y)

static ori_2_up(tuple_xy, tuple_wh, orientation)[source]

Transform the coordinates original –> upright

Parameters:
  • tuple_xy – coordinates (x, y)
  • tuple_wh – screen width and height
  • orientation – orientation
Returns:

transformed coordinates (x, y)