<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 簡單的半屏swipe 有些場景我們只需要屏幕的小區域進行swipe動作: 1. 使用iOS的'mobile:scroll'進行精確地滾動失敗。 2. 考慮到速度因素:觸摸滾動比任何swipe方法都要快。 (這種情況下)我們可以使用現有的swipe操作,從屏幕中心開始并減少執行的次數。 ```java /** * Performs small swipe from the center of screen * * @param dir the direction of swipe * @version java-client: 7.3.0 **/ public void swipeScreenSmall(Direction dir) { System.out.println("swipeScreenSmall(): 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 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); // reduce swipe move into multiplier times comparing to swipeScreen move int mult = 10; // multiplier switch (dir) { case DOWN: // center of footer pointOptionEnd = PointOption.point(dims.width / 2, (dims.height / 2) + (dims.height / 2) / mult); break; case UP: // center of header pointOptionEnd = PointOption.point(dims.width / 2, (dims.height / 2) - (dims.height / 2) / mult); break; case LEFT: // center of left side pointOptionEnd = PointOption.point((dims.width / 2) - (dims.width / 2) / mult, dims.height / 2); break; case RIGHT: // center of right side pointOptionEnd = PointOption.point((dims.width / 2) + (dims.width / 2) / mult, dims.height / 2); break; default: throw new IllegalArgumentException("swipeScreenSmall(): dir: '" + dir.toString() + "' 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("swipeScreenSmall(): TouchAction FAILED\n" + e.getMessage()); return; } // always allow swipe action to complete try { Thread.sleep(ANIMATION_TIME); } catch (InterruptedException e) { // ignore } } ```
                  <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>

                              哎呀哎呀视频在线观看