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


Java LayoutAlgorithm類代碼示例

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


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

示例1: initView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的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: initWebView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
@SuppressLint({"SetJavaScriptEnabled"})
private void initWebView() {
    this.webview.getSettings().setJavaScriptEnabled(true);
    this.webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    this.webview.setVerticalScrollBarEnabled(false);
    this.webview.setVerticalScrollbarOverlay(false);
    this.webview.setHorizontalScrollBarEnabled(false);
    this.webview.setHorizontalScrollbarOverlay(false);
    this.webview.loadUrl(UrlUtils.handleUrl(BooheeClient.build(BooheeClient.ONE)
            .getDefaultURL(String.format(URL_GOODS, new Object[]{Integer.valueOf(this.mGoods
                    .id)}))));
    this.webview.setWebViewClient(new WebViewClient() {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (TextUtils.isEmpty(url) || GoodsHomeFragment.this.mGoods == null) {
                return false;
            }
            if (url.contains("boohee://channel_posts")) {
                GoodsHomeFragment.this.onGoodsPageChangeListener.onGoodsPageChange(GoodsTab
                        .POST.getPosition());
            } else {
                BooheeScheme.handleUrl(GoodsHomeFragment.this.getActivity(), url);
            }
            return true;
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:GoodsHomeFragment.java

示例3: initWebView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
@SuppressLint({"SetJavaScriptEnabled"})
private void initWebView() {
    this.webview.getSettings().setJavaScriptEnabled(true);
    this.webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    this.webview.setVerticalScrollBarEnabled(false);
    this.webview.setVerticalScrollbarOverlay(false);
    this.webview.setHorizontalScrollBarEnabled(false);
    this.webview.setHorizontalScrollbarOverlay(false);
    this.webview.loadUrl(UrlUtils.handleUrl(BooheeClient.build(BooheeClient.ONE)
            .getDefaultURL(NICE_URL)));
    this.webview.setWebViewClient(new WebViewClient() {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (TextUtils.isEmpty(url)) {
                return false;
            }
            BooheeScheme.handleUrl(NiceIntroduceFragment.this.getActivity(), url);
            return true;
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:21,代碼來源:NiceIntroduceFragment.java

示例4: formatWebView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
@SuppressWarnings("deprecation")
public static WebView formatWebView(WebView web, boolean isFitScreen) {

  //  web.setWebChromeClient(new WebChromeClient());

    web.setBackgroundColor(Color.parseColor("#00000000"));
    web.getSettings().setJavaScriptEnabled(true);
    web.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
    web.getSettings().setSupportMultipleWindows(false);
    web.getSettings().setSupportZoom(true);
    web.setVerticalScrollBarEnabled(false);
    web.setHorizontalScrollBarEnabled(true);


    web.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 4.4; Nexus 4 Build/KRT16H) AppleWebKit/537.36(KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36");


    if (isFitScreen) {
        web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    }

    return web;
}
 
開發者ID:AAPBD,項目名稱:AppBajarLIB,代碼行數:24,代碼來源:WebViewFormatter.java

示例5: formatWebViewWithClient

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
public static WebView formatWebViewWithClient(WebView web,
                                              boolean isFitScreen, boolean enableCLient) {

  //  web.setWebChromeClient(new WebChromeClient());

    web.setBackgroundColor(Color.parseColor("#00000000"));
    web.getSettings().setJavaScriptEnabled(true);
    web.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
    web.getSettings().setSupportMultipleWindows(false);
    web.getSettings().setSupportZoom(true);
    web.setVerticalScrollBarEnabled(false);
    web.setHorizontalScrollBarEnabled(true);

    web.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 4.4; Nexus 4 Build/KRT16H) AppleWebKit/537.36(KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36");


    if (isFitScreen) {
        web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    }

    if (enableCLient) {

        web.setWebViewClient(new MyWebViewClient(true));
    }
    return web;
}
 
開發者ID:AAPBD,項目名稱:AppBajarLIB,代碼行數:27,代碼來源:WebViewFormatter.java

示例6: onCreate

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setAbContentView(R.layout.activity_broadcast_detail);
	msg = (BroadcastMessage) getIntent().getSerializableExtra(
			"broadcastMessage");
	WebView webView = (WebView) findViewById(R.id.webView);
	webView.setBackgroundColor(0x00000000); // 透明背景
	WebSettings webSettings = webView.getSettings();
	webSettings.setJavaScriptEnabled(true);
	webSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
	if (msg != null) {
		((TextView) findViewById(R.id.msg_name)).setText(msg.getMsg_name());
		((TextView) findViewById(R.id.msg_time)).setText(AbDateUtil
				.formatDateStr2Desc(AbDateUtil.getStringByFormat(
						msg.getSendTime(), AbDateUtil.dateFormatYMDHMS),
						AbDateUtil.dateFormatYMDHMS));
		webView.loadDataWithBaseURL(null, msg.getMsg_content(), "text/html",
				"utf-8", null);
	}

}
 
開發者ID:entboost,項目名稱:EntboostIM,代碼行數:24,代碼來源:BroadcastDetailActivity.java

示例7: initWebView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
private void initWebView() {
		webView = (WebView)findViewById(R.id.wb_details);
		LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
		if (!TextUtils.isEmpty(news_url)) {
			WebSettings settings = webView.getSettings();
			settings.setJavaScriptEnabled(true);//設置可以運行JS腳本
//			settings.setTextZoom(120);//Sets the text zoom of the page in percent. The default is 100.
			settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
//			settings.setUseWideViewPort(true); //打開頁麵時, 自適應屏幕 
//			settings.setLoadWithOverviewMode(true);//打開頁麵時, 自適應屏幕 
			settings.setSupportZoom(false);// 用於設置webview放大
			settings.setBuiltInZoomControls(false);
			webView.setBackgroundResource(R.color.transparent);
			// 添加js交互接口類,並起別名 imagelistner
			webView.addJavascriptInterface(new JavascriptInterface(getApplicationContext()),"imagelistner");
			webView.setWebChromeClient(new MyWebChromeClient());
			webView.setWebViewClient(new MyWebViewClient());
			new MyAsnycTask().execute(news_url, news_title, news_source + " " +news_date);
		}
	}
 
開發者ID:fuhongliang,項目名稱:taijiquanwang,代碼行數:21,代碼來源:DetailsActivity.java

示例8: initUI

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
private void initUI() {
	viewHolder = new ViewHolder();
	viewHolder.txTitle = (TextView) findViewById(R.id.tx_title);
	viewHolder.txAuthor = (TextView) findViewById(R.id.tx_author);
	viewHolder.txCreateTime = (TextView) findViewById(R.id.tx_create_time);
	viewHolder.wvContent = (WebView) findViewById(R.id.wv_wap_content);
	WebSettings settings = viewHolder.wvContent.getSettings();
	settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

	viewHolder.btnBack = (Button) findViewById(R.id.btn_back);
	viewHolder.btnBack.setOnClickListener(this);
	viewHolder.btnShare = (Button) findViewById(R.id.btn_share);
	viewHolder.btnShare.setOnClickListener(this);
	viewHolder.btnFavorite = (Button) findViewById(R.id.btn_favorite);
	viewHolder.btnFavorite.setOnClickListener(this);
}
 
開發者ID:SmiletolifeTian,項目名稱:Android_Tian_Project_Chabaike,代碼行數:17,代碼來源:ContentActivity.java

示例9: getIndexContent

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
private void getIndexContent(String id_) {
	HttpUtils.getPostResult(appURLFinal.CONTENT_URL,
			appURLFinal.getCONTENT(id_), new getResultCallback() {

				@Override
				public void getMessage(String message) {
					// TODO Auto-generated method stub
					condatalist = JSON_Parser.parseJSONContent(message);
					System.out.println(condatalist.getContentData()
							.getTitle());
					tv_contenttitle.setText(condatalist.getContentData()
							.getTitle());
					textView_content_create_time.setText(condatalist
							.getContentData().getCreate_time());
					textView_content_source.setText(condatalist
							.getContentData().getSource());
					wv_contet.loadDataWithBaseURL(null, condatalist
							.getContentData().getWap_content(),
							"text/html", "utf-8", null);
					// ���ò��ֹ�����,ʹ�ؼ�����Ӧ�ֻ���Ļ,ʹ�������ݵȿ���ʾ,���Խ��ͼƬ��������,�����п�����ҳ��������ʧЧ.
					wv_contet.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
					pd_content.dismiss();
				}
			});
}
 
開發者ID:elementlo,項目名稱:Android-TeaWiki,代碼行數:26,代碼來源:ContentActivity.java

示例10: getBodyContent

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
private void getBodyContent(String id_) {
	HttpUtils.getPostResult(appURLFinal.CONTENT_URL,
			appURLFinal.getCONTENT(id_), new getResultCallback() {

				@Override
				public void getMessage(String message) {
					// TODO Auto-generated method stub
					condatalist = JSON_Parser.parseJSONContent(message);
					System.out.println(condatalist.getContentData()
							.getTitle());
					tv_contenttitle.setText(condatalist.getContentData()
							.getTitle());
					textView_content_create_time.setText(condatalist
							.getContentData().getCreate_time());
					textView_content_source.setText(condatalist
							.getContentData().getSource());
					wv_contet.loadDataWithBaseURL(null, condatalist
							.getContentData().getWap_content(),
							"text/html", "utf-8", null);
					// ���ò��ֹ�����,ʹ�ؼ�����Ӧ�ֻ���Ļ,ʹ�������ݵȿ���ʾ,���Խ��ͼƬ��������,�����п�����ҳ��������ʧЧ.
					wv_contet.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
					pd_content.dismiss();
				}
			});
}
 
開發者ID:elementlo,項目名稱:Android-TeaWiki,代碼行數:26,代碼來源:ContentActivity.java

示例11: createHTMLVideoPlayer

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
private View createHTMLVideoPlayer(String url, JSONObject obj, JSONObject stream) {
    WebView wv = new WebView(getActivity());
    wv.setHorizontalScrollBarEnabled(false);
    wv.setWebChromeClient(new BrowserChrome(getMainActivity()));
    wv.getSettings().setLoadWithOverviewMode(true);
    wv.getSettings().setUseWideViewPort(true);
    wv.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    wv.getSettings().setJavaScriptEnabled(true);

    Integer width = null;
    if(stream != null && stream.has("width"))
        width = stream.optInt("width");

    String html = Utils.formatHtmlFragment(obj.optString("embedCode", ""), width);
    Log.d(TAG, "HTML is " + html);
    wv.loadDataWithBaseURL(url, html, "text/html", "utf-8", null);
    m_webViews.add(wv);
    return wv;
}
 
開發者ID:erincandescent,項目名稱:Impeller,代碼行數:20,代碼來源:StandardObjectFragment.java

示例12: onPostExecute

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
@Override
protected void onPostExecute(Boolean result) {
    isDocBuilding.set(false);
    if(isFinishing()) return;
    setSupportProgressBarIndeterminateVisibility(false);
    if (result) {
        if(cacheFile.exists()){
            mWeb.loadUrl(Uri.fromFile(cacheFile).toString());
        }else
        mWeb.loadDataWithBaseURL(getBaseUrl(), mDoc.html(), "text/html", "UTF-8",
                null);
        
        if (hasUseMap)
            mWeb.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
        else
            mWeb.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
            try {
                mWeb.getSettings().setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING);
            } catch (IllegalArgumentException ignored) {
            }
        }
    }
}
 
開發者ID:yrom,項目名稱:AcFun-Area63,代碼行數:25,代碼來源:ArticleActivity.java

示例13: onCreate

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_seementory);
	getActionBar().setHomeButtonEnabled(true);
	getActionBar().setIcon(R.drawable.general_actionbar_back_btnset);
	getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.general_actionbar_bg));
	webView = (WebView)findViewById(R.id.mentory_web);
	webView.getSettings().setJavaScriptEnabled(true);
	webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
	
	String content = getIntent().getStringExtra("mentoring_text");
	String subject = getIntent().getStringExtra("mentoring_subject");
	Log.d("SeeMentory", content);
	
	setTitle(subject);
	
	webView.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
	//webView.loadUrl(getIntent().getStringExtra("mentoring_srl"));
	webView.setWebViewClient(new WebViewClientClass());
	this.localyticsSession = new LocalyticsSession(this.getApplicationContext());  // Context used to access device resources
	this.localyticsSession.open();                // open the session
	this.localyticsSession.upload();      // upload any data
}
 
開發者ID:xxx4u,項目名稱:kidsm_for_android,代碼行數:24,代碼來源:SeeMentoryActivity.java

示例14: onCreate

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的package包/類
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_doctypeerror);
	webView = (WebView)findViewById(R.id.error_view);
	webView.getSettings().setJavaScriptEnabled(true);
	webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
	
	String error = getIntent().getStringExtra("error");
	String uri = getIntent().getStringExtra("uri");
	String params = getIntent().getStringExtra("params");
	webView.loadDataWithBaseURL(null, error, "text/html", "utf-8", null);
	webView.setWebViewClient(new WebViewClientClass());
	
	TextView textView = (TextView)findViewById(R.id.error_text);
	textView.setText("uri:"+uri+"\n"+"params:"+params+"\n�� ��ư�� ������ ȭ������ ���ư��ϴ�.");
	this.localyticsSession = new LocalyticsSession(this.getApplicationContext());  // Context used to access device resources
	this.localyticsSession.open();                // open the session
	this.localyticsSession.upload();      // upload any data
}
 
開發者ID:xxx4u,項目名稱:kidsm_for_android,代碼行數:20,代碼來源:DoctypeErrorActivity.java

示例15: initView

import android.webkit.WebSettings.LayoutAlgorithm; //導入依賴的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


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