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


Java WebSettings.setNeedInitialFocus方法代码示例

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


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

示例1: init

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void init() {
	final WebSettings setting = getSettings();
	setting.setJavaScriptEnabled(true);
	setting.setSupportZoom(false);
	setting.setSupportMultipleWindows(true);
	setting.setSupportZoom(false);
	setting.setBuiltInZoomControls(false);
	setting.setSupportMultipleWindows(true);
	setting.setJavaScriptCanOpenWindowsAutomatically(true);
	setting.setDomStorageEnabled(true);
	setting.setNeedInitialFocus(false);
	setting.setGeolocationEnabled(true);
	setting.setAllowFileAccess(true);
	setFocusable(true);
	setFocusableInTouchMode(true);

}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:18,代码来源:PagerWebView.java

示例2: 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

示例3: setWebView

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void setWebView() {
        WebSettings ws = wvNewContent.getSettings();
        ws.setJavaScriptEnabled(true);  //支持js
        ws.setPluginState(WebSettings.PluginState.ON);//设置是否支持插件
        ws.setUseWideViewPort(false);  //将图片调整到适合webview的大小
        ws.setSupportZoom(true);  //支持缩放
        ws.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); //支持内容重新布局
        ws.supportMultipleWindows();  //多窗口
        ws.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);  //关闭webview中缓存
//        cache模式有如下几种:
//        LOAD_DEFAULT: 如果我们应用程序没有设置任何cachemode, 这个是默认的cache方式。 加载一张网页会检查是否有cache,如果有并且没有过期则使用本地cache,否则从网络上获取。
//        LOAD_CACHE_ELSE_NETWORK: 使用cache资源,即使过期了也使用,如果没有cache才从网络上获取。
//        LOAD_NO_CACHE: 不使用cache 全部从网络上获取
//        LOAD_CACHE_ONLY:  只使用cache上的内容
        ws.setAllowFileAccess(true);  //设置可以访问文件
        ws.setNeedInitialFocus(true); //当webview调用requestFocus时为webview设置节点
        ws.setBuiltInZoomControls(true); //设置支持缩放
        ws.setJavaScriptCanOpenWindowsAutomatically(true); //支持通过JS打开新窗口
        ws.setLoadWithOverviewMode(true); // 缩放至屏幕的大小
        ws.setLoadsImagesAutomatically(true);  //支持自动加载图片
    }
 
开发者ID:guxiaonian,项目名称:MeiLa_GNN,代码行数:22,代码来源:GlobalWebViewActivity.java

示例4: AccountCreationWebview

import android.webkit.WebSettings; //导入方法依赖的package包/类
@SuppressLint("SetJavaScriptEnabled")
public AccountCreationWebview(BasePrefsWizard aParent, String url, OnAccountCreationDoneListener l){
    parent = aParent;
    creationListener = l;
    webCreationPage = url;
    
    settingsContainer = (ViewGroup) parent.findViewById(R.id.settings_container);
    validationBar = (ViewGroup) parent.findViewById(R.id.validation_bar);
    
    ViewGroup globalContainer = (ViewGroup) settingsContainer.getParent();
    
    parent.getLayoutInflater().inflate(R.layout.wizard_account_creation_webview, globalContainer);
    
    webView = (WebView) globalContainer.findViewById(R.id.webview);
    loadingProgressBar = (ProgressBar) globalContainer.findViewById(R.id.webview_progress);
    
    WebSettings webSettings = webView.getSettings();
    webSettings.setSavePassword(false);
    webSettings.setSaveFormData(false);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setSupportZoom(false);
    webSettings.setCacheMode(WebSettings.LOAD_NORMAL);
    webSettings.setNeedInitialFocus(true);
    webView.addJavascriptInterface(new JSInterface(), "CSipSimpleWizard");
    
    // Adds Progress bar Support
    webView.setWebChromeClient(new WebChromeClient() {
        public void onProgressChanged(WebView view, int progress) {
            if(progress < 100) {
                loadingProgressBar.setVisibility(View.VISIBLE);
                loadingProgressBar.setProgress(progress); 
            }else {
                loadingProgressBar.setVisibility(View.GONE);
            }
        }
    });
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:38,代码来源:AccountCreationWebview.java

示例5: setupWebSettings

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void setupWebSettings() {
    WebSettings settings = mWebView.getSettings();
    settings.setBuiltInZoomControls(true);
    //settings.setLoadWithOverviewMode(true);
    settings.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setDomStorageEnabled(true);
    settings.setNeedInitialFocus(true);
    settings.setDisplayZoomControls(false);
    mWebView.setWebChromeClient(new MyWebChromeClient());
    mWebView.setWebViewClient(new MyWebViewClient());

}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:14,代码来源:CodeMirrorEditor.java

示例6: 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

示例7: initWebSettings

import android.webkit.WebSettings; //导入方法依赖的package包/类
private void initWebSettings() {
  WebSettings settings = mWebView.getSettings();
  //支持获取手势焦点
  mWebView.requestFocusFromTouch();
  //支持JS
  settings.setJavaScriptEnabled(true);
  //支持插件
  settings.setPluginState(WebSettings.PluginState.ON);
  //设置适应屏幕
  settings.setUseWideViewPort(true);
  settings.setLoadWithOverviewMode(true);
  //支持缩放
  settings.setSupportZoom(false);
  //隐藏原生的缩放控件
  settings.setDisplayZoomControls(false);
  //支持内容重新布局
  settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
  settings.supportMultipleWindows();
  settings.setSupportMultipleWindows(true);
  //设置缓存模式
  settings.setDomStorageEnabled(true);
  settings.setDatabaseEnabled(true);
  settings.setCacheMode(WebSettings.LOAD_DEFAULT);
  settings.setAppCacheEnabled(true);
  settings.setAppCachePath(mWebView.getContext().getCacheDir().getAbsolutePath());

  //设置可访问文件
  settings.setAllowFileAccess(true);
  //当webview调用requestFocus时为webview设置节点
  settings.setNeedInitialFocus(true);
  //支持自动加载图片
  if (Build.VERSION.SDK_INT >= 19) {
    settings.setLoadsImagesAutomatically(true);
  } else {
    settings.setLoadsImagesAutomatically(false);
  }
  settings.setNeedInitialFocus(true);
  //设置编码格式
  settings.setDefaultTextEncodingName("UTF-8");
}
 
开发者ID:liuguoquan727,项目名称:android-study,代码行数:41,代码来源:WebViewUI.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


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