コード例 #1
0
  @Override
  public void onPageFinished(WebView view, String url) {
    EBrowserView target = (EBrowserView) view;
    if (url.startsWith("http")) {
      EBrowserWindow bWindow = target.getBrowserWindow();
      WWidgetData wgt = bWindow.getWidget();
      if (1 == wgt.m_webapp) {
        bWindow.hiddenProgress();
      }
    }
    String oUrl = view.getOriginalUrl();
    if (!mReferenceUrl.equals(url) || target.beDestroy() || !url.equals(oUrl)) {
      return;
    }
    ESystemInfo info = ESystemInfo.getIntence();

    int versionA = Build.VERSION.SDK_INT;

    if (!target.isWebApp()) { // 4.3及4.3以下手机
      if (!info.mScaled) {
        float nowScale = 1.0f;

        if (versionA <= 18) {
          nowScale = target.getScale();
        }

        info.mDefaultFontSize = (int) (info.mDefaultFontSize / nowScale);
        info.mScaled = true;
      }

      target.setDefaultFontSize(info.mDefaultFontSize);
    }

    if (!info.mFinished) {
      ((EBrowserActivity) target.getContext()).setContentViewVisible();
    }

    info.mFinished = true;
    target.loadUrl(EUExScript.F_UEX_SCRIPT);
    target.onPageFinished(target, url);

    EBrowserWindow win = target.getBrowserWindow();
    WWidgetData wgt = win.getWidget();

    if (wgt.m_appdebug == 1) {
      String debugUrlString =
          "http://" + wgt.m_logServerIp + ":30060/target/target-script-min.js#anonymous";
      String weinreString =
          "javascript:var x = document.createElement(\"SCRIPT\");x.setAttribute('src',\""
              + debugUrlString
              + "\""
              + ");document.body.appendChild(x);";
      target.loadUrl(weinreString);
    }

    CookieSyncManager.getInstance().sync();
  }
コード例 #2
0
 private boolean bottomCanBounce() {
   float nowScale = 1.0f;
   int versionA = Build.VERSION.SDK_INT;
   if (versionA <= 18) {
     nowScale = mBrwView.getScale();
   }
   int h1 = (int) (mBrwView.getContentHeight() * nowScale);
   int h2 = mBrwView.getScrollY() + mBrwView.getHeight();
   if (h1 <= h2 + 5) {
     return true;
   } else {
     return false;
   }
 }