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

This code example shows how to use the following methods:setScrollbarFadingEnabled, getSettings, setMapTrackballToArrowKeys, setScrollBarStyle
        initWebViewSettings(w);
        return w;
    } 
 
    protected void initWebViewSettings(WebView w) {
        w.setScrollbarFadingEnabled(true);
        w.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
        w.setMapTrackballToArrowKeys(false); // use trackball directly
        // Enable the built-in zoom 
        w.getSettings().setBuiltInZoomControls(true);
        final PackageManager pm = mContext.getPackageManager();
        boolean supportsMultiTouch =
                pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)
                || pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT);
        w.getSettings().setDisplayZoomControls(!supportsMultiTouch);
 
        // Add this WebView to the settings observer list and update the 
        // settings 
        final BrowserSettings s = BrowserSettings.getInstance();
        s.startManagingSettings(w.getSettings());

8
CodeRank
This code example shows how to use the following methods:setScrollbarFadingEnabled, getSettings, setMapTrackballToArrowKeys, setScrollBarStyle
        initWebViewSettings(w);
        return w;
    } 
 
    protected void initWebViewSettings(WebView w) {
        w.setScrollbarFadingEnabled(true);
        w.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
        w.setMapTrackballToArrowKeys(false); // use trackball directly
        // Enable the built-in zoom 
        w.getSettings().setBuiltInZoomControls(true);
        final PackageManager pm = mContext.getPackageManager();
        boolean supportsMultiTouch =
                pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)
                || pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT);
        w.getSettings().setDisplayZoomControls(!supportsMultiTouch);
 
        // Add this WebView to the settings observer list and update the 
        // settings 
        final BrowserSettings s = BrowserSettings.getInstance();
        s.startManagingSettings(w.getSettings());

7
CodeRank
This code example shows how to use the following methods:getSettings, setScrollBarStyle
This code example shows how to use the following methods:loadDataWithBaseURL, setBackgroundColor, setScrollBarStyle
	 * @param context 
	 * @param html 
	 */ 
	public static void showHtml(final Context context, final String html) {
		AlertDialog.Builder moreDetailsDialog = null;
		final WebView webView = new WebView(context);
		final ScrollView scrollView = new ScrollView(context);
 
		webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
		webView.setBackgroundColor(Color.WHITE);
		webView.loadDataWithBaseURL("fake://not/needed", html, "text/html", "UTF-8", null); // Encoding
																							// fix 
																							// for 
																							// Android 
																							// 3.x 
																							// / 
																							// 4.x 
		scrollView.addView(webView);
 
		moreDetailsDialog = new AlertDialog.Builder(context);
6
CodeRank
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
This code example shows how to use the following methods:loadUrl, setBackgroundColor, setScrollBarStyle, setWebViewClient
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
 
        mWebView = new WebView(this);
        mWebView.setBackgroundColor(0xFFEEEEEE);
        mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        mWebView.setWebViewClient(new WebViewClient() {
            @Override 
            public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
                view.loadUrl(url);
                return true; 
            } 
        }); 
        mWebView.loadUrl("file:///android_asset/licenses.html");
 
        setContentView(mWebView);
    } 
 

6
CodeRank
This code example shows how to use the following methods:addJavascriptInterface, getSettings, loadUrl, setScrollBarStyle, setWebChromeClient
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         
        web = new WebView(this);
        web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
        setContentView(web);
         
        web.getSettings().setJavaScriptEnabled(true);
        web.getSettings().setAllowFileAccess(true);
        WebViewJavascriptInterface javascriptInterface = new WebViewJavascriptInterface();
        web.addJavascriptInterface(javascriptInterface, "android");
        web.setWebChromeClient(new WebChromeClient());
        web.setWebViewClient(new GenericWebViewClient());
         
        Intent intent = getIntent();
        String contentProviderBaseUri = intent.getStringExtra("base_uri");
        try { 
            server = new HttpServer(6789, "/explorer");

6
CodeRank
This code example shows how to use the following methods:getSettings, setScrollBarStyle, setWebViewClient
This code example shows how to use the following methods:setHorizontalScrollBarEnabled, setOnTouchListener, setScrollContainer, setVerticalScrollBarEnabled, getSettings
This code example shows how to use the following methods:getSettings, loadUrl, setScrollBarStyle
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        enchantView = new WebView(this);
        setContentView(enchantView);
 
        enchantView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        enchantView.getSettings().setJavaScriptEnabled(true);
 
        enchantView.loadUrl(ENCHANT_URL);
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true; 
    } 
 
6
CodeRank

Related WebView setScrollBarStyle Questions & Answers:

setScrollBarStyle Method Overview
Specify the style of the scrollbars.
See Code Examples for other Android WebView Methods: