Example usage for android.webkit WebView setScrollBarStyle

List of usage examples for android.webkit WebView setScrollBarStyle

Introduction

In this page you can find the example usage for android.webkit WebView setScrollBarStyle.

Prototype

@Override
    public void setScrollBarStyle(int style) 

Source Link

Usage

From source file:net.naonedbus.utils.InfoDialogUtils.java

/**
 * Afficher une dialog avec un contenu au format HTML
 * /*ww  w. j a v  a2  s  . c  o m*/
 * @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);
    moreDetailsDialog.setIcon(android.R.drawable.ic_dialog_info);
    moreDetailsDialog.setTitle("Informations");
    moreDetailsDialog.setView(scrollView);
    moreDetailsDialog.setPositiveButton(android.R.string.ok, null);
    moreDetailsDialog.show();
}

From source file:com.dwdesign.tweetings.fragment.WebMapFragment.java

/** Sets up the WebView object and loads the URL of the page **/
private void setupWebView() {

    final WebView webview = getWebView();
    webview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    setWebViewClient(new MapWebViewClient(getActivity()));
    loadUrl(mUri.toString());/*w  w  w  . jav  a2  s  . c  om*/

    final WebSettings settings = webview.getSettings();
    settings.setBuiltInZoomControls(false);

    /** Allows JavaScript calls to access application resources **/
    webview.addJavascriptInterface(new JavaScriptInterface(), "android");

}

From source file:com.yoavst.quickapps.news.LoginActivity.java

@SuppressLint("SetJavaScriptEnabled")
private WebView createWebView(final Context context) {
    WebView webView = new WebView(context);
    webView.setWebViewClient(createWebViewClient());
    webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    webView.setVisibility(View.VISIBLE);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setBuiltInZoomControls(false);
    return webView;
}

From source file:com.ezac.gliderlogs.FlightNotamBLXActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from w  w w. j  ava2s . c  o m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://www.notaminfo.com/belgiummap");

}

From source file:com.ezac.gliderlogs.FlightNotamNLDActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*  w w w .  jav a 2 s  .  com*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://www.zweefvlieg.net/notam2014/");

}

From source file:com.ezac.gliderlogs.FlightRaspActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from   www .  j  ava  2 s .  c o  m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://blipmaps.nl/showblipmap.php?Param=sfctemp&Day=0&Time=1130&Lang=En&Stage=1");

}

From source file:com.ezac.gliderlogs.FlightADSBActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);//from   ww  w. ja v a 2s .co  m

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://86.83.189.66:8099//gmap.php");
}

From source file:com.ezac.gliderlogs.FlightGliderActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from  w w w  . j  a  v a2s  .c o  m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://live.glidertracking.com/index.php");
}

From source file:com.ezac.gliderlogs.FlightOGNActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);//from   ww w.  ja v  a 2s  .co m

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://live.glidernet.org/#c=51.27405,3.93909&z=11");
}

From source file:com.ezac.gliderlogs.FlightEzacActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.ezac_list);/*  w ww .ja  v  a2  s.c o m*/

    // hide soft keyboard
    setMode();

    Button close = (Button) findViewById(R.id.button_close);

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://www.ezac.nl/drupal/");

    close.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            setResult(RESULT_OK);
            finish();
        }
    });
}