<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 簡單的屏幕swipe Swipe操作有起始和終止點。起始點位置很重要。以下元素可能會阻止swipe動作生效: - 應用接口/菜單,例如 頁眉(header)或頁腳(footer)。 - 等待被觸碰(tap)的元素并沒有將touch事件傳遞給滾動視圖 最好從屏幕中間開始swipe動作以獲取更穩定的效果。 ![swipe_screen](https://img.kancloud.cn/55/43/5543b45c2377ac373ccec935e40af67e_116x226.png) ```java /** * Performs swipe from the center of screen * * @param dir the direction of swipe * @version java-client: 7.3.0 **/ public void swipeScreen(Direction dir) { System.out.println("swipeScreen(): dir: '" + dir + "'"); // always log your actions // Animation default time: // - Android: 300 ms // - iOS: 200 ms // final value depends on your app and could be greater final int ANIMATION_TIME = 200; // ms final int PRESS_TIME = 200; // ms int edgeBorder = 10; // better avoid edges PointOption pointOptionStart, pointOptionEnd; // init screen variables Dimension dims = driver.manage().window().getSize(); // init start point = center of screen pointOptionStart = PointOption.point(dims.width / 2, dims.height / 2); switch (dir) { case DOWN: // center of footer pointOptionEnd = PointOption.point(dims.width / 2, dims.height - edgeBorder); break; case UP: // center of header pointOptionEnd = PointOption.point(dims.width / 2, edgeBorder); break; case LEFT: // center of left side pointOptionEnd = PointOption.point(edgeBorder, dims.height / 2); break; case RIGHT: // center of right side pointOptionEnd = PointOption.point(dims.width - edgeBorder, dims.height / 2); break; default: throw new IllegalArgumentException("swipeScreen(): dir: '" + dir + "' NOT supported"); } // execute swipe using TouchAction try { new TouchAction(driver) .press(pointOptionStart) // a bit more reliable when we add small wait .waitAction(WaitOptions.waitOptions(Duration.ofMillis(PRESS_TIME))) .moveTo(pointOptionEnd) .release().perform(); } catch (Exception e) { System.err.println("swipeScreen(): TouchAction FAILED\n" + e.getMessage()); return; } // always allow swipe action to complete try { Thread.sleep(ANIMATION_TIME); } catch (InterruptedException e) { // ignore } } public enum Direction { UP, DOWN, LEFT, RIGHT; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看