Пример #1
0
 private void waitForMenuOpen() {
   WaitHelper.waitFor(
       "menu to open",
       new Condition() {
         @Override
         public boolean isSatisfied() {
           return isMenuOpen();
         }
       });
 }
Пример #2
0
 public TextInput waitForInputConnection() {
   WaitHelper.waitFor(
       "current view to have an active InputConnection",
       new Condition() {
         @Override
         public boolean isSatisfied() {
           return hasInputConnection();
         }
       });
   return this;
 }
Пример #3
0
 public TextInput waitForActive() {
   WaitHelper.waitFor(
       "current view to become the active input view",
       new Condition() {
         @Override
         public boolean isSatisfied() {
           return isActive();
         }
       });
   return this;
 }
Пример #4
0
  /**
   * Opens the "More" options menu on legacy Android devices. Assumes the base menu (i.e. {@link
   * #openAppMenu()}) has already been called and thus the menu is open.
   */
  private void openLegacyMoreMenu() {
    fAssertTrue("The base menu is already open", isMenuOpen());

    // Since there may be more views with "More" on the screen,
    // this is not robust. However, there may not be a better way.
    mSolo.clickOnText("^More$");

    WaitHelper.waitFor(
        "legacy \"More\" menu to open",
        new Condition() {
          @Override
          public boolean isSatisfied() {
            return isLegacyMoreMenuOpen();
          }
        });
  }