WebView setLayoutParams - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebView setLayoutParams method.

This code example shows how to use the following methods: setId, setLayoutParams
    if ((row == null) || (row.findViewById(1337) == null)) {
      RelativeLayout layout = new RelativeLayout(activity);
      layout.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT, ListView.LayoutParams.WRAP_CONTENT));
      row = layout;
       
      WebView webView = new WebView(activity);
      webView.setId(1337);
      RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); 
      float scale = activity.getResources().getDisplayMetrics().density;
      boolean leftPadding = (parent.getTag().equals("right"));
      params.setMargins((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(0 * scale), (int)(20 * scale), 0);
      webView.setLayoutParams(params);
      layout.addView(webView);
    } 
       
    WebView webView = (WebView)row.findViewById(1337);
 
    String item = (String)getItem(position);
    if (item.trim().length() == 0) {
      webView.loadData("<em>No information.</em>", "text/html", "utf-8");
Full Snippet Info
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setVisibility, getSettings, loadUrl, setLayoutParams, setWebViewClient
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, getSettings, setLayoutParams, setWebViewClient
		 
		NMEWebView.HaxeListenerClass = _haxeListenerClass;
		 
		View view;
		 
		WebView webView = new WebView(GameActivity.getContext());
		webView.setVerticalScrollBarEnabled(false);
        webView.setHorizontalScrollBarEnabled(false);
		webView.setWebViewClient(new WebViewClient() {
			@Override 
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				NMEWebView.HaxeListenerClass.call1("onURLChanging", url);
				view.loadUrl(url);
				 
				return true; 
			} 
		}); 
		 
		WebSettings webSettings = webView.getSettings();
		webSettings.setSavePassword(false);

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setId, setBackgroundColor, setLayoutParams
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: loadData, setLayoutParams, setView
		if (mDialog != null) {
			mDialog.dismiss();
			mDialog = null;
		} 
		AlertDialog.Builder b = new AlertDialog.Builder(c);
		WebView html = new WebView(c);
		html.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
		html.loadData(loadAssetFile(c, c.getString(filenameid)), "text/html", "UTF-8");
		mDialog = b.setIcon(null)
				.setView(html)
				.setPositiveButton("OK", this)
				.show();
	} 
	 
	private String loadAssetFile(Context c, String name) {
		try { 
			BufferedReader r = new BufferedReader(new InputStreamReader(c.getAssets().open(name)));
			StringBuilder sb = new StringBuilder();
			do { 
				String line = r.readLine();
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getSettings, loadUrl, setLayoutParams, setScrollBarStyle, setWebChromeClient
		getWindow().requestFeature(Window.FEATURE_PROGRESS);
 
		// Makes Progress bar Visible 
		getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
 
		WebView webView = new WebView(this);
		webView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT, 1f));
		webView.loadUrl(getIntent().getDataString());
		webView.getSettings().setJavaScriptEnabled(true);
		webView.getSettings().setSupportZoom(true);
		webView.getSettings().setBuiltInZoomControls(true);
//		webView.getSettings().setLoadWithOverviewMode(true); // not supported by older versions of Android 
		webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
		webView.getSettings().setUseWideViewPort(true);
 
		setContentView(webView);
		 
		webView.setWebViewClient(new WebViewClient() {
			@Override 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setLayoutParams, setWebChromeClient
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
      //mWebView = (WebView) findViewById(R.id.webView); 
		mWebView = new WebView(this);
 
		mWebView.setLayoutParams(new LinearLayout.LayoutParams(
				LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
		setContentView(mWebView);
		mWebView.loadUrl("file:///android_asset/www/index2.html");
		mWebView.getSettings().setJavaScriptEnabled(true);
		mWebView.addJavascriptInterface(new MyHybrid(), "MyHybrid");
		mWebView.setWebChromeClient(new WebChromeClient() {
			@Override 
			public void onConsoleMessage(String message, int lineNumber,
					String sourceID) {
				super.onConsoleMessage(message, lineNumber, sourceID);
			} 
		}); 
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, getSettings, loadUrl, setLayoutParams
				mContent.addView(mTitle);
			} 
 
		private void setUpWebView() 
			{ 
				mWebView = new WebView(getContext());
				mWebView.setVerticalScrollBarEnabled(false);
				mWebView.setHorizontalScrollBarEnabled(false);
				mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
				mWebView.getSettings().setJavaScriptEnabled(true);
				mWebView.loadUrl(mUrl);
				mWebView.setLayoutParams(FILL);
				mContent.addView(mWebView);
			} 
 
		private class FbWebViewClient extends WebViewClient
			{ 
 
				@Override 
				public boolean shouldOverrideUrlLoading(WebView view, String url)
Full Snippet Info
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, setVisibility, getSettings, loadUrl
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, getSettings, loadUrl, setLayoutParams
    private void setUpWebView() { 
    	CookieSyncManager.createInstance(getContext()); 
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.removeAllCookie();
         
        mWebView = new WebView(getContext());
         
        mWebView.setVerticalScrollBarEnabled(false);
        mWebView.setHorizontalScrollBarEnabled(false);
        mWebView.setWebViewClient(new TwitterWebViewClient());
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.loadUrl(mUrl);
        mWebView.setLayoutParams(FILL);
         
        mContent.addView(mWebView);
    } 
 
    private class TwitterWebViewClient extends WebViewClient {
 
        @Override 
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related WebView setLayoutParams Questions & Answers:

setLayoutParams Method Overview
Set the layout parameters associated with this view.
See Code Examples for other Android WebView Methods: