當前位置: 首頁>>代碼示例>>Java>>正文


Java PluginState類代碼示例

本文整理匯總了Java中android.webkit.WebSettings.PluginState的典型用法代碼示例。如果您正苦於以下問題:Java PluginState類的具體用法?Java PluginState怎麽用?Java PluginState使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PluginState類屬於android.webkit.WebSettings包,在下文中一共展示了PluginState類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
private void initView() {
    this.tvBind.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            MobclickAgent.onEvent(ScaleIntroActivity.this, Event.bingo_clickBindingScalse);
            ScaleBindActivity.startActivity(ScaleIntroActivity.this);
        }
    });
    this.webView.getSettings().setJavaScriptEnabled(true);
    this.webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
    this.webView.getSettings().setPluginState(PluginState.ON);
    this.webView.getSettings().setUserAgentString(this.webView.getSettings()
            .getUserAgentString() + " App/boohee");
    this.webView.getSettings().setDomStorageEnabled(true);
    this.webView.setWebViewClient(createWebViewClient());
    this.webView.loadUrl(UrlUtils.handleUrl(URL));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:ScaleIntroActivity.java

示例2: setUpWebViewSetting

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
private void setUpWebViewSetting() {
	WebSettings webSettings = web.getSettings();

	webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);// 根據cache-control決定是否從網絡上取數據
	webSettings.setSupportZoom(true);
	webSettings.setBuiltInZoomControls(true);// 顯示放大縮小
	webSettings.setJavaScriptEnabled(true);
	// webSettings.setPluginsEnabled(true);
	webSettings.setPluginState(PluginState.ON);
	webSettings.setUserAgentString(webSettings.getUserAgentString());
	webSettings.setDomStorageEnabled(true);
	webSettings.setAppCacheEnabled(true);
	webSettings.setAppCachePath(getCacheDir().getPath());
	webSettings.setUseWideViewPort(true);// 影響默認滿屏和雙擊縮放
	webSettings.setLoadWithOverviewMode(true);// 影響默認滿屏和手勢縮放

}
 
開發者ID:L-value,項目名稱:Android-Plugin-Framework,代碼行數:18,代碼來源:PluginWebViewActivity.java

示例3: setupWebView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
/* Configure the Webview for usage as the application's window. */
private void setupWebView(WebView webView) {
	Log.i(className, "setupWebView");
	WebSettings webSettings = webView.getSettings();
	webSettings.setJavaScriptEnabled(true);
	if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.JELLY_BEAN) {
		webSettings.setMediaPlaybackRequiresUserGesture(false);
	}
	webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
	webSettings.setLoadWithOverviewMode(true);
	webSettings.setUseWideViewPort(true);
	webSettings.setAllowFileAccess(true);
	if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
		webSettings.setAllowUniversalAccessFromFileURLs(true);
	}
	webSettings.setBuiltInZoomControls(false);
	webSettings.setSupportZoom(false);
	if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) {
		webSettings.setPluginState(PluginState.ON);
	}
}
 
開發者ID:bizplay,項目名稱:playr-android-app,代碼行數:23,代碼來源:MainActivity.java

示例4: initWebViewSettings

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
/**
 * 初始化webview配置
 */
private void initWebViewSettings() {
    WebSettings webSettings = mWebview.getSettings();
    // 打開h5 localstorage
    webSettings.setDomStorageEnabled(true);
    // 不設置setDatabasePath,html5數據隻會保存在內存
    webSettings.setDatabaseEnabled(true);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setPluginState(PluginState.ON);
    // 禁止window open
    webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
    // 支持viewport meta tag
    webSettings.setUseWideViewPort(true);
    webSettings.setLoadWithOverviewMode(true);
    webSettings.setSupportZoom(false);
    mWebview.setVerticalScrollBarEnabled(false);
    mWebview.setHorizontalScrollBarEnabled(false);
    // 滾動條風格,為0就是不給滾動條留空間,滾動條覆蓋在網頁上
    mWebview.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
    mWebview.setWebChromeClient(mWebChromeClient);
    mWebview.setWebViewClient(mWebViewClient);
}
 
開發者ID:likebamboo,項目名稱:AndroidBlog,代碼行數:25,代碼來源:CommonWebView.java

示例5: setPluginState

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
public static void setPluginState(WebSettings settings, PluginStateCompat state) {
	switch (state) {
	case ON: {
		settings.setPluginState(PluginState.ON);
		break;
	}
	case ON_DEMAND: {
		settings.setPluginState(PluginState.ON_DEMAND);
		break;
	}
	case OFF: {
		settings.setPluginState(PluginState.OFF);
		break;
	}
	default: {
		break;
	}
	}
}
 
開發者ID:v7lin,項目名稱:Android_Skin_3.x,代碼行數:20,代碼來源:WebSettingsCompatFroyo.java

示例6: initBaseSetting

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
public void initBaseSetting(boolean webApp) {
    super.initBaseSetting(webApp);
    mWebSetting.setAppCacheEnabled(true);
    mWebSetting.setAppCachePath(mBrwView.getContext().getDir("cache", 0).getPath());
    mWebSetting.setDatabaseEnabled(true);
    mWebSetting.setDomStorageEnabled(true);
    mWebSetting.setLoadWithOverviewMode(false);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        mWebSetting.setAllowFileAccessFromFileURLs(true);
        mWebSetting.setAllowUniversalAccessFromFileURLs(true);
    }

    mWebSetting.setDatabasePath(mBrwView.getContext().getDir("database", 0).getPath());
    if (Build.VERSION.SDK_INT >= 8) {
        try {
            mWebSetting.setPluginState(PluginState.ON);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (Build.VERSION.SDK_INT > 10) {
        invoke();
    }
}
 
開發者ID:AppCanOpenSource,項目名稱:appcan-android,代碼行數:25,代碼來源:EBrowserSetting7.java

示例7: init

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
private void init(Context context) {
    this.setVerticalScrollBarEnabled(false);
    this.setHorizontalScrollBarEnabled(false);
    if (Build.VERSION.SDK_INT < 19) {
        removeJavascriptInterface("searchBoxJavaBridge_");
    }

    WebSettings localWebSettings = this.getSettings();
    try {
        // 禁用file協議,http://www.tuicool.com/articles/Q36ZfuF, 防止Android WebView File域攻擊
        localWebSettings.setAllowFileAccess(false);
        localWebSettings.setSupportZoom(false);
        localWebSettings.setBuiltInZoomControls(false);
        localWebSettings.setUseWideViewPort(true);
        localWebSettings.setDomStorageEnabled(true);
        localWebSettings.setLoadWithOverviewMode(true);
        localWebSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        localWebSettings.setPluginState(PluginState.ON);
        // 啟用數據庫
        localWebSettings.setDatabaseEnabled(true);
        // 設置定位的數據庫路徑
        String dir = context.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
        localWebSettings.setGeolocationDatabasePath(dir);
        localWebSettings.setGeolocationEnabled(true);
        localWebSettings.setJavaScriptEnabled(true);
        localWebSettings.setSavePassword(false);
        String agent = localWebSettings.getUserAgentString();

        localWebSettings.setUserAgentString(agent);
        // setCookie(context, ".baidu.com", bdussCookie);

    } catch (Exception e1) {
        e1.printStackTrace();
    }
    this.setWebViewClient(new BridgeWebViewClient());
}
 
開發者ID:dueros,項目名稱:dcs-sdk-java,代碼行數:39,代碼來源:BaseWebView.java

示例8: initWebView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
/**
 * 初始化瀏覽器設置信息
 */
private void initWebView() {
    cookie = CookieManager.getInstance();
    WebSettings webSettings = mWebView.getSettings();
    webSettings.setJavaScriptEnabled(true); // 啟用支持javascript
    webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);// 優先使用緩存
    webSettings.setAllowFileAccess(true);// 可以訪問文件
    webSettings.setBuiltInZoomControls(true);// 支持縮放
    if (android.os.Build.VERSION.SDK_INT >= 11) {
        webSettings.setPluginState(PluginState.ON);
        webSettings.setDisplayZoomControls(false);// 支持縮放
    }
    mWebView.setWebViewClient(new MyWebViewClient());
    mWebView.setWebChromeClient(new MyWebChromeClient());
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:18,代碼來源:BrowserFragment.java

示例9: initView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
private void initView() {
    this.mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
    this.webView = (WebView) findViewById(R.id.wv_content);
    this.webView.getSettings().setJavaScriptEnabled(true);
    this.webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
    this.webView.getSettings().setPluginState(PluginState.ON);
    this.webView.getSettings().setUserAgentString(this.webView.getSettings()
            .getUserAgentString() + " App/boohee");
    this.webView.getSettings().setDomStorageEnabled(true);
    this.webView.addJavascriptInterface(new JSInterface(), "jsObj");
    this.webView.setWebViewClient(createChromeClient());
    this.webView.setWebChromeClient(new MyWebClient());
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:BrowserActivity.java

示例10: NewsstandArticleRenderer

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
private NewsstandArticleRenderer(Context paramContext, byte paramByte)
{
  super(paramContext, null, 0);
  setWebChromeClient(new WebChromeClient());
  setWebViewClient(new NewsstandWebViewClient((byte)0));
  WebSettings localWebSettings = getSettings();
  localWebSettings.setAllowFileAccess(false);
  localWebSettings.setAppCacheEnabled(false);
  localWebSettings.setCacheMode(2);
  localWebSettings.setDatabaseEnabled(false);
  localWebSettings.setDomStorageEnabled(true);
  localWebSettings.setJavaScriptEnabled(true);
  localWebSettings.setPluginState(WebSettings.PluginState.OFF);
  localWebSettings.setSupportZoom(true);
  localWebSettings.setUseWideViewPort(true);
  localWebSettings.setLoadWithOverviewMode(false);
  localWebSettings.setUserAgentString(localWebSettings.getUserAgentString() + " OnyxArticleView/1.0");
  if (!sDidSetRenderPriority)
  {
    sDidSetRenderPriority = true;
    localWebSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
  }
  setOnLongClickListener(new View.OnLongClickListener()
  {
    public final boolean onLongClick(View paramAnonymousView)
    {
      return true;
    }
  });
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:31,代碼來源:NewsstandArticleRenderer.java

示例11: initWebView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
/**
 * 初始化瀏覽器設置信息
 */
private void initWebView() {
    WebSettings webSettings = mWebView.getSettings();
    webSettings.setJavaScriptEnabled(true); // 啟用支持javascript
    webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);// 優先使用緩存
    webSettings.setAllowFileAccess(true);// 可以訪問文件
    webSettings.setBuiltInZoomControls(true);// 支持縮放
    if (android.os.Build.VERSION.SDK_INT >= 11) {
        webSettings.setPluginState(PluginState.ON);
        webSettings.setDisplayZoomControls(false);// 支持縮放
    }
    mWebView.setWebViewClient(new MyWebViewClient());
    mWebView.setWebChromeClient(new MyWebChromeClient());
}
 
開發者ID:KJFrame,項目名稱:KJBlog,代碼行數:17,代碼來源:Browser.java

示例12: displayArticle

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
public static void displayArticle(WebView webView, Article article, Context context) {
    String styles = "iframe, img { width: 100%; }";
    if (isDarkTheme(context)) {
        webView.setBackgroundColor(Color.BLACK);
        styles += "body { background-color: #000000; color: #F6F6F6; } a { color: #0099FF; }";
    }
    String html = String.format("<html><head><meta charset=\"utf-8\"><link rel=\"stylesheet\" type=\"text/css\" href=\"http://cdn.uservoice.com/stylesheets/vendor/typeset.css\"/><style>%s</style></head><body class=\"typeset\" style=\"font-family: sans-serif; margin: 1em\"><h3>%s</h3>%s</body></html>", styles, article.getTitle(), article.getHtml());
    webView.setWebChromeClient(new WebChromeClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setPluginState(PluginState.ON);
    webView.loadUrl(String.format("data:text/html;charset=utf-8,%s", Uri.encode(html)));
}
 
開發者ID:goodev,項目名稱:android-discourse,代碼行數:14,代碼來源:Utils.java

示例13: initWebView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
private void initWebView()
{
	mWebView.clearHistory();
	mWebView.requestFocus();
	mWebView.setClickable(true);
	mWebView.getSettings().setJavaScriptEnabled(true);// 可用JS
	mWebView.getSettings().setPluginState(PluginState.ON);
	mWebView.getSettings().setUseWideViewPort(true);
	mWebView.getSettings().setSupportZoom(true);
	mWebView.getSettings().setBuiltInZoomControls(true);
	mWebView.setInitialScale(100);
	mWebView.getSettings().setPluginState(PluginState.ON);
	mWebView.getSettings().setGeolocationEnabled(true);
	mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
	mWebView.getSettings().setAppCacheEnabled(true);
	mWebView.getSettings().setDatabaseEnabled(true);
	mWebView.getSettings().setDisplayZoomControls(false);
	mWebView.getSettings().setDomStorageEnabled(true);
	if (!mUrl.startsWith("http://m.weathercn.com"))
	{
		mWebView.getSettings().setCacheMode(
			WebSettings.LOAD_CACHE_ELSE_NETWORK);
	}
	else
	{
		mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
	}
	mWebView.getSettings().setLoadWithOverviewMode(true);
	mWebView.setScrollBarStyle(0);
	mWebView.cancelLongPress();
	mWebView.getSettings().setSavePassword(false);// 設置不需要 彈出“是否保存密碼” 對話框
	mWebView.setWebViewClient(getWebViewClient());
	mWebView.setWebChromeClient(getWebChromeClient());
}
 
開發者ID:haikuowuya,項目名稱:like_googleplus_layout,代碼行數:35,代碼來源:WebViewActivity.java

示例14: initView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
   private void initView()
{
	Intent intent = getIntent();

	String url = intent.getStringExtra(URL);

	webView = (WebView) findViewById(R.id.webView);
	webView.clearHistory();
	webView.loadUrl(url);
	webView.setWebViewClient(new BrowserClient());
	webView.setInitialScale(0);
	
	WebSettings settings = webView.getSettings();
	settings.setJavaScriptEnabled(true);
	settings.setJavaScriptCanOpenWindowsAutomatically(false);
	settings.setPluginState(PluginState.ON);
	settings.setLoadWithOverviewMode(true);
	settings.setSupportMultipleWindows(false);
	settings.setDefaultZoom(ZoomDensity.FAR);
	settings.setSupportZoom(true);
	settings.setBuiltInZoomControls(true);
	settings.setUseWideViewPort(true);
	settings.setDomStorageEnabled(true);
	

	Button btnDone = (Button) findViewById(R.id.btnDone);
	btnDone.setOnClickListener(this);

	imgBack = (ImageView) findViewById(R.id.imgBack);
	imgForward = (ImageView) findViewById(R.id.imgForward);

	imgBack.setOnClickListener(this);
	imgForward.setOnClickListener(this);

	checkButtonState();
}
 
開發者ID:fblandroidhackathon,項目名稱:persontracker,代碼行數:38,代碼來源:BrowserActivity.java

示例15: showBrowserView

import android.webkit.WebSettings.PluginState; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
    private void showBrowserView() 
	{
		switchToLayout(R.layout.browse_web_screen);
		
		WebView webView = (WebView) findViewById(R.id.webView);
//		webView.setWebViewClient(new BrowserClient());
		actionBar.setWebView(webView);
		
		if (webViewClient == null) {
			webViewClient = new ParrotWebViewClient();
		}
		
		if (webChromeClient == null) {
			webChromeClient = new ParrotWebChromeClient();
		}
		
		webView.setWebViewClient(webViewClient);
		webView.setWebChromeClient(webChromeClient);
		WebSettings settings = webView.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setJavaScriptCanOpenWindowsAutomatically(false);
		settings.setPluginState(PluginState.ON);
		settings.setLoadWithOverviewMode(true);
		settings.setSupportMultipleWindows(false);
		settings.setDefaultZoom(ZoomDensity.FAR);
		settings.setSupportZoom(true);
		settings.setBuiltInZoomControls(true);
		settings.setUseWideViewPort(true);

		webView.setInitialScale(0);
	}
 
開發者ID:fblandroidhackathon,項目名稱:persontracker,代碼行數:33,代碼來源:GuestSpaceActivity.java


注:本文中的android.webkit.WebSettings.PluginState類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。