uiautomator中InteractionController学习笔记(8)

4.1版本号


InteractionController将用户的键盘事件注入到android系统中,与系统进行交互(电视为什么不能设计成可组装,屏幕多大自己决定,想 多大就多大)


click(int,int)


在某点点击。


clickAndWaitForNewWindow(int,int,long)


点击某点,得带界面信息变化


freezeRotation()/unFreezeRotation()/isNaturalRotation()/setRotationLeft()/setRotationNatural()/setRotationRight()


这些方法在UiDevice里相同存在,名称也是一样的。不再解释,能够返回UiDevice參考。


getSystemLongPressTime()


通过ContentProvider从系统中获得长安时间


injectEventSync(InputEvent)


将用户的输入时间注入到系统中


isScreenOn()


推断屏幕是后点亮


longTap(int,int)


长按某一点


scrollSwipe(int,int,int,int,int)


sendKey(int,int)


发送键盘事件


sentText(String)


发送字符串


sleepDevice()/wakeDevice()


假设屏幕是亮的,则按power键让屏幕休眠/与sleep相反


swipe(Point[],int)


与UiDevice同样


swipe(int,int,int,int,int)


与UiDevice同样


touchDown(int,int)/touchMove(int,int)/touchUp(int,int)


按下/拖动/抬起。




原文地址:https://www.cnblogs.com/lxjshuju/p/7055702.html