本文整理汇总了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;
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
});
}
示例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);
}
});
}
示例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);
}
}
});
}
示例11: WebChromeClientWrapper
import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public WebChromeClientWrapper(WebChromeClient realWebChromeClient) {
this.mRealWebChromeClient = realWebChromeClient;
}
示例12: setWebChromeClient
import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
void setWebChromeClient(WebChromeClient webChromeClient){
this.mRealWebChromeClient=webChromeClient;
}
示例13: setWebChromeClient
import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public CommonAgentBuilder setWebChromeClient(@Nullable WebChromeClient webChromeClient) {
this.mAgentBuilder.mWebChromeClient = webChromeClient;
return this;
}
示例14: MiddleWareWebChromeBase
import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
public MiddleWareWebChromeBase(WebChromeClient webChromeClient) {
super(webChromeClient);
}
示例15: setWebChromeClient
import com.tencent.smtt.sdk.WebChromeClient; //导入依赖的package包/类
@Override
final void setWebChromeClient(WebChromeClient webChromeClient) {
super.setWebChromeClient(webChromeClient);
}