Java Code Examples for android.support.test.uiautomator.UiDevice.setOrientationLeft()

The following are Jave code examples for showing how to use setOrientationLeft() of the android.support.test.uiautomator.UiDevice class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SwipeCoordinator   File: UiAutomatorHelper.java   View Source Code Vote up 5 votes
static void rotateDevice() {
  UiDevice uiDevice = UiDevice
      .getInstance(InstrumentationRegistry.getInstrumentation());
  try {
    uiDevice.setOrientationLeft();
    waitTime();
    uiDevice.setOrientationNatural();
    waitTime();
  } catch (RemoteException e) {
    e.printStackTrace();
  }
}
 
Example 2
Project: android-testing-guide   File: MainActivityTest.java   View Source Code Vote up 5 votes
@Test
public void testUiDevice() throws RemoteException {
    UiDevice device = UiDevice.getInstance(
            InstrumentationRegistry.getInstrumentation());
    if (device.isScreenOn()) {
        device.setOrientationLeft();
        device.openNotification();
    }
}
 
Example 3
Project: BreadcrumbsView   File: BreadcrumbsActivityTest.java   View Source Code Vote up 5 votes
private void rotateDevice() {
  try {
    UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
    uiDevice.setOrientationLeft();
    waitTime();
    uiDevice.setOrientationNatural();
    waitTime();
  } catch (RemoteException e) {
    e.printStackTrace();
  }
}