WebView setInitialScale - 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 setInitialScale method.

This code example shows how to use the following methods:requestFocusFromTouch, setId, setSaveEnabled, setInitialScale
package com.troubadorian.streamradio.controller; 
 
import android.content.Intent; 
import android.os.Bundle; 
import android.webkit.WebView; 
 
//	TODO: prevent redirects from opening normal browser 
public class IHRControllerWeb extends IHRController { 
	 
	public void prepareView() { 
		WebView					web = new WebView( activity() );
		 
		web.setId( 236 );	//	for saving state
		web.setSaveEnabled( true );
//		web.setWebViewClient( this ); 
//		web.setWebChromeClient( this ); 
		web.setInitialScale( 0 );
		 
		setContentView( web );
		 

6
CodeRank
This code example shows how to use the following methods:getSettings, loadUrl, setInitialScale, setWebViewClient
      return true; 
   } 
 
   public static void loadUrl( WebView webView, String url ) {
 
      webView.setWebViewClient( new WebViewClientX() );
      webView.setInitialScale( 65 );
 
      WebSettings webSettings = webView.getSettings();
      webSettings.setSavePassword( false );
      webSettings.setSaveFormData( false );
      webSettings.setJavaScriptEnabled( false );
      webSettings.setUseWideViewPort( false );
 
      webView.loadUrl( url );
   } 
 
   public static void loadData( WebView webView, String data ) {
 
      webView.setWebViewClient( new WebViewClientX() );
6
CodeRank
This code example shows how to use the following methods:setFocusable, setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, clearCache, setBackgroundColor
This code example shows how to use the following methods:setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, getScale, getSettings, setBackgroundColor
6
CodeRank
This code example shows how to use the following methods:getSettings, setBackgroundColor, setInitialScale
	 
	//build a webView... 
	public static WebView getWebViewForScreen(final Activity theActivity, final BT_item theScreenData){
		BT_debugger.showIt(objectName + ":getWebViewForScreen with nickname: \"" + theScreenData.getItemNickname() + "\"");
 
		WebView	webView = new WebView(theActivity);
		webView.setBackgroundColor(0);
		webView.setInitialScale(0);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportZoom(true);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setPluginsEnabled(true);
 
        //return 
		return webView;
	 
		 
	} 
	 
	 
5
CodeRank
This code example shows how to use the following methods:getSettings, setInitialScale
    /** 
     * Sets the browser settings so that we don't save anything unnecessary and the beddit login page is shown nicely. 
     */ 
    private void setSettings() { 
        // Here we set various settings regarding browser experience. 
        WebSettings settings = webview.getSettings();
        webview.setInitialScale(1);
        settings.setSavePassword(false);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setAppCacheEnabled(false);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
    } 
 
    /** 
     * Initializes the BedditLoginClient and opens the oAuth2 url to begin the login process. 
     */ 
    private void openAuthBrowser() { 
        // Initialize the webClient 
5
CodeRank
This code example shows how to use the following methods:setVerticalScrollBarEnabled, addJavascriptInterface, getSettings, setInitialScale, setLayoutParams
        root = new LinearLayout(this);
        root.setOrientation(LinearLayout.VERTICAL);
        root.setBackgroundColor(Color.BLACK);
        root.setLayoutParams(containerParams);
                 
        appView = new WebView(this);
        appView.setLayoutParams(webviewParams);
         
        WebViewReflect.checkCompatibility(); 
         
        /* This changes the setWebChromeClient to log alerts to LogCat!  Important for Javascript Debugging */        
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ECLAIR)
        	appView.setWebChromeClient(new EclairClient(this));        	
        else 
        	appView.setWebChromeClient(new GapClient(this));
         
        appView.setInitialScale(100);
        appView.setVerticalScrollBarEnabled(false);
         
        WebSettings settings = appView.getSettings();

0
CodeRank

Related WebView setInitialScale Questions & Answers:

setInitialScale Method Overview
Sets the initial scale for this WebView.
See Code Examples for other Android WebView Methods: