当前位置: 首页>>代码示例>>Java>>正文


Java WebChromeClient类代码示例

本文整理汇总了Java中com.tencent.smtt.sdk.WebChromeClient的典型用法代码示例。如果您正苦于以下问题:Java WebChromeClient类的具体用法?Java WebChromeClient怎么用?Java WebChromeClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebChromeClient类属于com.tencent.smtt.sdk包,在下文中一共展示了WebChromeClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
private WebChromeClient getChromeClient() {
    IndicatorController mIndicatorController = (this.mIndicatorController == null) ? IndicatorHandler.getInstance().inJectProgressView(mWebCreator.offer()) : this.mIndicatorController;

    DefaultChromeClient mDefaultChromeClient =
            new DefaultChromeClient(this.mActivity, this.mIndicatorController = mIndicatorController, this.mWebChromeClient, this.mChromeClientCallbackManager, this.mIVideo = getIVideo(), mDefaultMsgConfig.getChromeClientMsgCfg(), this.mPermissionInterceptor, mWebCreator.get());

    LogUtils.i(TAG, "WebChromeClient:" + this.mWebChromeClient);
    MiddleWareWebChromeBase header = this.mMiddleWareWebChromeBaseHeader;
    if (header != null) {
        MiddleWareWebChromeBase tail = header;
        int count = 1;
        MiddleWareWebChromeBase tmp = header;
        while (tmp.next() != null) {
            tail = tmp = tmp.next();
            count++;
        }
        LogUtils.i(TAG, "MiddleWareWebClientBase middleware count:" + count);
        tail.setWebChromeClient(mDefaultChromeClient);
        return this.mTargetChromeClient = header;
    } else {
        return this.mTargetChromeClient = mDefaultChromeClient;
    }
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:24,代码来源:AgentWebX5.java

示例2: DefaultChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
DefaultChromeClient(Activity activity,
                    IndicatorController indicatorController,
                    WebChromeClient chromeClient,
                    ChromeClientCallbackManager chromeClientCallbackManager,
                    @Nullable IVideo iVideo,
                    DefaultMsgConfig.ChromeClientMsgCfg chromeClientMsgCfg, PermissionInterceptor permissionInterceptor, WebView webView) {
    super( chromeClient);
    this.mIndicatorController=indicatorController;
    isWrapper = chromeClient != null ? true : false;
    this.mWebChromeClient = chromeClient;
    mActivityWeakReference = new WeakReference<Activity>(activity);
    this.mChromeClientCallbackManager = chromeClientCallbackManager;
    this.mIVideo = iVideo;
    this.mChromeClientMsgCfg = chromeClientMsgCfg;
    this.mPermissionInterceptor = permissionInterceptor;
    this.mWebView = webView;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:18,代码来源:DefaultChromeClient.java

示例3: RichEditor

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@SuppressLint("SetJavaScriptEnabled")
public RichEditor(Context context, AttributeSet attrs, int defStyleAttr) {
  super(context, attrs, defStyleAttr);

  setVerticalScrollBarEnabled(false);
  setHorizontalScrollBarEnabled(false);
  getSettings().setJavaScriptEnabled(true);
  setWebChromeClient(new WebChromeClient());
  setWebViewClient(createWebviewClient());
  loadUrl(SETUP_HTML);
/*  if(this.getX5WebViewExtension()!=null){
    Toast.makeText(context,"x5 core",Toast.LENGTH_SHORT).show();
  }else{
    Toast.makeText(context,"sys core",Toast.LENGTH_SHORT).show();
  }*/

  applyAttributes(context, attrs);
}
 
开发者ID:androidDaniel,项目名称:riched_editor_x5,代码行数:19,代码来源:RichEditor.java

示例4: createViewInstance

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@Override
protected WebView createViewInstance(ThemedReactContext reactContext) {
    X5WeView webView = new X5WeView(reactContext);

    webView.setWebChromeClient(new WebChromeClient() {
        @Override
        public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissionsCallback callback) {
            callback.invoke(origin, true, false);
        }
    });
    reactContext.addLifecycleEventListener(webView);
    mWebViewConfig.configWebView(webView);
    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setDisplayZoomControls(false);

    // Fixes broken full-screen modals/galleries due to body height being 0.
    webView.setLayoutParams(
            new LayoutParams(LayoutParams.MATCH_PARENT,
                    LayoutParams.MATCH_PARENT));

    if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WebView.setWebContentsDebuggingEnabled(true);
    }

    return webView;
}
 
开发者ID:shimohq,项目名称:react-native-x5,代码行数:27,代码来源:RNX5WebViewManager.java

示例5: onShowFileChooser

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@Override
      public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams)
{
          uploadMessageAboveL = filePathCallback;
          openImageChooserActivity();
          return true;
      }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:8,代码来源:x5_MainActivity.java

示例6: commonRefect

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
private void commonRefect(WebChromeClient o, String mothed, Object[] os, Class... clazzs) {
        try {
            if (o == null)
                return;
            Class<?> clazz = o.getClass();
            Method mMethod = clazz.getMethod(mothed, clazzs);
            mMethod.invoke(o, os);
        } catch (Exception igore) {
//            igore.printStackTrace();
        }

    }
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:13,代码来源:WebChromeClientWrapper.java

示例7: onShowFileChooser

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
    LogUtils.i(TAG, "openFileChooser>=5.0");
    if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "onShowFileChooser", ChromePath + ".onShowFileChooser", WebView.class, ValueCallback.class, WebChromeClient.FileChooserParams.class)) {

        return super.onShowFileChooser(webView, filePathCallback, fileChooserParams);
    }
    openFileChooserAboveL(webView, filePathCallback, fileChooserParams);
    return true;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:12,代码来源:DefaultChromeClient.java

示例8: onShowCustomView

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public void onShowCustomView(View view,final IX5WebChromeClient.CustomViewCallback callback) {
    // IX5WebChromeClient.CustomViewCallback casts to webkit.WebChromeClient.CustomViewCallback
    // By Jeremy on 2017/5/18.
    parentEngine.getCordovaWebView().showCustomView(view, new android.webkit.WebChromeClient.CustomViewCallback() {
        @Override
        public void onCustomViewHidden() {
            callback.onCustomViewHidden();
        }
    });
}
 
开发者ID:jeremyup,项目名称:cordova-plugin-x5-webview,代码行数:11,代码来源:X5WebChromeClient.java

示例9: setWebChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
/**
 * WebView的setWebChromeClient事件
 */
private void setWebChromeClient() {
    mWebView.setWebChromeClient(new WebChromeClient() {
        @Override
        public void onProgressChanged(WebView webView, int newProgress) {
            if (mProgressBar != null) {
                LogUtils.e("URL", "进度:" + newProgress + ", Url :" + mWebView.getUrl());
                mProgressBar.setProgress(newProgress);
                if (newProgress == 100) {
                    Flowable.timer(600, TimeUnit.MILLISECONDS)
                            .subscribeOn(Schedulers.newThread())
                            .observeOn(AndroidSchedulers.mainThread())
                            .subscribe(new Consumer<Long>() {
                                @Override
                                public void accept(@NonNull Long aLong) throws Exception {
                                    if (mProgressBar != null) {
                                        mProgressBar.setVisibility(View.INVISIBLE);
                                    }
                                }
                            }, Throwable::printStackTrace);
                } else {//不为100的时候显示
                    mProgressBar.setVisibility(View.VISIBLE);
                }
            }
            super.onProgressChanged(webView, newProgress);
        }
    });
}
 
开发者ID:jianesrq0724,项目名称:UpdateLibrary,代码行数:31,代码来源:X5WebViewBrowseActivity.java

示例10: initViews

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
private void initViews() {

        WebSettings settings = getSettings();
        settings.setAppCacheEnabled(true);
        settings.setDomStorageEnabled(true);
        settings.setDatabaseEnabled(true);
        if (SystemUtil.isNetworkConnected()) {
            settings.setCacheMode(WebSettings.LOAD_DEFAULT);
        } else {
            settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY);
        }
        settings.setJavaScriptEnabled(true);
        settings.setLoadWithOverviewMode(true);
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        settings.setSupportZoom(true);

        mProgressView = new ProgressBar(getContext(), null, android.R.attr.progressBarStyleHorizontal);
        mProgressView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 10));
        mProgressView.setBackgroundColor(progressColor);
        addView(mProgressView);

        setWebChromeClient(new WebChromeClient() {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                super.onProgressChanged(view, newProgress);
                if (newProgress == 100) {
                    mProgressView.setVisibility(GONE);
                } else {
                    if (mProgressView.getVisibility() == GONE)
                        mProgressView.setVisibility(VISIBLE);
                    mProgressView.setProgress(newProgress);
                }
            }
        });
    }
 
开发者ID:a396901990,项目名称:Article-Comment,代码行数:36,代码来源:XProgressWebView.java

示例11: WebChromeClientWrapper

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public WebChromeClientWrapper(WebChromeClient realWebChromeClient) {
    this.mRealWebChromeClient = realWebChromeClient;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:WebChromeClientWrapper.java

示例12: setWebChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
void setWebChromeClient(WebChromeClient webChromeClient){
    this.mRealWebChromeClient=webChromeClient;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:WebChromeClientWrapper.java

示例13: setWebChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public CommonAgentBuilder setWebChromeClient(@Nullable WebChromeClient webChromeClient) {
    this.mAgentBuilder.mWebChromeClient = webChromeClient;
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:5,代码来源:AgentWebX5.java

示例14: MiddleWareWebChromeBase

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public MiddleWareWebChromeBase(WebChromeClient webChromeClient) {
    super(webChromeClient);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:4,代码来源:MiddleWareWebChromeBase.java

示例15: setWebChromeClient

import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@Override
final void setWebChromeClient(WebChromeClient webChromeClient) {
    super.setWebChromeClient(webChromeClient);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:5,代码来源:MiddleWareWebChromeBase.java


注:本文中的com.tencent.smtt.sdk.WebChromeClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。