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


Java WebSettings.setRenderPriority方法代码示例

本文整理汇总了Java中android.webkit.WebSettings.setRenderPriority方法的典型用法代码示例。如果您正苦于以下问题:Java WebSettings.setRenderPriority方法的具体用法?Java WebSettings.setRenderPriority怎么用?Java WebSettings.setRenderPriority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.webkit.WebSettings的用法示例。


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

示例1: initViews

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void initViews() {
        LayoutInflater.from(getContext()).inflate(R.layout.view_webview, this, true);
        mWebView = (MyWebView) findViewById(R.id.webview);
        mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
        mWebView.setWebViewClient(new MyClient());
//        mWebView.setWebChromeClient(new MyWebChromeClient());
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
        }
        webSettings.setBlockNetworkImage(true);
        mWebView.setOnScrollBottomListener(this);
        webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
    }
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:17,代码来源:CustomWebView.java

示例2: initView

import android.webkit.WebSettings; //导入方法依赖的package包/类
@Override
public void initView() {
    mIbToolbarMore.setVisibility(View.VISIBLE);
    //设置webView
    WebSettings settings = mWebView.getSettings();
    settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
    settings.setSupportMultipleWindows(true);
    settings.setJavaScriptEnabled(true);
    settings.setSavePassword(false);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setMinimumFontSize(settings.getMinimumLogicalFontSize() + 8);
    settings.setAllowFileAccess(false);
    settings.setTextSize(WebSettings.TextSize.NORMAL);
    mWebView.setVerticalScrollbarOverlay(true);
    mWebView.setWebViewClient(new MyWebViewClient());
    mWebView.loadUrl(mUrl);
    setToolbarTitle(TextUtils.isEmpty(mTitle) ? mWebView.getTitle() : mTitle);
}
 
开发者ID:lo625090140,项目名称:lqrwechatrongcloud,代码行数:19,代码来源:WebViewActivity.java

示例3: initViews

import android.webkit.WebSettings; //导入方法依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled"})
private void initViews() {
    this.mWebView.setVerticalScrollBarEnabled(false);
    this.mWebView.setHorizontalScrollBarEnabled(false);
    this.mWebView.setWebViewClient(new FbWebViewClient());
    this.mWebView.setWebChromeClient(this.mChromeClient);
    this.mWebView.clearFormData();
    WebSettings settings = this.mWebView.getSettings();
    settings.setSavePassword(false);
    settings.setSaveFormData(false);
    settings.setCacheMode(-1);
    settings.setNeedInitialFocus(false);
    settings.setBuiltInZoomControls(true);
    settings.setSupportZoom(true);
    settings.setRenderPriority(RenderPriority.HIGH);
    settings.setJavaScriptEnabled(true);
    if (!(this.mWeakContext == null || this.mWeakContext.get() == null)) {
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(((Context) this.mWeakContext.get()).getApplicationContext().getDir("databases", 0).getPath());
    }
    settings.setDomStorageEnabled(true);
    this.jsBridge.a(new JsListener(), "sdk_js_if");
    this.mWebView.clearView();
    this.mWebView.loadUrl(this.mUrl);
    this.mWebView.getSettings().setSavePassword(false);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:PKDialog.java

示例4: b

import android.webkit.WebSettings; //导入方法依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled"})
private void b() {
    this.i.setVerticalScrollBarEnabled(false);
    this.i.setHorizontalScrollBarEnabled(false);
    this.i.setWebViewClient(new FbWebViewClient());
    this.i.setWebChromeClient(this.mChromeClient);
    this.i.clearFormData();
    WebSettings settings = this.i.getSettings();
    settings.setSavePassword(false);
    settings.setSaveFormData(false);
    settings.setCacheMode(-1);
    settings.setNeedInitialFocus(false);
    settings.setBuiltInZoomControls(true);
    settings.setSupportZoom(true);
    settings.setRenderPriority(RenderPriority.HIGH);
    settings.setJavaScriptEnabled(true);
    if (!(this.c == null || this.c.get() == null)) {
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(((Context) this.c.get()).getApplicationContext().getDir("databases", 0).getPath());
    }
    settings.setDomStorageEnabled(true);
    this.jsBridge.a(new JsListener(), "sdk_js_if");
    this.i.loadUrl(this.e);
    this.i.setLayoutParams(a);
    this.i.setVisibility(4);
    this.i.getSettings().setSavePassword(false);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:28,代码来源:TDialog.java

示例5: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            String string = extras.getString("url");
            if (k.a(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.c = new Handler(getMainLooper());
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.a = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.a.setVisibility(0);
                linearLayout.addView(this.a, layoutParams);
                WebSettings settings = this.a.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.a.setVerticalScrollbarOverlay(true);
                this.a.setWebViewClient(new a());
                this.a.setDownloadListener(new a(this));
                this.a.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:65,代码来源:H5AuthActivity.java

示例6: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            String string = extras.getString("url");
            if (k.a(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.c = new Handler(getMainLooper());
                Object string2 = extras.getString("cookie");
                if (!TextUtils.isEmpty(string2)) {
                    CookieSyncManager.createInstance(getApplicationContext()).sync();
                    CookieManager.getInstance().setCookie(string, string2);
                    CookieSyncManager.getInstance().sync();
                }
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.a = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.a.setVisibility(0);
                linearLayout.addView(this.a, layoutParams);
                WebSettings settings = this.a.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.a.setVerticalScrollbarOverlay(true);
                this.a.setWebViewClient(new a());
                this.a.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:70,代码来源:H5PayActivity.java

示例7: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            this.d = extras.getString(b);
            String string = extras.getString("params");
            if (k.a(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.f = new Handler(getMainLooper());
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.c = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.c.setVisibility(0);
                linearLayout.addView(this.c, layoutParams);
                WebSettings settings = this.c.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.c.setVerticalScrollbarOverlay(true);
                this.c.setWebViewClient(new b());
                this.c.setWebChromeClient(new a());
                this.c.setDownloadListener(new a(this));
                this.c.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.c.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.c.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.c.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.c, new Object[]{"searchBoxJavaBridge_"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:67,代码来源:AuthActivity.java

示例8: initViews

import android.webkit.WebSettings; //导入方法依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled"})
private void initViews() {
    this.mWebView.setVerticalScrollBarEnabled(false);
    this.mWebView.setHorizontalScrollBarEnabled(false);
    this.mWebView.setWebViewClient(new FbWebViewClient());
    this.mWebView.setWebChromeClient(this.mChromeClient);
    this.mWebView.clearFormData();
    WebSettings settings = this.mWebView.getSettings();
    settings.setSavePassword(false);
    settings.setSaveFormData(false);
    settings.setCacheMode(-1);
    settings.setNeedInitialFocus(false);
    settings.setBuiltInZoomControls(true);
    settings.setSupportZoom(true);
    settings.setRenderPriority(RenderPriority.HIGH);
    settings.setJavaScriptEnabled(true);
    if (!(this.mWeakContext == null || this.mWeakContext.get() == null)) {
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(((Context) this.mWeakContext.get()).getApplicationContext()
                .getDir("databases", 0).getPath());
    }
    settings.setDomStorageEnabled(true);
    this.jsBridge.a(new JsListener(), "sdk_js_if");
    this.mWebView.clearView();
    this.mWebView.loadUrl(this.mUrl);
    this.mWebView.getSettings().setSavePassword(false);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:28,代码来源:PKDialog.java

示例9: b

import android.webkit.WebSettings; //导入方法依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled"})
private void b() {
    this.i.setVerticalScrollBarEnabled(false);
    this.i.setHorizontalScrollBarEnabled(false);
    this.i.setWebViewClient(new FbWebViewClient());
    this.i.setWebChromeClient(this.mChromeClient);
    this.i.clearFormData();
    WebSettings settings = this.i.getSettings();
    settings.setSavePassword(false);
    settings.setSaveFormData(false);
    settings.setCacheMode(-1);
    settings.setNeedInitialFocus(false);
    settings.setBuiltInZoomControls(true);
    settings.setSupportZoom(true);
    settings.setRenderPriority(RenderPriority.HIGH);
    settings.setJavaScriptEnabled(true);
    if (!(this.c == null || this.c.get() == null)) {
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(((Context) this.c.get()).getApplicationContext().getDir
                ("databases", 0).getPath());
    }
    settings.setDomStorageEnabled(true);
    this.jsBridge.a(new JsListener(), "sdk_js_if");
    this.i.loadUrl(this.e);
    this.i.setLayoutParams(a);
    this.i.setVisibility(4);
    this.i.getSettings().setSavePassword(false);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:29,代码来源:TDialog.java

示例10: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            String string = extras.getString("url");
            if (i.b(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.c = new Handler(getMainLooper());
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.a = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.a.setVisibility(0);
                linearLayout.addView(this.a, layoutParams);
                WebSettings settings = this.a.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.a.setVerticalScrollbarOverlay(true);
                this.a.setWebViewClient(new a());
                this.a.setDownloadListener(new b(this));
                this.a.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
                        method.invoke(this.a, new Object[]{"accessibility"});
                        method.invoke(this.a, new Object[]{"accessibilityTraversal"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:67,代码来源:H5AuthActivity.java

示例11: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            String string = extras.getString("url");
            if (i.b(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.c = new Handler(getMainLooper());
                Object string2 = extras.getString("cookie");
                if (!TextUtils.isEmpty(string2)) {
                    CookieSyncManager.createInstance(getApplicationContext()).sync();
                    CookieManager.getInstance().setCookie(string, string2);
                    CookieSyncManager.getInstance().sync();
                }
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.a = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.a.setVisibility(0);
                linearLayout.addView(this.a, layoutParams);
                WebSettings settings = this.a.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.a.setVerticalScrollbarOverlay(true);
                this.a.setWebViewClient(new a());
                this.a.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
                        method.invoke(this.a, new Object[]{"accessibility"});
                        method.invoke(this.a, new Object[]{"accessibilityTraversal"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:72,代码来源:H5PayActivity.java

示例12: onCreate

import android.webkit.WebSettings; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    try {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            finish();
            return;
        }
        try {
            this.d = extras.getString(b);
            String string = extras.getString("params");
            if (i.b(string)) {
                Method method;
                super.requestWindowFeature(1);
                this.f = new Handler(getMainLooper());
                View linearLayout = new LinearLayout(getApplicationContext());
                LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
                linearLayout.setOrientation(1);
                setContentView(linearLayout, layoutParams);
                this.c = new WebView(getApplicationContext());
                layoutParams.weight = 1.0f;
                this.c.setVisibility(0);
                linearLayout.addView(this.c, layoutParams);
                WebSettings settings = this.c.getSettings();
                settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
                settings.setRenderPriority(RenderPriority.HIGH);
                settings.setSupportMultipleWindows(true);
                settings.setJavaScriptEnabled(true);
                settings.setSavePassword(false);
                settings.setJavaScriptCanOpenWindowsAutomatically(true);
                settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
                settings.setAllowFileAccess(false);
                settings.setTextSize(TextSize.NORMAL);
                this.c.setVerticalScrollbarOverlay(true);
                this.c.setWebViewClient(new b());
                this.c.setWebChromeClient(new a());
                this.c.setDownloadListener(new a(this));
                this.c.loadUrl(string);
                if (VERSION.SDK_INT >= 7) {
                    try {
                        method = this.c.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
                        if (method != null) {
                            method.invoke(this.c.getSettings(), new Object[]{Boolean.valueOf(true)});
                        }
                    } catch (Exception e) {
                    }
                }
                try {
                    method = this.c.getClass().getMethod("removeJavascriptInterface", new Class[0]);
                    if (method != null) {
                        method.invoke(this.c, new Object[]{"searchBoxJavaBridge_"});
                        method.invoke(this.c, new Object[]{"accessibility"});
                        method.invoke(this.c, new Object[]{"accessibilityTraversal"});
                        return;
                    }
                    return;
                } catch (Exception e2) {
                    return;
                }
            }
            finish();
        } catch (Exception e3) {
            finish();
        }
    } catch (Exception e4) {
        finish();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:69,代码来源:AuthActivity.java

示例13: initEvent

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void initEvent() {
    rl_back.setOnClickListener(this);
    rl_option.setOnClickListener(this);
    WebSettings settings = mWebView.getSettings();
    //支持javascript
    settings.setJavaScriptEnabled(true);
    mWebView.addJavascriptInterface(new JsToJava(), "app");
    //设置支持缩放
    settings.setSupportZoom(true);//支持缩放
    settings.setBuiltInZoomControls(true);//设置隐藏缩放按钮
    settings.setDisplayZoomControls(false);//隐藏原生的缩放按钮

    //设置自适应屏幕
    settings.setUseWideViewPort(true);
    settings.setLoadWithOverviewMode(true);

    //屏幕自适应网页  解决低分辨率可能会显示异常的问题
    settings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
    settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
    //自适应屏幕
    settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    //设置缓存机制
    //settings.setAppCacheEnabled(true);
    settings.setCacheMode(LOAD_NO_CACHE);

    //运行webview通过URI获取安卓文件
    settings.setAllowFileAccess(true);
    settings.setAllowFileAccessFromFileURLs(true);
    settings.setAllowUniversalAccessFromFileURLs(true);

    //支持自动加载图片
    settings.setLoadsImagesAutomatically(true);

    mWebView.setWebViewClient(new MyWebViewClient());
    mWebView.setWebChromeClient(new MyWebChromeClient());
    mWebView.setOnLongClickListener(this);
    mWebView.loadUrl(URL);
}
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:39,代码来源:WebActivity.java

示例14: initWeb

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void initWeb() {
    WebSettings settings = mWebView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setUseWideViewPort(true);
    settings.setLoadWithOverviewMode(true);
    settings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
    settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
    settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    mWebView.loadUrl("file:///android_asset/speedtest.html");
    mWebView.setWebViewClient(new WebViewClient());
}
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:12,代码来源:SpeedTestActivity.java

示例15: configure

import android.webkit.WebSettings; //导入方法依赖的package包/类
/**
 * Configure a {@link WebView} to display a Message. This method takes into account a user's
 * preferences when configuring the view. This message is used to view a message and to display a message being
 * replied to.
 */
public void configure() {
    this.setVerticalScrollBarEnabled(true);
    this.setVerticalScrollbarOverlay(true);
    this.setScrollBarStyle(SCROLLBARS_INSIDE_OVERLAY);
    this.setLongClickable(true);

    if (QMail.getK9MessageViewTheme() == Theme.DARK) {
        // Black theme should get a black webview background
        // we'll set the background of the messages on load
        this.setBackgroundColor(0xff000000);
    }

    final WebSettings webSettings = this.getSettings();

    webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);

    /* TODO this might improve rendering smoothness when webview is animated into view
    if (VERSION.SDK_INT >= VERSION_CODES.M) {
        webSettings.setOffscreenPreRaster(true);
    }
    */

    webSettings.setSupportZoom(true);
    webSettings.setBuiltInZoomControls(true);
    webSettings.setUseWideViewPort(true);
    if (QMail.autofitWidth()) {
        webSettings.setLoadWithOverviewMode(true);
    }

    disableDisplayZoomControls();

    webSettings.setJavaScriptEnabled(false);
    webSettings.setLoadsImagesAutomatically(true);
    webSettings.setRenderPriority(RenderPriority.HIGH);

    // TODO:  Review alternatives.  NARROW_COLUMNS is deprecated on KITKAT
    webSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);

    setOverScrollMode(OVER_SCROLL_NEVER);

    webSettings.setTextZoom(QMail.getFontSizes().getMessageViewContentAsPercent());

    // Disable network images by default.  This is overridden by preferences.
    blockNetworkData(true);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:51,代码来源:MessageWebView.java


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