示例#1
0
 @Override
 public void onPageStarted(WebView view, String url, Bitmap favicon) {
   mIsPageOnload = false;
   if (view == null) {
     return;
   }
   EBrowserView target = (EBrowserView) view;
   target.onPageStarted(target, url);
   if (null != mParms) {
     target.setQuery(mParms);
   }
   mParms = null;
   ESystemInfo info = ESystemInfo.getIntence();
   if (info.mFinished) {
     info.mScaled = true;
   }
   if (url != null) {
     mReferenceUrl = url;
     if (url.startsWith("http")) {
       EBrowserWindow bWindow = target.getBrowserWindow();
       if (bWindow != null && 1 == bWindow.getWidget().m_webapp) {
         bWindow.showProgress();
       }
     }
   }
 }
示例#2
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();
  }
示例#3
0
 @Override
 public void onPageStarted(WebView view, String url, Bitmap favicon) {
   EBrowserView target = (EBrowserView) view;
   mReferenceUrl = url;
   target.onPageStarted(target, url);
   if (null != mParms) {
     target.setQuery(mParms);
   }
   mParms = null;
   ESystemInfo info = ESystemInfo.getIntence();
   if (info.mFinished) {
     info.mScaled = true;
   }
   if (url.startsWith("http")) {
     EBrowserWindow bWindow = target.getBrowserWindow();
     WWidgetData wgt = bWindow.getWidget();
     if (1 == wgt.m_webapp) {
       bWindow.showProgress();
     }
   }
 }