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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Pinch ~~~ package io.appium.android.bootstrap.handler; import com.android.uiautomator.core.UiObjectNotFoundException; import io.appium.android.bootstrap.*; import org.json.JSONException; import java.util.Hashtable; /** * This handler is used to pinch in/out elements in the Android UI. * * Based on the element Id, pinch in/out that element. * */ public class Pinch extends CommandHandler { /* * @param command The {@link AndroidCommand} used for this handler. * * @return {@link AndroidCommandResult} * * @throws JSONException * * @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android. * bootstrap.AndroidCommand) */ @Override public AndroidCommandResult execute(final AndroidCommand command) throws JSONException { final Hashtable<String, Object> params = command.params(); AndroidElement el; final String direction = params.get("direction").toString(); final Integer percent = (Integer) params.get("percent"); final Integer steps = (Integer) params.get("steps"); try { el = command.getElement(); if (el == null) { return getErrorResult("Could not find an element with elementId: " + params.get("elementId")); } } catch (final Exception e) { // JSONException, NullPointerException, etc. return getErrorResult("Unknown error:" + e.getMessage()); } Logger.debug("Pinching " + direction + " " + percent.toString() + "%" + " with steps: " + steps.toString()); boolean res; if (direction.equals("in")) { try { res = el.pinchIn(percent, steps); } catch (final UiObjectNotFoundException e) { return getErrorResult("Selector could not be matched to any UI element displayed"); } } else { try { res = el.pinchOut(percent, steps); } catch (final UiObjectNotFoundException e) { return getErrorResult("Selector could not be matched to any UI element displayed"); } } if (res) { return getSuccessResult(res); } else { return getErrorResult("Pinch did not complete successfully"); } } } ~~~ 了解2個概念:pinchIn和pinchOut。 ![](https://box.kancloud.cn/2016-01-08_568f4d18d31ea.jpg) 2個手指同時按住A和B,同時將A滑向A1,B滑向B1,稱為pinchIn 2個手指同時按住A1和B1,同時將A1滑向A,B1滑向B,成為pinchOut. 那么Pinch類就是接受這一指令的,傳入的參數有方向direction,percent代表滑到對角線百分之幾停止,steps代表滑到時間,一個step代表5毫秒。根據direction來判斷是調用UiObject.pinchIn和UiObject.pinchOut.
                  <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>

                              哎呀哎呀视频在线观看