示例#1
0
 public void goBack()
 {
   if (this.webView != null)
   {
     String str = WebViewPlayer.getInstance().getBackPolicy();
     if ((str != null) && (!str.equalsIgnoreCase("")))
     {
       this.webView.loadUrl(str);
       WebViewPlayer.getInstance().setbackPolicy(null);
     }
   }
   else
   {
     return;
   }
   this.webView.goBack();
 }
示例#2
0
 public boolean canBack()
 {
   if (this.webView != null)
   {
     String str = WebViewPlayer.getInstance().getBackPolicy();
     if ((str != null) && (!str.equalsIgnoreCase("")))
       return true;
   }
   return false;
 }
示例#3
0
 public boolean onTouchEvent(MotionEvent paramMotionEvent)
 {
   Log.e("groupwebview", "" + WebViewPlayer.getInstance().mPreventParentTouch);
   boolean bool = super.onTouchEvent(paramMotionEvent);
   if (WebViewPlayer.getInstance().mPreventParentTouch)
     switch (paramMotionEvent.getAction())
     {
     default:
     case 2:
     case 1:
     case 3:
     }
   while (true)
   {
     return bool;
     requestDisallowInterceptTouchEvent(true);
     return true;
     requestDisallowInterceptTouchEvent(false);
     WebViewPlayer.getInstance().mPreventParentTouch = false;
   }
 }
示例#4
0
  @TargetApi(18)
  protected void init()
  {
    try
    {
      this.webView = new MyWebView(this.mContext);
      WebSettings localWebSettings = this.webView.getSettings();
      if (localWebSettings != null)
      {
        localWebSettings.setJavaScriptEnabled(true);
        localWebSettings.setUserAgentString("Android-QingtingFM Mozilla/5.0 (Linux; U; Android 4.4.0; zh-cn; MB200 Build/GRJ22;) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
        localWebSettings.setSupportZoom(true);
        localWebSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        localWebSettings.setCacheMode(2);
        localWebSettings.setJavaScriptCanOpenWindowsAutomatically(true);
      }
      WebViewPlayer.getInstance().setbackPolicy(null);
      this.webView.addJavascriptInterface(WebViewPlayer.getInstance(), "QTJsPlayer");
      this.webView.addJavascriptInterface(WebViewFunc.getInstance(), "QTJsReserve");
      this.webView.setWebChromeClient(new WebChromeClient()
      {
        public boolean onJsAlert(WebView paramAnonymousWebView, String paramAnonymousString1, String paramAnonymousString2, JsResult paramAnonymousJsResult)
        {
          AlertDialog.Builder localBuilder = new AlertDialog.Builder(paramAnonymousWebView.getContext());
          localBuilder.setTitle("蜻蜓提示").setMessage(paramAnonymousString2).setPositiveButton("确定", null);
          localBuilder.setCancelable(false);
          localBuilder.create().show();
          paramAnonymousJsResult.confirm();
          return true;
        }

        public void onProgressChanged(WebView paramAnonymousWebView, int paramAnonymousInt)
        {
          if (paramAnonymousInt > 70)
            GroupWebView.this.removeLoading();
        }

        public void onReceivedTitle(WebView paramAnonymousWebView, String paramAnonymousString)
        {
        }
      });
      this.webView.setHorizontalScrollBarEnabled(false);
      this.webView.setVerticalScrollBarEnabled(false);
      this.webView.setWebViewClient(this.webViewClient);
      this.webView.loadUrl(getUrl());
      this.webView.setDownloadListener(new DownloadListener()
      {
        public void onDownloadStart(String paramAnonymousString1, String paramAnonymousString2, String paramAnonymousString3, String paramAnonymousString4, long paramAnonymousLong)
        {
          Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse(paramAnonymousString1));
          GroupWebView.this.getContext().startActivity(localIntent);
        }
      });
      WebViewPlayer.getInstance().setWebview(this.webView);
      WebViewFunc.getInstance().setWebview(this.webView);
      LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -1);
      addView(this.webView, localLayoutParams);
      return;
    }
    catch (Exception localException)
    {
    }
  }