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

The following are Jave code examples for showing how to use setOrientationNatural() 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.
Example 1
Project: SwipeCoordinator   File: UiAutomatorHelper.java   Source Code and License 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: BreadcrumbsView   File: BreadcrumbsActivityTest.java   Source Code and License 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();
  }
}