airtest.core.android.rotation module

class RotationWatcher(adb, ori_method='MINICAPORI')[source]

Bases: object

RotationWatcher class

get_ready()[source]
install()[source]

Install the RotationWatcher package

Returns:

None

uninstall()[source]

Uninstall the RotationWatcher package

Returns:

None

setup_server()[source]

Setup rotation wacher server

Returns:

server process

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)